public static native boolean LDKCResult_RouteDecodeErrorZ_result_ok(long arg);
public static native long LDKCResult_RouteDecodeErrorZ_get_ok(long arg);
public static native long LDKCResult_RouteDecodeErrorZ_get_err(long arg);
+ public static native boolean LDKCResult_RouteParametersDecodeErrorZ_result_ok(long arg);
+ public static native long LDKCResult_RouteParametersDecodeErrorZ_get_ok(long arg);
+ public static native long LDKCResult_RouteParametersDecodeErrorZ_get_err(long arg);
+ public static native long LDKCVec_RouteHintZ_new(long[] elems);
public static class LDKCOption_u64Z {
private LDKCOption_u64Z() {}
public final static class Some extends LDKCOption_u64Z {
}
static { LDKCOption_u64Z.init(); }
public static native LDKCOption_u64Z LDKCOption_u64Z_ref_from_ptr(long ptr);
+ public static native boolean LDKCResult_PayeeDecodeErrorZ_result_ok(long arg);
+ public static native long LDKCResult_PayeeDecodeErrorZ_get_ok(long arg);
+ public static native long LDKCResult_PayeeDecodeErrorZ_get_err(long arg);
+ public static native long LDKCVec_RouteHintHopZ_new(long[] elems);
+ public static native boolean LDKCResult_RouteHintDecodeErrorZ_result_ok(long arg);
+ public static native long LDKCResult_RouteHintDecodeErrorZ_get_ok(long arg);
+ public static native long LDKCResult_RouteHintDecodeErrorZ_get_err(long arg);
+ public static native boolean LDKCResult_RouteHintHopDecodeErrorZ_result_ok(long arg);
+ public static native long LDKCResult_RouteHintHopDecodeErrorZ_get_ok(long arg);
+ public static native long LDKCResult_RouteHintHopDecodeErrorZ_get_err(long arg);
public static native long LDKCVec_ChannelDetailsZ_new(long[] elems);
- public static native long LDKCVec_RouteHintZ_new(long[] elems);
public static native boolean LDKCResult_RouteLightningErrorZ_result_ok(long arg);
public static native long LDKCResult_RouteLightningErrorZ_get_ok(long arg);
public static native long LDKCResult_RouteLightningErrorZ_get_err(long arg);
public long commitment_tx_confirmed;
CommitmentTxConfirmed(long commitment_tx_confirmed) { this.commitment_tx_confirmed = commitment_tx_confirmed; }
}
+ public final static class UpdateCompleted extends LDKMonitorEvent {
+ public long funding_txo;
+ public long monitor_update_id;
+ UpdateCompleted(long funding_txo, long monitor_update_id) { this.funding_txo = funding_txo; this.monitor_update_id = monitor_update_id; }
+ }
+ public final static class UpdateFailed extends LDKMonitorEvent {
+ public long update_failed;
+ UpdateFailed(long update_failed) { this.update_failed = update_failed; }
+ }
static native void init();
}
static { LDKMonitorEvent.init(); }
public static native boolean LDKCResult_InvoiceFeaturesDecodeErrorZ_result_ok(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 boolean LDKCResult_ScoringParametersDecodeErrorZ_result_ok(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 boolean LDKCResult_ScorerDecodeErrorZ_result_ok(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 boolean LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ_result_ok(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 boolean LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_result_ok(long arg);
public static native long[] LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_get_ok(long arg);
public static native IOError LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_get_err(long arg);
- public static native boolean LDKCResult_PaymentIdDecodeErrorZ_result_ok(long arg);
- public static native long LDKCResult_PaymentIdDecodeErrorZ_get_ok(long arg);
- public static native long LDKCResult_PaymentIdDecodeErrorZ_get_err(long arg);
public static class LDKCOption_u16Z {
private LDKCOption_u16Z() {}
public final static class Some extends LDKCOption_u16Z {
AllFailedRetrySafe(long[] all_failed_retry_safe) { this.all_failed_retry_safe = all_failed_retry_safe; }
}
public final static class PartialFailure extends LDKPaymentSendFailure {
- public long[] partial_failure;
- PartialFailure(long[] partial_failure) { this.partial_failure = partial_failure; }
+ public long[] results;
+ public long failed_paths_retry;
+ public byte[] payment_id;
+ PartialFailure(long[] results, long failed_paths_retry, byte[] payment_id) { this.results = results; this.failed_paths_retry = failed_paths_retry; this.payment_id = payment_id; }
}
static native void init();
}
static { LDKPaymentSendFailure.init(); }
public static native LDKPaymentSendFailure LDKPaymentSendFailure_ref_from_ptr(long ptr);
public static native boolean LDKCResult_PaymentIdPaymentSendFailureZ_result_ok(long arg);
- public static native long LDKCResult_PaymentIdPaymentSendFailureZ_get_ok(long arg);
+ public static native byte[] LDKCResult_PaymentIdPaymentSendFailureZ_get_ok(long arg);
public static native long LDKCResult_PaymentIdPaymentSendFailureZ_get_err(long arg);
public static native boolean LDKCResult_NonePaymentSendFailureZ_result_ok(long arg);
public static native void LDKCResult_NonePaymentSendFailureZ_get_ok(long arg);
public static native long LDKCResult_NonePaymentSendFailureZ_get_err(long arg);
// struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentIdZ_get_a(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR tuple);
public static native byte[] C2Tuple_PaymentHashPaymentIdZ_get_a(long tuple);
- // struct LDKPaymentId C2Tuple_PaymentHashPaymentIdZ_get_b(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR tuple);
- public static native long C2Tuple_PaymentHashPaymentIdZ_get_b(long tuple);
+ // struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentIdZ_get_b(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR tuple);
+ public static native byte[] C2Tuple_PaymentHashPaymentIdZ_get_b(long tuple);
public static native boolean LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_result_ok(long arg);
public static native long LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_ok(long arg);
public static native long LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_err(long arg);
public static native boolean LDKCResult_COption_TypeZDecodeErrorZ_result_ok(long arg);
public static native long LDKCResult_COption_TypeZDecodeErrorZ_get_ok(long arg);
public static native long LDKCResult_COption_TypeZDecodeErrorZ_get_err(long arg);
+ public static class LDKPaymentError {
+ private LDKPaymentError() {}
+ public final static class Invoice extends LDKPaymentError {
+ public String invoice;
+ Invoice(String invoice) { this.invoice = invoice; }
+ }
+ public final static class Routing extends LDKPaymentError {
+ public long routing;
+ Routing(long routing) { this.routing = routing; }
+ }
+ public final static class Sending extends LDKPaymentError {
+ public long sending;
+ Sending(long sending) { this.sending = sending; }
+ }
+ static native void init();
+ }
+ static { LDKPaymentError.init(); }
+ public static native LDKPaymentError LDKPaymentError_ref_from_ptr(long ptr);
+ public static native boolean LDKCResult_PaymentIdPaymentErrorZ_result_ok(long arg);
+ public static native byte[] LDKCResult_PaymentIdPaymentErrorZ_get_ok(long arg);
+ public static native long LDKCResult_PaymentIdPaymentErrorZ_get_err(long arg);
public static native boolean LDKCResult_SiPrefixNoneZ_result_ok(long arg);
public static native SiPrefix LDKCResult_SiPrefixNoneZ_get_ok(long arg);
public static native void LDKCResult_SiPrefixNoneZ_get_err(long arg);
PaymentReceived(byte[] payment_hash, long amt, long purpose) { this.payment_hash = payment_hash; this.amt = amt; this.purpose = purpose; }
}
public final static class PaymentSent extends LDKEvent {
+ public byte[] payment_id;
public byte[] payment_preimage;
public byte[] payment_hash;
- PaymentSent(byte[] payment_preimage, byte[] payment_hash) { this.payment_preimage = payment_preimage; this.payment_hash = payment_hash; }
+ public long fee_paid_msat;
+ PaymentSent(byte[] payment_id, byte[] payment_preimage, byte[] payment_hash, long fee_paid_msat) { this.payment_id = payment_id; this.payment_preimage = payment_preimage; this.payment_hash = payment_hash; this.fee_paid_msat = fee_paid_msat; }
}
public final static class PaymentPathFailed extends LDKEvent {
+ public byte[] payment_id;
public byte[] payment_hash;
public boolean rejected_by_dest;
public long network_update;
public boolean all_paths_failed;
public long[] path;
public long short_channel_id;
- PaymentPathFailed(byte[] payment_hash, boolean rejected_by_dest, long network_update, boolean all_paths_failed, long[] path, long short_channel_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; }
+ 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 PendingHTLCsForwardable extends LDKEvent {
public long time_forwardable;
}
static { LDKCOption_CVec_NetAddressZZ.init(); }
public static native LDKCOption_CVec_NetAddressZZ LDKCOption_CVec_NetAddressZZ_ref_from_ptr(long ptr);
- public static native boolean LDKCResult_NetAddressu8Z_result_ok(long arg);
- public static native long LDKCResult_NetAddressu8Z_get_ok(long arg);
- public static native byte LDKCResult_NetAddressu8Z_get_err(long arg);
- public static native boolean LDKCResult_CResult_NetAddressu8ZDecodeErrorZ_result_ok(long arg);
- public static native long LDKCResult_CResult_NetAddressu8ZDecodeErrorZ_get_ok(long arg);
- public static native long LDKCResult_CResult_NetAddressu8ZDecodeErrorZ_get_err(long arg);
public static native boolean LDKCResult_NetAddressDecodeErrorZ_result_ok(long arg);
public static native long LDKCResult_NetAddressDecodeErrorZ_get_ok(long arg);
public static native long LDKCResult_NetAddressDecodeErrorZ_get_err(long arg);
// LDKCVec_TxidZ Confirm_get_relevant_txids LDKConfirm *NONNULL_PTR this_arg
public static native byte[][] Confirm_get_relevant_txids(long this_arg);
public interface LDKPersist {
- long persist_new_channel(long id, long data);
- long update_persisted_channel(long id, long update, long data);
+ long persist_new_channel(long channel_id, long data, long update_id);
+ long update_persisted_channel(long channel_id, long update, long data, long update_id);
}
public static native long LDKPersist_new(LDKPersist impl);
- // LDKCResult_NoneChannelMonitorUpdateErrZ Persist_persist_new_channel LDKPersist *NONNULL_PTR this_arg, struct LDKOutPoint id, const struct LDKChannelMonitor *NONNULL_PTR data
- public static native long Persist_persist_new_channel(long this_arg, long id, long data);
- // LDKCResult_NoneChannelMonitorUpdateErrZ Persist_update_persisted_channel LDKPersist *NONNULL_PTR this_arg, struct LDKOutPoint id, const struct LDKChannelMonitorUpdate *NONNULL_PTR update, const struct LDKChannelMonitor *NONNULL_PTR data
- public static native long Persist_update_persisted_channel(long this_arg, long id, long update, long data);
+ // LDKCResult_NoneChannelMonitorUpdateErrZ Persist_persist_new_channel LDKPersist *NONNULL_PTR this_arg, struct LDKOutPoint channel_id, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id
+ public static native long Persist_persist_new_channel(long this_arg, long channel_id, long data, long update_id);
+ // LDKCResult_NoneChannelMonitorUpdateErrZ Persist_update_persisted_channel LDKPersist *NONNULL_PTR this_arg, struct LDKOutPoint channel_id, const struct LDKChannelMonitorUpdate *NONNULL_PTR update, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id
+ public static native long Persist_update_persisted_channel(long this_arg, long channel_id, long update, long data, long update_id);
public interface LDKChannelMessageHandler {
void handle_open_channel(byte[] their_node_id, long their_features, long msg);
void handle_accept_channel(byte[] their_node_id, long their_features, long msg);
// 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 channel_penalty_msat(long short_channel_id, long source, long target);
+ void payment_path_failed(long[] path, long short_channel_id);
+ 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
- public static native long Score_channel_penalty_msat(long this_arg, long short_channel_id);
+ // 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);
+ // 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);
+ // LDKCVec_u8Z Score_write LDKScore *NONNULL_PTR this_arg
+ public static native byte[] Score_write(long this_arg);
public interface LDKChannelManagerPersister {
long persist_manager(long channel_manager);
}
}
static { LDKFallback.init(); }
public static native LDKFallback LDKFallback_ref_from_ptr(long ptr);
+ public interface LDKPayer {
+ byte[] node_id();
+ long[] first_hops();
+ long send_payment(long route, byte[] payment_hash, byte[] payment_secret);
+ long retry_payment(long route, byte[] payment_id);
+ }
+ public static native long LDKPayer_new(LDKPayer impl);
+ // LDKPublicKey Payer_node_id LDKPayer *NONNULL_PTR this_arg
+ public static native byte[] Payer_node_id(long this_arg);
+ // LDKCVec_ChannelDetailsZ Payer_first_hops 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_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);
+ public interface LDKRouter {
+ long find_route(byte[] payer, long params, 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);
// 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 void CResult_RouteDecodeErrorZ_free(long _res);
// struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig);
public static native long CResult_RouteDecodeErrorZ_clone(long orig);
+ // struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_ok(struct LDKRouteParameters o);
+ public static native long CResult_RouteParametersDecodeErrorZ_ok(long o);
+ // struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_err(struct LDKDecodeError e);
+ public static native long CResult_RouteParametersDecodeErrorZ_err(long e);
+ // void CResult_RouteParametersDecodeErrorZ_free(struct LDKCResult_RouteParametersDecodeErrorZ _res);
+ public static native void CResult_RouteParametersDecodeErrorZ_free(long _res);
+ // struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_clone(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR orig);
+ public static native long CResult_RouteParametersDecodeErrorZ_clone(long orig);
+ // void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res);
+ public static native void CVec_RouteHintZ_free(long[] _res);
// struct LDKCOption_u64Z COption_u64Z_some(uint64_t o);
public static native long COption_u64Z_some(long o);
// struct LDKCOption_u64Z COption_u64Z_none(void);
public static native void COption_u64Z_free(long _res);
// struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig);
public static native long COption_u64Z_clone(long orig);
+ // struct LDKCResult_PayeeDecodeErrorZ CResult_PayeeDecodeErrorZ_ok(struct LDKPayee o);
+ public static native long CResult_PayeeDecodeErrorZ_ok(long o);
+ // struct LDKCResult_PayeeDecodeErrorZ CResult_PayeeDecodeErrorZ_err(struct LDKDecodeError e);
+ public static native long CResult_PayeeDecodeErrorZ_err(long e);
+ // void CResult_PayeeDecodeErrorZ_free(struct LDKCResult_PayeeDecodeErrorZ _res);
+ public static native void CResult_PayeeDecodeErrorZ_free(long _res);
+ // struct LDKCResult_PayeeDecodeErrorZ CResult_PayeeDecodeErrorZ_clone(const struct LDKCResult_PayeeDecodeErrorZ *NONNULL_PTR orig);
+ public static native long CResult_PayeeDecodeErrorZ_clone(long orig);
+ // void CVec_RouteHintHopZ_free(struct LDKCVec_RouteHintHopZ _res);
+ public static native void CVec_RouteHintHopZ_free(long[] _res);
+ // struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_ok(struct LDKRouteHint o);
+ public static native long CResult_RouteHintDecodeErrorZ_ok(long o);
+ // struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_err(struct LDKDecodeError e);
+ public static native long CResult_RouteHintDecodeErrorZ_err(long e);
+ // void CResult_RouteHintDecodeErrorZ_free(struct LDKCResult_RouteHintDecodeErrorZ _res);
+ public static native void CResult_RouteHintDecodeErrorZ_free(long _res);
+ // struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_clone(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR orig);
+ public static native long CResult_RouteHintDecodeErrorZ_clone(long orig);
+ // struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_ok(struct LDKRouteHintHop o);
+ public static native long CResult_RouteHintHopDecodeErrorZ_ok(long o);
+ // struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_err(struct LDKDecodeError e);
+ public static native long CResult_RouteHintHopDecodeErrorZ_err(long e);
+ // void CResult_RouteHintHopDecodeErrorZ_free(struct LDKCResult_RouteHintHopDecodeErrorZ _res);
+ public static native void CResult_RouteHintHopDecodeErrorZ_free(long _res);
+ // struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_clone(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR orig);
+ public static native long CResult_RouteHintHopDecodeErrorZ_clone(long orig);
// void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res);
public static native void CVec_ChannelDetailsZ_free(long[] _res);
- // void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res);
- public static native void CVec_RouteHintZ_free(long[] _res);
// struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o);
public static native long CResult_RouteLightningErrorZ_ok(long o);
// struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e);
public static native long CResult_InvoiceFeaturesDecodeErrorZ_err(long e);
// 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);
+ // 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);
+ // void CResult_ScorerDecodeErrorZ_free(struct LDKCResult_ScorerDecodeErrorZ _res);
+ public static native void CResult_ScorerDecodeErrorZ_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 void CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(long _res);
// struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone(const struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR orig);
public static native long CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone(long orig);
- // struct LDKCResult_PaymentIdDecodeErrorZ CResult_PaymentIdDecodeErrorZ_ok(struct LDKPaymentId o);
- public static native long CResult_PaymentIdDecodeErrorZ_ok(long o);
- // struct LDKCResult_PaymentIdDecodeErrorZ CResult_PaymentIdDecodeErrorZ_err(struct LDKDecodeError e);
- public static native long CResult_PaymentIdDecodeErrorZ_err(long e);
- // void CResult_PaymentIdDecodeErrorZ_free(struct LDKCResult_PaymentIdDecodeErrorZ _res);
- public static native void CResult_PaymentIdDecodeErrorZ_free(long _res);
- // struct LDKCResult_PaymentIdDecodeErrorZ CResult_PaymentIdDecodeErrorZ_clone(const struct LDKCResult_PaymentIdDecodeErrorZ *NONNULL_PTR orig);
- public static native long CResult_PaymentIdDecodeErrorZ_clone(long orig);
// struct LDKCOption_u16Z COption_u16Z_some(uint16_t o);
public static native long COption_u16Z_some(short o);
// struct LDKCOption_u16Z COption_u16Z_none(void);
public static native void CResult__u832APIErrorZ_free(long _res);
// struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_clone(const struct LDKCResult__u832APIErrorZ *NONNULL_PTR orig);
public static native long CResult__u832APIErrorZ_clone(long orig);
- // struct LDKCResult_PaymentIdPaymentSendFailureZ CResult_PaymentIdPaymentSendFailureZ_ok(struct LDKPaymentId o);
- public static native long CResult_PaymentIdPaymentSendFailureZ_ok(long o);
+ // struct LDKCResult_PaymentIdPaymentSendFailureZ CResult_PaymentIdPaymentSendFailureZ_ok(struct LDKThirtyTwoBytes o);
+ public static native long CResult_PaymentIdPaymentSendFailureZ_ok(byte[] o);
// struct LDKCResult_PaymentIdPaymentSendFailureZ CResult_PaymentIdPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
public static native long CResult_PaymentIdPaymentSendFailureZ_err(long e);
// void CResult_PaymentIdPaymentSendFailureZ_free(struct LDKCResult_PaymentIdPaymentSendFailureZ _res);
public static native long CResult_NonePaymentSendFailureZ_clone(long orig);
// struct LDKC2Tuple_PaymentHashPaymentIdZ C2Tuple_PaymentHashPaymentIdZ_clone(const struct LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR orig);
public static native long C2Tuple_PaymentHashPaymentIdZ_clone(long orig);
- // struct LDKC2Tuple_PaymentHashPaymentIdZ C2Tuple_PaymentHashPaymentIdZ_new(struct LDKThirtyTwoBytes a, struct LDKPaymentId b);
- public static native long C2Tuple_PaymentHashPaymentIdZ_new(byte[] a, long b);
+ // struct LDKC2Tuple_PaymentHashPaymentIdZ C2Tuple_PaymentHashPaymentIdZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
+ public static native long C2Tuple_PaymentHashPaymentIdZ_new(byte[] a, byte[] b);
// void C2Tuple_PaymentHashPaymentIdZ_free(struct LDKC2Tuple_PaymentHashPaymentIdZ _res);
public static native void C2Tuple_PaymentHashPaymentIdZ_free(long _res);
// struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(struct LDKC2Tuple_PaymentHashPaymentIdZ o);
public static native void CResult_COption_TypeZDecodeErrorZ_free(long _res);
// struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_clone(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR orig);
public static native long CResult_COption_TypeZDecodeErrorZ_clone(long orig);
+ // struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_ok(struct LDKThirtyTwoBytes o);
+ public static native long CResult_PaymentIdPaymentErrorZ_ok(byte[] o);
+ // struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_err(struct LDKPaymentError e);
+ public static native long CResult_PaymentIdPaymentErrorZ_err(long e);
+ // void CResult_PaymentIdPaymentErrorZ_free(struct LDKCResult_PaymentIdPaymentErrorZ _res);
+ public static native void CResult_PaymentIdPaymentErrorZ_free(long _res);
+ // struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_clone(const struct LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR orig);
+ public static native long CResult_PaymentIdPaymentErrorZ_clone(long orig);
// struct LDKCResult_SiPrefixNoneZ CResult_SiPrefixNoneZ_ok(enum LDKSiPrefix o);
public static native long CResult_SiPrefixNoneZ_ok(SiPrefix o);
// struct LDKCResult_SiPrefixNoneZ CResult_SiPrefixNoneZ_err(void);
public static native void COption_CVec_NetAddressZZ_free(long _res);
// struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_clone(const struct LDKCOption_CVec_NetAddressZZ *NONNULL_PTR orig);
public static native long COption_CVec_NetAddressZZ_clone(long orig);
- // struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_ok(struct LDKNetAddress o);
- public static native long CResult_NetAddressu8Z_ok(long o);
- // struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_err(uint8_t e);
- public static native long CResult_NetAddressu8Z_err(byte e);
- // void CResult_NetAddressu8Z_free(struct LDKCResult_NetAddressu8Z _res);
- public static native void CResult_NetAddressu8Z_free(long _res);
- // struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_clone(const struct LDKCResult_NetAddressu8Z *NONNULL_PTR orig);
- public static native long CResult_NetAddressu8Z_clone(long orig);
- // struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(struct LDKCResult_NetAddressu8Z o);
- public static native long CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(long o);
- // struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_err(struct LDKDecodeError e);
- public static native long CResult_CResult_NetAddressu8ZDecodeErrorZ_err(long e);
- // void CResult_CResult_NetAddressu8ZDecodeErrorZ_free(struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ _res);
- public static native void CResult_CResult_NetAddressu8ZDecodeErrorZ_free(long _res);
- // struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_clone(const struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ *NONNULL_PTR orig);
- public static native long CResult_CResult_NetAddressu8ZDecodeErrorZ_clone(long orig);
// struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_ok(struct LDKNetAddress o);
public static native long CResult_NetAddressDecodeErrorZ_ok(long o);
// struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_err(struct LDKDecodeError e);
public static native long Event_funding_generation_ready(byte[] temporary_channel_id, long channel_value_satoshis, byte[] output_script, long user_channel_id);
// struct LDKEvent Event_payment_received(struct LDKThirtyTwoBytes payment_hash, uint64_t amt, struct LDKPaymentPurpose purpose);
public static native long Event_payment_received(byte[] payment_hash, long amt, long purpose);
- // struct LDKEvent Event_payment_sent(struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_hash);
- public static native long Event_payment_sent(byte[] payment_preimage, byte[] payment_hash);
- // struct LDKEvent Event_payment_path_failed(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);
- public static native long Event_payment_path_failed(byte[] payment_hash, boolean rejected_by_dest, long network_update, boolean all_paths_failed, long[] path, long short_channel_id);
+ // struct LDKEvent Event_payment_sent(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z fee_paid_msat);
+ 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_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 boolean ConfirmationTarget_eq(long a, long b);
// void FeeEstimator_free(struct LDKFeeEstimator this_ptr);
public static native void FeeEstimator_free(long this_ptr);
+ // void MonitorUpdateId_free(struct LDKMonitorUpdateId this_obj);
+ public static native void MonitorUpdateId_free(long this_obj);
+ // struct LDKMonitorUpdateId MonitorUpdateId_clone(const struct LDKMonitorUpdateId *NONNULL_PTR orig);
+ public static native long MonitorUpdateId_clone(long orig);
+ // uint64_t MonitorUpdateId_hash(const struct LDKMonitorUpdateId *NONNULL_PTR o);
+ public static native long MonitorUpdateId_hash(long o);
+ // bool MonitorUpdateId_eq(const struct LDKMonitorUpdateId *NONNULL_PTR a, const struct LDKMonitorUpdateId *NONNULL_PTR b);
+ public static native boolean MonitorUpdateId_eq(long a, long b);
// void Persist_free(struct LDKPersist this_ptr);
public static native void Persist_free(long this_ptr);
// void LockedChannelMonitor_free(struct LDKLockedChannelMonitor this_obj);
public static native long ChainMonitor_get_monitor(long this_arg, long funding_txo);
// MUST_USE_RES struct LDKCVec_OutPointZ ChainMonitor_list_monitors(const struct LDKChainMonitor *NONNULL_PTR this_arg);
public static native long[] ChainMonitor_list_monitors(long this_arg);
+ // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChainMonitor_channel_monitor_updated(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo, struct LDKMonitorUpdateId completed_update_id);
+ public static native long ChainMonitor_channel_monitor_updated(long this_arg, long funding_txo, long completed_update_id);
// struct LDKListen ChainMonitor_as_Listen(const struct LDKChainMonitor *NONNULL_PTR this_arg);
public static native long ChainMonitor_as_Listen(long this_arg);
// struct LDKConfirm ChainMonitor_as_Confirm(const struct LDKChainMonitor *NONNULL_PTR this_arg);
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);
// 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 long MonitorEvent_htlcevent(long a);
// struct LDKMonitorEvent MonitorEvent_commitment_tx_confirmed(struct LDKOutPoint a);
public static native long MonitorEvent_commitment_tx_confirmed(long a);
+ // struct LDKMonitorEvent MonitorEvent_update_completed(struct LDKOutPoint funding_txo, uint64_t monitor_update_id);
+ public static native long MonitorEvent_update_completed(long funding_txo, long monitor_update_id);
+ // struct LDKMonitorEvent MonitorEvent_update_failed(struct LDKOutPoint a);
+ public static native long MonitorEvent_update_failed(long a);
+ // struct LDKCVec_u8Z MonitorEvent_write(const struct LDKMonitorEvent *NONNULL_PTR obj);
+ public static native byte[] MonitorEvent_write(long obj);
// void HTLCUpdate_free(struct LDKHTLCUpdate this_obj);
public static native void HTLCUpdate_free(long this_obj);
// struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig);
public static native long KeysManager_spend_spendable_outputs(long this_arg, long[] descriptors, long[] outputs, byte[] change_destination_script, int feerate_sat_per_1000_weight);
// struct LDKKeysInterface KeysManager_as_KeysInterface(const struct LDKKeysManager *NONNULL_PTR this_arg);
public static native long KeysManager_as_KeysInterface(long this_arg);
- // void PaymentId_free(struct LDKPaymentId this_obj);
- public static native void PaymentId_free(long this_obj);
- // uint64_t PaymentId_hash(const struct LDKPaymentId *NONNULL_PTR o);
- public static native long PaymentId_hash(long o);
- // struct LDKPaymentId PaymentId_clone(const struct LDKPaymentId *NONNULL_PTR orig);
- public static native long PaymentId_clone(long orig);
- // bool PaymentId_eq(const struct LDKPaymentId *NONNULL_PTR a, const struct LDKPaymentId *NONNULL_PTR b);
- public static native boolean PaymentId_eq(long a, long b);
- // struct LDKCVec_u8Z PaymentId_write(const struct LDKPaymentId *NONNULL_PTR obj);
- public static native byte[] PaymentId_write(long obj);
- // struct LDKCResult_PaymentIdDecodeErrorZ PaymentId_read(struct LDKu8slice ser);
- public static native long PaymentId_read(byte[] ser);
// void ChannelManager_free(struct LDKChannelManager this_obj);
public static native void ChannelManager_free(long this_obj);
// void ChainParameters_free(struct LDKChainParameters this_obj);
public static native long PaymentSendFailure_path_parameter_error(long[] a);
// struct LDKPaymentSendFailure PaymentSendFailure_all_failed_retry_safe(struct LDKCVec_APIErrorZ a);
public static native long PaymentSendFailure_all_failed_retry_safe(long[] a);
- // struct LDKPaymentSendFailure PaymentSendFailure_partial_failure(struct LDKCVec_CResult_NoneAPIErrorZZ a);
- public static native long PaymentSendFailure_partial_failure(long[] a);
+ // struct LDKPaymentSendFailure PaymentSendFailure_partial_failure(struct LDKCVec_CResult_NoneAPIErrorZZ results, struct LDKRouteParameters failed_paths_retry, struct LDKThirtyTwoBytes payment_id);
+ public static native long PaymentSendFailure_partial_failure(long[] results, long failed_paths_retry, byte[] payment_id);
// MUST_USE_RES struct LDKChannelManager ChannelManager_new(struct LDKFeeEstimator fee_est, struct LDKWatch chain_monitor, struct LDKBroadcasterInterface tx_broadcaster, struct LDKLogger logger, struct LDKKeysInterface keys_manager, struct LDKUserConfig config, struct LDKChainParameters params);
public static native long ChannelManager_new(long fee_est, long chain_monitor, long tx_broadcaster, long logger, long keys_manager, long config, long params);
// MUST_USE_RES struct LDKUserConfig ChannelManager_get_current_default_configuration(const struct LDKChannelManager *NONNULL_PTR this_arg);
public static native void ChannelManager_force_close_all_channels(long this_arg);
// MUST_USE_RES struct LDKCResult_PaymentIdPaymentSendFailureZ ChannelManager_send_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret);
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 LDKPaymentId payment_id);
- public static native long ChannelManager_retry_payment(long this_arg, long route, long payment_id);
+ // 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);
// 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);
- // void ChannelManager_channel_monitor_updated(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKOutPoint *NONNULL_PTR funding_txo, uint64_t highest_applied_update_id);
- public static native void ChannelManager_channel_monitor_updated(long this_arg, long funding_txo, long highest_applied_update_id);
// 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 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 byte[] NetAddress_write(long obj);
- // struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ Result_read(struct LDKu8slice ser);
- public static native long Result_read(byte[] ser);
// struct LDKCResult_NetAddressDecodeErrorZ NetAddress_read(struct LDKu8slice ser);
public static native long NetAddress_read(byte[] ser);
// void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_obj);
public static native void PeerManager_socket_disconnected(long this_arg, long descriptor);
// void PeerManager_disconnect_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id, bool no_connection_possible);
public static native void PeerManager_disconnect_by_node_id(long this_arg, byte[] node_id, boolean no_connection_possible);
+ // void PeerManager_disconnect_all_peers(const struct LDKPeerManager *NONNULL_PTR this_arg);
+ 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);
// struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx);
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);
// struct LDKNodeId NodeId_clone(const struct LDKNodeId *NONNULL_PTR orig);
public static native long NetGraphMsgHandler_as_EventHandler(long this_arg);
// void NetGraphMsgHandler_free(struct LDKNetGraphMsgHandler this_obj);
public static native void NetGraphMsgHandler_free(long this_obj);
- // struct LDKNetworkGraph NetGraphMsgHandler_get_network_graph(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_ptr);
- public static native long NetGraphMsgHandler_get_network_graph(long this_ptr);
- // void NetGraphMsgHandler_set_network_graph(struct LDKNetGraphMsgHandler *NONNULL_PTR this_ptr, struct LDKNetworkGraph val);
- public static native void NetGraphMsgHandler_set_network_graph(long this_ptr, long val);
- // MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_new(struct LDKNetworkGraph network_graph, struct LDKCOption_AccessZ chain_access, struct LDKLogger logger);
+ // MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKCOption_AccessZ chain_access, struct LDKLogger logger);
public static native long NetGraphMsgHandler_new(long network_graph, long chain_access, long logger);
// void NetGraphMsgHandler_add_chain_access(struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg, struct LDKCOption_AccessZ chain_access);
public static native void NetGraphMsgHandler_add_chain_access(long this_arg, long chain_access);
public static native long[][] Route_get_paths(long this_ptr);
// void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_CVec_RouteHopZZ val);
public static native void Route_set_paths(long this_ptr, long[][] val);
- // MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_CVec_RouteHopZZ paths_arg);
- public static native long Route_new(long[][] paths_arg);
+ // struct LDKPayee Route_get_payee(const struct LDKRoute *NONNULL_PTR this_ptr);
+ public static native long Route_get_payee(long this_ptr);
+ // void Route_set_payee(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKPayee val);
+ public static native void Route_set_payee(long this_ptr, long val);
+ // MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_CVec_RouteHopZZ paths_arg, struct LDKPayee payee_arg);
+ public static native long Route_new(long[][] paths_arg, long payee_arg);
// struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig);
public static native long Route_clone(long orig);
// uint64_t Route_hash(const struct LDKRoute *NONNULL_PTR o);
public static native byte[] Route_write(long obj);
// struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser);
public static native long Route_read(byte[] ser);
+ // void RouteParameters_free(struct LDKRouteParameters this_obj);
+ public static native void RouteParameters_free(long this_obj);
+ // struct LDKPayee RouteParameters_get_payee(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
+ public static native long RouteParameters_get_payee(long this_ptr);
+ // void RouteParameters_set_payee(struct LDKRouteParameters *NONNULL_PTR this_ptr, struct LDKPayee val);
+ public static native void RouteParameters_set_payee(long this_ptr, long val);
+ // uint64_t RouteParameters_get_final_value_msat(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
+ public static native long RouteParameters_get_final_value_msat(long this_ptr);
+ // void RouteParameters_set_final_value_msat(struct LDKRouteParameters *NONNULL_PTR this_ptr, uint64_t val);
+ public static native void RouteParameters_set_final_value_msat(long this_ptr, long val);
+ // uint32_t RouteParameters_get_final_cltv_expiry_delta(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
+ public static native int RouteParameters_get_final_cltv_expiry_delta(long this_ptr);
+ // void RouteParameters_set_final_cltv_expiry_delta(struct LDKRouteParameters *NONNULL_PTR this_ptr, uint32_t val);
+ public static native void RouteParameters_set_final_cltv_expiry_delta(long this_ptr, int val);
+ // MUST_USE_RES struct LDKRouteParameters RouteParameters_new(struct LDKPayee payee_arg, uint64_t final_value_msat_arg, uint32_t final_cltv_expiry_delta_arg);
+ public static native long RouteParameters_new(long payee_arg, long final_value_msat_arg, int final_cltv_expiry_delta_arg);
+ // struct LDKRouteParameters RouteParameters_clone(const struct LDKRouteParameters *NONNULL_PTR orig);
+ public static native long RouteParameters_clone(long orig);
+ // struct LDKCVec_u8Z RouteParameters_write(const struct LDKRouteParameters *NONNULL_PTR obj);
+ public static native byte[] RouteParameters_write(long obj);
+ // struct LDKCResult_RouteParametersDecodeErrorZ RouteParameters_read(struct LDKu8slice ser);
+ public static native long RouteParameters_read(byte[] ser);
+ // void Payee_free(struct LDKPayee this_obj);
+ public static native void Payee_free(long this_obj);
+ // struct LDKPublicKey Payee_get_pubkey(const struct LDKPayee *NONNULL_PTR this_ptr);
+ public static native byte[] Payee_get_pubkey(long this_ptr);
+ // void Payee_set_pubkey(struct LDKPayee *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+ public static native void Payee_set_pubkey(long this_ptr, byte[] val);
+ // struct LDKInvoiceFeatures Payee_get_features(const struct LDKPayee *NONNULL_PTR this_ptr);
+ public static native long Payee_get_features(long this_ptr);
+ // void Payee_set_features(struct LDKPayee *NONNULL_PTR this_ptr, struct LDKInvoiceFeatures val);
+ public static native void Payee_set_features(long this_ptr, long val);
+ // struct LDKCVec_RouteHintZ Payee_get_route_hints(const struct LDKPayee *NONNULL_PTR this_ptr);
+ public static native long[] Payee_get_route_hints(long this_ptr);
+ // void Payee_set_route_hints(struct LDKPayee *NONNULL_PTR this_ptr, struct LDKCVec_RouteHintZ val);
+ public static native void Payee_set_route_hints(long this_ptr, long[] val);
+ // struct LDKCOption_u64Z Payee_get_expiry_time(const struct LDKPayee *NONNULL_PTR this_ptr);
+ public static native long Payee_get_expiry_time(long this_ptr);
+ // void Payee_set_expiry_time(struct LDKPayee *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
+ public static native void Payee_set_expiry_time(long this_ptr, long val);
+ // MUST_USE_RES struct LDKPayee Payee_new(struct LDKPublicKey pubkey_arg, struct LDKInvoiceFeatures features_arg, struct LDKCVec_RouteHintZ route_hints_arg, struct LDKCOption_u64Z expiry_time_arg);
+ public static native long Payee_new(byte[] pubkey_arg, long features_arg, long[] route_hints_arg, long expiry_time_arg);
+ // struct LDKPayee Payee_clone(const struct LDKPayee *NONNULL_PTR orig);
+ public static native long Payee_clone(long orig);
+ // uint64_t Payee_hash(const struct LDKPayee *NONNULL_PTR o);
+ public static native long Payee_hash(long o);
+ // bool Payee_eq(const struct LDKPayee *NONNULL_PTR a, const struct LDKPayee *NONNULL_PTR b);
+ public static native boolean Payee_eq(long a, long b);
+ // struct LDKCVec_u8Z Payee_write(const struct LDKPayee *NONNULL_PTR obj);
+ public static native byte[] Payee_write(long obj);
+ // struct LDKCResult_PayeeDecodeErrorZ Payee_read(struct LDKu8slice ser);
+ public static native long Payee_read(byte[] ser);
+ // MUST_USE_RES struct LDKPayee Payee_from_node_id(struct LDKPublicKey pubkey);
+ public static native long Payee_from_node_id(byte[] pubkey);
+ // MUST_USE_RES struct LDKPayee Payee_for_keysend(struct LDKPublicKey pubkey);
+ public static native long Payee_for_keysend(byte[] pubkey);
// void RouteHint_free(struct LDKRouteHint this_obj);
public static native void RouteHint_free(long this_obj);
+ // struct LDKCVec_RouteHintHopZ RouteHint_get_a(const struct LDKRouteHint *NONNULL_PTR this_ptr);
+ public static native long[] RouteHint_get_a(long this_ptr);
+ // void RouteHint_set_a(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKCVec_RouteHintHopZ val);
+ public static native void RouteHint_set_a(long this_ptr, long[] val);
+ // MUST_USE_RES struct LDKRouteHint RouteHint_new(struct LDKCVec_RouteHintHopZ a_arg);
+ public static native long RouteHint_new(long[] a_arg);
// struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
public static native long RouteHint_clone(long orig);
// uint64_t RouteHint_hash(const struct LDKRouteHint *NONNULL_PTR o);
public static native long RouteHint_hash(long o);
// bool RouteHint_eq(const struct LDKRouteHint *NONNULL_PTR a, const struct LDKRouteHint *NONNULL_PTR b);
public static native boolean RouteHint_eq(long a, long b);
+ // struct LDKCVec_u8Z RouteHint_write(const struct LDKRouteHint *NONNULL_PTR obj);
+ public static native byte[] RouteHint_write(long obj);
+ // struct LDKCResult_RouteHintDecodeErrorZ RouteHint_read(struct LDKu8slice ser);
+ public static native long RouteHint_read(byte[] ser);
// void RouteHintHop_free(struct LDKRouteHintHop this_obj);
public static native void RouteHintHop_free(long this_obj);
// struct LDKPublicKey RouteHintHop_get_src_node_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
public static native long RouteHintHop_hash(long o);
// bool RouteHintHop_eq(const struct LDKRouteHintHop *NONNULL_PTR a, const struct LDKRouteHintHop *NONNULL_PTR b);
public static native boolean RouteHintHop_eq(long a, long b);
- // struct LDKCResult_RouteLightningErrorZ get_keysend_route(struct LDKPublicKey our_node_pubkey, const struct LDKNetworkGraph *NONNULL_PTR network, struct LDKPublicKey payee, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKCVec_RouteHintZ last_hops, uint64_t final_value_msat, uint32_t final_cltv, struct LDKLogger logger, const struct LDKScore *NONNULL_PTR scorer);
- public static native long get_keysend_route(byte[] our_node_pubkey, long network, byte[] payee, long[] first_hops, long[] last_hops, long final_value_msat, int final_cltv, long logger, long scorer);
- // struct LDKCResult_RouteLightningErrorZ get_route(struct LDKPublicKey our_node_pubkey, const struct LDKNetworkGraph *NONNULL_PTR network, struct LDKPublicKey payee, struct LDKInvoiceFeatures payee_features, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKCVec_RouteHintZ last_hops, uint64_t final_value_msat, uint32_t final_cltv, struct LDKLogger logger, const struct LDKScore *NONNULL_PTR scorer);
- public static native long get_route(byte[] our_node_pubkey, long network, byte[] payee, long payee_features, long[] first_hops, long[] last_hops, long final_value_msat, int final_cltv, long logger, long scorer);
+ // struct LDKCVec_u8Z RouteHintHop_write(const struct LDKRouteHintHop *NONNULL_PTR obj);
+ public static native byte[] RouteHintHop_write(long obj);
+ // struct LDKCResult_RouteHintHopDecodeErrorZ RouteHintHop_read(struct LDKu8slice ser);
+ 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 Scorer_free(struct LDKScorer this_obj);
public static native void Scorer_free(long this_obj);
- // MUST_USE_RES struct LDKScorer Scorer_new(uint64_t base_penalty_msat);
- public static native long Scorer_new(long base_penalty_msat);
+ // void ScoringParameters_free(struct LDKScoringParameters this_obj);
+ public static native void ScoringParameters_free(long this_obj);
+ // uint64_t ScoringParameters_get_base_penalty_msat(const struct LDKScoringParameters *NONNULL_PTR this_ptr);
+ public static native long ScoringParameters_get_base_penalty_msat(long this_ptr);
+ // void ScoringParameters_set_base_penalty_msat(struct LDKScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
+ public static native void ScoringParameters_set_base_penalty_msat(long this_ptr, long val);
+ // uint64_t ScoringParameters_get_failure_penalty_msat(const struct LDKScoringParameters *NONNULL_PTR this_ptr);
+ 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);
+ // 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);
+ // 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 long ScoringParameters_read(byte[] ser);
+ // MUST_USE_RES struct LDKScorer Scorer_new(struct LDKScoringParameters params);
+ public static native long Scorer_new(long params);
// MUST_USE_RES struct LDKScorer Scorer_default(void);
public static native long Scorer_default();
+ // MUST_USE_RES struct LDKScoringParameters ScoringParameters_default(void);
+ public static native long ScoringParameters_default();
// struct LDKScore Scorer_as_Score(const struct LDKScorer *NONNULL_PTR this_arg);
public static native long Scorer_as_Score(long this_arg);
+ // struct LDKCVec_u8Z Scorer_write(const struct LDKScorer *NONNULL_PTR obj);
+ public static native byte[] Scorer_write(long obj);
+ // struct LDKCResult_ScorerDecodeErrorZ Scorer_read(struct LDKu8slice ser);
+ public static native long Scorer_read(byte[] ser);
// void FilesystemPersister_free(struct LDKFilesystemPersister this_obj);
public static native void FilesystemPersister_free(long this_obj);
// MUST_USE_RES struct LDKFilesystemPersister FilesystemPersister_new(struct LDKStr path_to_channel_data);
public static native boolean Description_eq(long a, long b);
// void PayeePubKey_free(struct LDKPayeePubKey this_obj);
public static native void PayeePubKey_free(long this_obj);
+ // struct LDKPublicKey PayeePubKey_get_a(const struct LDKPayeePubKey *NONNULL_PTR this_ptr);
+ public static native byte[] PayeePubKey_get_a(long this_ptr);
+ // void PayeePubKey_set_a(struct LDKPayeePubKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+ public static native void PayeePubKey_set_a(long this_ptr, byte[] val);
+ // MUST_USE_RES struct LDKPayeePubKey PayeePubKey_new(struct LDKPublicKey a_arg);
+ public static native long PayeePubKey_new(byte[] a_arg);
// struct LDKPayeePubKey PayeePubKey_clone(const struct LDKPayeePubKey *NONNULL_PTR orig);
public static native long PayeePubKey_clone(long orig);
// uint64_t PayeePubKey_hash(const struct LDKPayeePubKey *NONNULL_PTR o);
public static native boolean ExpiryTime_eq(long a, long b);
// void MinFinalCltvExpiry_free(struct LDKMinFinalCltvExpiry this_obj);
public static native void MinFinalCltvExpiry_free(long this_obj);
+ // uint64_t MinFinalCltvExpiry_get_a(const struct LDKMinFinalCltvExpiry *NONNULL_PTR this_ptr);
+ public static native long MinFinalCltvExpiry_get_a(long this_ptr);
+ // void MinFinalCltvExpiry_set_a(struct LDKMinFinalCltvExpiry *NONNULL_PTR this_ptr, uint64_t val);
+ public static native void MinFinalCltvExpiry_set_a(long this_ptr, long val);
+ // MUST_USE_RES struct LDKMinFinalCltvExpiry MinFinalCltvExpiry_new(uint64_t a_arg);
+ public static native long MinFinalCltvExpiry_new(long a_arg);
// struct LDKMinFinalCltvExpiry MinFinalCltvExpiry_clone(const struct LDKMinFinalCltvExpiry *NONNULL_PTR orig);
public static native long MinFinalCltvExpiry_clone(long orig);
// uint64_t MinFinalCltvExpiry_hash(const struct LDKMinFinalCltvExpiry *NONNULL_PTR o);
public static native byte[] Invoice_payment_hash(long this_arg);
// MUST_USE_RES struct LDKPublicKey Invoice_payee_pub_key(const struct LDKInvoice *NONNULL_PTR this_arg);
public static native byte[] Invoice_payee_pub_key(long this_arg);
- // MUST_USE_RES struct LDKThirtyTwoBytes Invoice_payment_secret(const struct LDKInvoice *NONNULL_PTR this_arg);
+ // MUST_USE_RES const uint8_t (*Invoice_payment_secret(const struct LDKInvoice *NONNULL_PTR this_arg))[32];
public static native byte[] Invoice_payment_secret(long this_arg);
// MUST_USE_RES struct LDKInvoiceFeatures Invoice_features(const struct LDKInvoice *NONNULL_PTR this_arg);
public static native long Invoice_features(long this_arg);
public static native byte[] Invoice_recover_payee_pub_key(long this_arg);
// MUST_USE_RES uint64_t Invoice_expiry_time(const struct LDKInvoice *NONNULL_PTR this_arg);
public static native long Invoice_expiry_time(long this_arg);
+ // MUST_USE_RES bool Invoice_is_expired(const struct LDKInvoice *NONNULL_PTR this_arg);
+ public static native boolean Invoice_is_expired(long this_arg);
// MUST_USE_RES uint64_t Invoice_min_final_cltv_expiry(const struct LDKInvoice *NONNULL_PTR this_arg);
public static native long Invoice_min_final_cltv_expiry(long this_arg);
// MUST_USE_RES struct LDKCVec_PrivateRouteZ Invoice_private_routes(const struct LDKInvoice *NONNULL_PTR this_arg);
public static native long[] Invoice_route_hints(long this_arg);
// MUST_USE_RES enum LDKCurrency Invoice_currency(const struct LDKInvoice *NONNULL_PTR this_arg);
public static native Currency Invoice_currency(long this_arg);
- // MUST_USE_RES struct LDKCOption_u64Z Invoice_amount_pico_btc(const struct LDKInvoice *NONNULL_PTR this_arg);
- public static native long Invoice_amount_pico_btc(long this_arg);
+ // MUST_USE_RES struct LDKCOption_u64Z Invoice_amount_milli_satoshis(const struct LDKInvoice *NONNULL_PTR this_arg);
+ public static native long Invoice_amount_milli_satoshis(long this_arg);
// MUST_USE_RES struct LDKCResult_DescriptionCreationErrorZ Description_new(struct LDKStr description);
public static native long Description_new(String description);
// MUST_USE_RES struct LDKStr Description_into_inner(struct LDKDescription this_arg);
public static native boolean SignOrCreationError_eq(long a, long b);
// struct LDKStr SignOrCreationError_to_str(const struct LDKSignOrCreationError *NONNULL_PTR o);
public static native String SignOrCreationError_to_str(long o);
+ // void InvoicePayer_free(struct LDKInvoicePayer this_obj);
+ public static native void InvoicePayer_free(long this_obj);
+ // void Payer_free(struct LDKPayer this_ptr);
+ public static native void Payer_free(long this_ptr);
+ // void Router_free(struct LDKRouter this_ptr);
+ public static native void Router_free(long this_ptr);
+ // void RetryAttempts_free(struct LDKRetryAttempts this_obj);
+ public static native void RetryAttempts_free(long this_obj);
+ // uintptr_t RetryAttempts_get_a(const struct LDKRetryAttempts *NONNULL_PTR this_ptr);
+ public static native long RetryAttempts_get_a(long this_ptr);
+ // void RetryAttempts_set_a(struct LDKRetryAttempts *NONNULL_PTR this_ptr, uintptr_t val);
+ public static native void RetryAttempts_set_a(long this_ptr, long val);
+ // MUST_USE_RES struct LDKRetryAttempts RetryAttempts_new(uintptr_t a_arg);
+ public static native long RetryAttempts_new(long a_arg);
+ // struct LDKRetryAttempts RetryAttempts_clone(const struct LDKRetryAttempts *NONNULL_PTR orig);
+ public static native long RetryAttempts_clone(long orig);
+ // bool RetryAttempts_eq(const struct LDKRetryAttempts *NONNULL_PTR a, const struct LDKRetryAttempts *NONNULL_PTR b);
+ public static native boolean RetryAttempts_eq(long a, long b);
+ // uint64_t RetryAttempts_hash(const struct LDKRetryAttempts *NONNULL_PTR o);
+ public static native long RetryAttempts_hash(long o);
+ // void PaymentError_free(struct LDKPaymentError this_ptr);
+ public static native void PaymentError_free(long this_ptr);
+ // struct LDKPaymentError PaymentError_clone(const struct LDKPaymentError *NONNULL_PTR orig);
+ public static native long PaymentError_clone(long orig);
+ // struct LDKPaymentError PaymentError_invoice(struct LDKStr a);
+ public static native long PaymentError_invoice(String a);
+ // struct LDKPaymentError PaymentError_routing(struct LDKLightningError a);
+ 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);
+ 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);
+ // 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);
+ public static native long InvoicePayer_as_EventHandler(long this_arg);
// struct LDKCResult_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKKeysInterface keys_manager, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKStr description);
public static native long create_invoice_from_channelmanager(long channelmanager, long keys_manager, Currency network, long amt_msat, String description);
+ // void DefaultRouter_free(struct LDKDefaultRouter this_obj);
+ public static native void DefaultRouter_free(long this_obj);
+ // MUST_USE_RES struct LDKDefaultRouter DefaultRouter_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger);
+ public static native long DefaultRouter_new(long network_graph, long logger);
+ // struct LDKRouter DefaultRouter_as_Router(const struct LDKDefaultRouter *NONNULL_PTR this_arg);
+ public static native long DefaultRouter_as_Router(long this_arg);
+ // struct LDKPayer ChannelManager_as_Payer(const struct LDKChannelManager *NONNULL_PTR this_arg);
+ public static native long ChannelManager_as_Payer(long this_arg);
// struct LDKCResult_SiPrefixNoneZ SiPrefix_from_str(struct LDKStr s);
public static native long SiPrefix_from_str(String s);
// struct LDKCResult_InvoiceNoneZ Invoice_from_str(struct LDKStr s);
private IncompatibleShutdownScript(long ptr, bindings.LDKAPIError.IncompatibleShutdownScript obj) {
super(null, ptr);
long script = obj.script;
- ShutdownScript script_hu_conv = new ShutdownScript(null, script);
+ ShutdownScript script_hu_conv = null; if (script < 0 || script > 4096) { script_hu_conv = new ShutdownScript(null, script); }
script_hu_conv.ptrs_to.add(this);
this.script = script_hu_conv;
}
*/
public APIError clone() {
long ret = bindings.APIError_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
APIError ret_hu_conv = APIError.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
public static APIError apimisuse_error(java.lang.String err) {
long ret = bindings.APIError_apimisuse_error(err);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public static APIError route_error(java.lang.String err) {
long ret = bindings.APIError_route_error(err);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public static APIError channel_unavailable(java.lang.String err) {
long ret = bindings.APIError_channel_unavailable(err);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public static APIError monitor_update_failed() {
long ret = bindings.APIError_monitor_update_failed();
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public static APIError incompatible_shutdown_script(ShutdownScript script) {
long ret = bindings.APIError_incompatible_shutdown_script(script == null ? 0 : script.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public AcceptChannel clone() {
long ret = bindings.AcceptChannel_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- AcceptChannel ret_hu_conv = new AcceptChannel(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_AcceptChannelDecodeErrorZ read(byte[] ser) {
long ret = bindings.AcceptChannel_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_AcceptChannelDecodeErrorZ ret_hu_conv = Result_AcceptChannelDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_TxOutAccessErrorZ get_utxo(byte[] genesis_hash, long short_channel_id) {
long ret = bindings.Access_get_utxo(this.ptr, genesis_hash, short_channel_id);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_TxOutAccessErrorZ ret_hu_conv = Result_TxOutAccessErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
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(channel_id_arg, short_channel_id_arg, node_signature_arg, bitcoin_signature_arg);
- if (ret >= 0 && ret < 1024) { return null; }
- AnnouncementSignatures ret_hu_conv = new AnnouncementSignatures(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public AnnouncementSignatures clone() {
long ret = bindings.AnnouncementSignatures_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- AnnouncementSignatures ret_hu_conv = new AnnouncementSignatures(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_AnnouncementSignaturesDecodeErrorZ read(byte[] ser) {
long ret = bindings.AnnouncementSignatures_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_AnnouncementSignaturesDecodeErrorZ ret_hu_conv = Result_AnnouncementSignaturesDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*
* Note that net_graph_msg_handler (or a relevant inner pointer) may be NULL or all-0s to represent None
*/
- public static BackgroundProcessor start(ChannelManagerPersister persister, EventHandler event_handler, ChainMonitor chain_monitor, ChannelManager channel_manager, NetGraphMsgHandler net_graph_msg_handler, PeerManager peer_manager, Logger logger) {
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
- BackgroundProcessor ret_hu_conv = new BackgroundProcessor(null, ret);
+ 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);
ret_hu_conv.ptrs_to.add(persister);
ret_hu_conv.ptrs_to.add(event_handler);
*/
public Result_NoneErrorZ join() {
long ret = bindings.BackgroundProcessor_join(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneErrorZ ret_hu_conv = Result_NoneErrorZ.constr_from_ptr(ret);
this.ptrs_to.add(this);
// Due to rust's strict-ownership memory model, in some cases we need to "move"
*/
public Result_NoneErrorZ stop() {
long ret = bindings.BackgroundProcessor_stop(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneErrorZ ret_hu_conv = Result_NoneErrorZ.constr_from_ptr(ret);
this.ptrs_to.add(this);
// Due to rust's strict-ownership memory model, in some cases we need to "move"
*/
public Balance clone() {
long ret = bindings.Balance_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Balance ret_hu_conv = Balance.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
public static Balance claimable_on_channel_close(long claimable_amount_satoshis) {
long ret = bindings.Balance_claimable_on_channel_close(claimable_amount_satoshis);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
return ret;
}
@Override public long validate_holder_commitment(long holder_tx) {
- HolderCommitmentTransaction holder_tx_hu_conv = new HolderCommitmentTransaction(null, holder_tx);
+ HolderCommitmentTransaction holder_tx_hu_conv = null; if (holder_tx < 0 || holder_tx > 4096) { holder_tx_hu_conv = new HolderCommitmentTransaction(null, holder_tx); }
Result_NoneNoneZ ret = arg.validate_holder_commitment(holder_tx_hu_conv);
long result = ret != null ? ret.ptr : 0;
return result;
return ret;
}
@Override public long sign_counterparty_commitment(long commitment_tx) {
- CommitmentTransaction commitment_tx_hu_conv = new CommitmentTransaction(null, commitment_tx);
+ CommitmentTransaction commitment_tx_hu_conv = null; if (commitment_tx < 0 || commitment_tx > 4096) { commitment_tx_hu_conv = new CommitmentTransaction(null, commitment_tx); }
Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret = arg.sign_counterparty_commitment(commitment_tx_hu_conv);
long result = ret != null ? ret.ptr : 0;
return result;
return result;
}
@Override public long sign_holder_commitment_and_htlcs(long commitment_tx) {
- HolderCommitmentTransaction commitment_tx_hu_conv = new HolderCommitmentTransaction(null, commitment_tx);
+ HolderCommitmentTransaction commitment_tx_hu_conv = null; if (commitment_tx < 0 || commitment_tx > 4096) { commitment_tx_hu_conv = new HolderCommitmentTransaction(null, commitment_tx); }
Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret = arg.sign_holder_commitment_and_htlcs(commitment_tx_hu_conv);
long result = ret != null ? ret.ptr : 0;
return result;
return result;
}
@Override public long sign_justice_revoked_htlc(byte[] justice_tx, long input, long amount, byte[] per_commitment_key, long htlc) {
- HTLCOutputInCommitment htlc_hu_conv = new HTLCOutputInCommitment(null, htlc);
+ HTLCOutputInCommitment htlc_hu_conv = null; if (htlc < 0 || htlc > 4096) { htlc_hu_conv = new HTLCOutputInCommitment(null, htlc); }
Result_SignatureNoneZ ret = arg.sign_justice_revoked_htlc(justice_tx, input, amount, per_commitment_key, htlc_hu_conv);
long result = ret != null ? ret.ptr : 0;
return result;
}
@Override public long sign_counterparty_htlc_transaction(byte[] htlc_tx, long input, long amount, byte[] per_commitment_point, long htlc) {
- HTLCOutputInCommitment htlc_hu_conv = new HTLCOutputInCommitment(null, htlc);
+ HTLCOutputInCommitment htlc_hu_conv = null; if (htlc < 0 || htlc > 4096) { htlc_hu_conv = new HTLCOutputInCommitment(null, htlc); }
Result_SignatureNoneZ ret = arg.sign_counterparty_htlc_transaction(htlc_tx, input, amount, per_commitment_point, htlc_hu_conv);
long result = ret != null ? ret.ptr : 0;
return result;
}
@Override public long sign_closing_transaction(long closing_tx) {
- ClosingTransaction closing_tx_hu_conv = new ClosingTransaction(null, closing_tx);
+ ClosingTransaction closing_tx_hu_conv = null; if (closing_tx < 0 || closing_tx > 4096) { closing_tx_hu_conv = new ClosingTransaction(null, closing_tx); }
Result_SignatureNoneZ ret = arg.sign_closing_transaction(closing_tx_hu_conv);
long result = ret != null ? ret.ptr : 0;
return result;
}
@Override public long sign_channel_announcement(long msg) {
- UnsignedChannelAnnouncement msg_hu_conv = new UnsignedChannelAnnouncement(null, msg);
+ UnsignedChannelAnnouncement msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new UnsignedChannelAnnouncement(null, msg); }
Result_SignatureNoneZ ret = arg.sign_channel_announcement(msg_hu_conv);
long result = ret != null ? ret.ptr : 0;
return result;
}
@Override public void ready_channel(long channel_parameters) {
- ChannelTransactionParameters channel_parameters_hu_conv = new ChannelTransactionParameters(null, channel_parameters);
+ ChannelTransactionParameters channel_parameters_hu_conv = null; if (channel_parameters < 0 || channel_parameters > 4096) { channel_parameters_hu_conv = new ChannelTransactionParameters(null, channel_parameters); }
arg.ready_channel(channel_parameters_hu_conv);
}
}, pubkeys);
*/
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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret);
this.ptrs_to.add(holder_tx);
return ret_hu_conv;
*/
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);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public Result_NoneNoneZ validate_counterparty_revocation(long idx, byte[] secret) {
long ret = bindings.BaseSign_validate_counterparty_revocation(this.ptr, idx, secret);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
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, per_commitment_key);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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, per_commitment_key, htlc == null ? 0 : htlc.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret);
this.ptrs_to.add(htlc);
return ret_hu_conv;
*/
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, per_commitment_point, htlc == null ? 0 : htlc.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret);
this.ptrs_to.add(htlc);
return ret_hu_conv;
*/
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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret);
this.ptrs_to.add(closing_tx);
return ret_hu_conv;
*/
public Result_SignatureNoneZ sign_channel_announcement(UnsignedChannelAnnouncement msg) {
long ret = bindings.BaseSign_sign_channel_announcement(this.ptr, msg == null ? 0 : msg.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret);
this.ptrs_to.add(msg);
return ret_hu_conv;
*/
public ChannelPublicKeys get_pubkeys() {
long ret = bindings.BaseSign_get_pubkeys(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public BestBlock clone() {
long ret = bindings.BestBlock_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- BestBlock ret_hu_conv = new BestBlock(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static BestBlock from_genesis(org.ldk.enums.Network network) {
long ret = bindings.BestBlock_from_genesis(network);
- if (ret >= 0 && ret < 1024) { return null; }
- BestBlock ret_hu_conv = new BestBlock(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static BestBlock of(byte[] block_hash, int height) {
long ret = bindings.BestBlock_new(block_hash, height);
- if (ret >= 0 && ret < 1024) { return null; }
- BestBlock ret_hu_conv = new BestBlock(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static BuiltCommitmentTransaction of(byte[] transaction_arg, byte[] txid_arg) {
long ret = bindings.BuiltCommitmentTransaction_new(transaction_arg, txid_arg);
- if (ret >= 0 && ret < 1024) { return null; }
- BuiltCommitmentTransaction ret_hu_conv = new BuiltCommitmentTransaction(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public BuiltCommitmentTransaction clone() {
long ret = bindings.BuiltCommitmentTransaction_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- BuiltCommitmentTransaction ret_hu_conv = new BuiltCommitmentTransaction(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_BuiltCommitmentTransactionDecodeErrorZ read(byte[] ser) {
long ret = bindings.BuiltCommitmentTransaction_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_BuiltCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_BuiltCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
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);
- if (ret >= 0 && ret < 1024) { return null; }
- ChainMonitor ret_hu_conv = new ChainMonitor(null, ret);
+ 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);
ret_hu_conv.ptrs_to.add(broadcaster);
ret_hu_conv.ptrs_to.add(logger);
*/
public Result_LockedChannelMonitorNoneZ get_monitor(OutPoint funding_txo) {
long ret = bindings.ChainMonitor_get_monitor(this.ptr, funding_txo == null ? 0 : funding_txo.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_LockedChannelMonitorNoneZ ret_hu_conv = Result_LockedChannelMonitorNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
}
OutPoint[] ret_conv_10_arr = new OutPoint[ret.length];
for (int k = 0; k < ret.length; k++) {
long ret_conv_10 = ret[k];
- OutPoint ret_conv_10_hu_conv = new OutPoint(null, ret_conv_10);
+ OutPoint ret_conv_10_hu_conv = null; if (ret_conv_10 < 0 || ret_conv_10 > 4096) { ret_conv_10_hu_conv = new OutPoint(null, ret_conv_10); }
ret_conv_10_hu_conv.ptrs_to.add(this);
ret_conv_10_arr[k] = ret_conv_10_hu_conv;
}
return ret_conv_10_arr;
}
+ /**
+ * Indicates the persistence of a [`ChannelMonitor`] has completed after
+ * [`ChannelMonitorUpdateErr::TemporaryFailure`] was returned from an update operation.
+ *
+ * Thus, the anticipated use is, at a high level:
+ * 1) This [`ChainMonitor`] calls [`Persist::update_persisted_channel`] which stores the
+ * update to disk and begins updating any remote (e.g. watchtower/backup) copies,
+ * returning [`ChannelMonitorUpdateErr::TemporaryFailure`],
+ * 2) once all remote copies are updated, you call this function with the
+ * `completed_update_id` that completed, and once all pending updates have completed the
+ * channel will be re-enabled.
+ *
+ * Returns an [`APIError::APIMisuseError`] if `funding_txo` does not match any currently
+ * registered [`ChannelMonitor`]s.
+ */
+ 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);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
/**
* Constructs a new Listen which calls the relevant methods on this_arg.
* This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
*/
public Listen as_Listen() {
long ret = bindings.ChainMonitor_as_Listen(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Listen ret_hu_conv = new Listen(null, ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
public Confirm as_Confirm() {
long ret = bindings.ChainMonitor_as_Confirm(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Confirm ret_hu_conv = new Confirm(null, ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
public Watch as_Watch() {
long ret = bindings.ChainMonitor_as_Watch(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Watch ret_hu_conv = new Watch(null, ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
public EventsProvider as_EventsProvider() {
long ret = bindings.ChainMonitor_as_EventsProvider(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
EventsProvider ret_hu_conv = new EventsProvider(null, ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
public BestBlock get_best_block() {
long ret = bindings.ChainParameters_get_best_block(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- BestBlock ret_hu_conv = new BestBlock(null, ret);
+ 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);
return ret_hu_conv;
}
*/
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);
- if (ret >= 0 && ret < 1024) { return null; }
- ChainParameters ret_hu_conv = new ChainParameters(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public ChainParameters clone() {
long ret = bindings.ChainParameters_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- ChainParameters ret_hu_conv = new ChainParameters(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public UnsignedChannelAnnouncement get_contents() {
long ret = bindings.ChannelAnnouncement_get_contents(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- UnsignedChannelAnnouncement ret_hu_conv = new UnsignedChannelAnnouncement(null, ret);
+ 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);
return ret_hu_conv;
}
*/
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(node_signature_1_arg, node_signature_2_arg, bitcoin_signature_1_arg, bitcoin_signature_2_arg, contents_arg == null ? 0 : contents_arg.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
- ChannelAnnouncement ret_hu_conv = new ChannelAnnouncement(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public ChannelAnnouncement clone() {
long ret = bindings.ChannelAnnouncement_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- ChannelAnnouncement ret_hu_conv = new ChannelAnnouncement(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_ChannelAnnouncementDecodeErrorZ read(byte[] ser) {
long ret = bindings.ChannelAnnouncement_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_ChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
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);
- if (ret >= 0 && ret < 1024) { return null; }
- ChannelConfig ret_hu_conv = new ChannelConfig(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public ChannelConfig clone() {
long ret = bindings.ChannelConfig_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- ChannelConfig ret_hu_conv = new ChannelConfig(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static ChannelConfig with_default() {
long ret = bindings.ChannelConfig_default();
- if (ret >= 0 && ret < 1024) { return null; }
- ChannelConfig ret_hu_conv = new ChannelConfig(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_ChannelConfigDecodeErrorZ read(byte[] ser) {
long ret = bindings.ChannelConfig_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelConfigDecodeErrorZ ret_hu_conv = Result_ChannelConfigDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public InitFeatures get_features() {
long ret = bindings.ChannelCounterparty_get_features(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- InitFeatures ret_hu_conv = new InitFeatures(null, ret);
+ 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);
return ret_hu_conv;
}
@Nullable
public CounterpartyForwardingInfo get_forwarding_info() {
long ret = bindings.ChannelCounterparty_get_forwarding_info(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- CounterpartyForwardingInfo ret_hu_conv = new CounterpartyForwardingInfo(null, ret);
+ 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);
return ret_hu_conv;
}
*/
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(node_id_arg, features_arg == null ? 0 : features_arg.ptr & ~1, unspendable_punishment_reserve_arg, forwarding_info_arg == null ? 0 : forwarding_info_arg.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
- ChannelCounterparty ret_hu_conv = new ChannelCounterparty(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public ChannelCounterparty clone() {
long ret = bindings.ChannelCounterparty_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- ChannelCounterparty ret_hu_conv = new ChannelCounterparty(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public ChannelCounterparty get_counterparty() {
long ret = bindings.ChannelDetails_get_counterparty(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- ChannelCounterparty ret_hu_conv = new ChannelCounterparty(null, ret);
+ 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);
return ret_hu_conv;
}
@Nullable
public OutPoint get_funding_txo() {
long ret = bindings.ChannelDetails_get_funding_txo(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- OutPoint ret_hu_conv = new OutPoint(null, ret);
+ 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;
}
*/
public Option_u64Z get_short_channel_id() {
long ret = bindings.ChannelDetails_get_short_channel_id(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public Option_u64Z get_unspendable_punishment_reserve() {
long ret = bindings.ChannelDetails_get_unspendable_punishment_reserve(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public Option_u32Z get_confirmations_required() {
long ret = bindings.ChannelDetails_get_confirmations_required(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public Option_u16Z get_force_close_spend_delay() {
long ret = bindings.ChannelDetails_get_force_close_spend_delay(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
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(channel_id_arg, 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);
- if (ret >= 0 && ret < 1024) { return null; }
- ChannelDetails ret_hu_conv = new ChannelDetails(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public ChannelDetails clone() {
long ret = bindings.ChannelDetails_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- ChannelDetails ret_hu_conv = new ChannelDetails(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public ChannelFeatures clone() {
long ret = bindings.ChannelFeatures_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- ChannelFeatures ret_hu_conv = new ChannelFeatures(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static ChannelFeatures empty() {
long ret = bindings.ChannelFeatures_empty();
- if (ret >= 0 && ret < 1024) { return null; }
- ChannelFeatures ret_hu_conv = new ChannelFeatures(null, ret);
+ 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(ret_hu_conv);
return ret_hu_conv;
}
*/
public static ChannelFeatures known() {
long ret = bindings.ChannelFeatures_known();
- if (ret >= 0 && ret < 1024) { return null; }
- ChannelFeatures ret_hu_conv = new ChannelFeatures(null, ret);
+ 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(ret_hu_conv);
return ret_hu_conv;
}
*/
public static Result_ChannelFeaturesDecodeErrorZ read(byte[] ser) {
long ret = bindings.ChannelFeatures_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelFeaturesDecodeErrorZ ret_hu_conv = Result_ChannelFeaturesDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
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);
- if (ret >= 0 && ret < 1024) { return null; }
- ChannelHandshakeConfig ret_hu_conv = new ChannelHandshakeConfig(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public ChannelHandshakeConfig clone() {
long ret = bindings.ChannelHandshakeConfig_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- ChannelHandshakeConfig ret_hu_conv = new ChannelHandshakeConfig(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static ChannelHandshakeConfig with_default() {
long ret = bindings.ChannelHandshakeConfig_default();
- if (ret >= 0 && ret < 1024) { return null; }
- ChannelHandshakeConfig ret_hu_conv = new ChannelHandshakeConfig(null, ret);
+ 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);
return ret_hu_conv;
}
*/
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);
- if (ret >= 0 && ret < 1024) { return null; }
- ChannelHandshakeLimits ret_hu_conv = new ChannelHandshakeLimits(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public ChannelHandshakeLimits clone() {
long ret = bindings.ChannelHandshakeLimits_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- ChannelHandshakeLimits ret_hu_conv = new ChannelHandshakeLimits(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static ChannelHandshakeLimits with_default() {
long ret = bindings.ChannelHandshakeLimits_default();
- if (ret >= 0 && ret < 1024) { return null; }
- ChannelHandshakeLimits ret_hu_conv = new ChannelHandshakeLimits(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public ChannelFeatures get_features() {
long ret = bindings.ChannelInfo_get_features(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- ChannelFeatures ret_hu_conv = new ChannelFeatures(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public NodeId get_node_one() {
long ret = bindings.ChannelInfo_get_node_one(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- NodeId ret_hu_conv = new NodeId(null, ret);
+ 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);
return ret_hu_conv;
}
@Nullable
public DirectionalChannelInfo get_one_to_two() {
long ret = bindings.ChannelInfo_get_one_to_two(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- DirectionalChannelInfo ret_hu_conv = new DirectionalChannelInfo(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public NodeId get_node_two() {
long ret = bindings.ChannelInfo_get_node_two(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- NodeId ret_hu_conv = new NodeId(null, ret);
+ 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);
return ret_hu_conv;
}
@Nullable
public DirectionalChannelInfo get_two_to_one() {
long ret = bindings.ChannelInfo_get_two_to_one(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- DirectionalChannelInfo ret_hu_conv = new DirectionalChannelInfo(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public Option_u64Z get_capacity_sats() {
long ret = bindings.ChannelInfo_get_capacity_sats(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
@Nullable
public ChannelAnnouncement get_announcement_message() {
long ret = bindings.ChannelInfo_get_announcement_message(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- ChannelAnnouncement ret_hu_conv = new ChannelAnnouncement(null, ret);
+ 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);
return ret_hu_conv;
}
*/
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 < 1024) { return null; }
- ChannelInfo ret_hu_conv = new ChannelInfo(null, ret);
+ 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;
}
*/
public ChannelInfo clone() {
long ret = bindings.ChannelInfo_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- ChannelInfo ret_hu_conv = new ChannelInfo(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_ChannelInfoDecodeErrorZ read(byte[] ser) {
long ret = bindings.ChannelInfo_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelInfoDecodeErrorZ ret_hu_conv = Result_ChannelInfoDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
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);
- if (ret >= 0 && ret < 1024) { return null; }
- ChannelManager ret_hu_conv = new ChannelManager(null, ret);
+ 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);
ret_hu_conv.ptrs_to.add(fee_est);
ret_hu_conv.ptrs_to.add(chain_monitor);
*/
public UserConfig get_current_default_configuration() {
long ret = bindings.ChannelManager_get_current_default_configuration(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- UserConfig ret_hu_conv = new UserConfig(null, ret);
+ 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);
return ret_hu_conv;
}
*/
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, their_network_key, channel_value_satoshis, push_msat, user_channel_id, override_config == null ? 0 : override_config.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result__u832APIErrorZ ret_hu_conv = Result__u832APIErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
ChannelDetails[] ret_conv_16_arr = new ChannelDetails[ret.length];
for (int q = 0; q < ret.length; q++) {
long ret_conv_16 = ret[q];
- ChannelDetails ret_conv_16_hu_conv = new ChannelDetails(null, ret_conv_16);
+ ChannelDetails ret_conv_16_hu_conv = null; if (ret_conv_16 < 0 || ret_conv_16 > 4096) { ret_conv_16_hu_conv = new ChannelDetails(null, ret_conv_16); }
ret_conv_16_hu_conv.ptrs_to.add(this);
ret_conv_16_arr[q] = ret_conv_16_hu_conv;
}
ChannelDetails[] ret_conv_16_arr = new ChannelDetails[ret.length];
for (int q = 0; q < ret.length; q++) {
long ret_conv_16 = ret[q];
- ChannelDetails ret_conv_16_hu_conv = new ChannelDetails(null, ret_conv_16);
+ ChannelDetails ret_conv_16_hu_conv = null; if (ret_conv_16 < 0 || ret_conv_16 > 4096) { ret_conv_16_hu_conv = new ChannelDetails(null, ret_conv_16); }
ret_conv_16_hu_conv.ptrs_to.add(this);
ret_conv_16_arr[q] = ret_conv_16_hu_conv;
}
*/
public Result_NoneAPIErrorZ close_channel(byte[] channel_id) {
long ret = bindings.ChannelManager_close_channel(this.ptr, channel_id);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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, channel_id, target_feerate_sats_per_1000_weight);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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, channel_id);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
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, payment_hash, payment_secret);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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;
*
* [`send_payment`]: [`ChannelManager::send_payment`]
*/
- public Result_NonePaymentSendFailureZ retry_payment(Route route, PaymentId payment_id) {
- long ret = bindings.ChannelManager_retry_payment(this.ptr, route == null ? 0 : route.ptr & ~1, payment_id == null ? 0 : payment_id.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ public Result_NonePaymentSendFailureZ retry_payment(Route route, byte[] payment_id) {
+ long ret = bindings.ChannelManager_retry_payment(this.ptr, route == null ? 0 : route.ptr & ~1, 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;
*/
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, payment_preimage);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public Result_NoneAPIErrorZ funding_transaction_generated(byte[] temporary_channel_id, byte[] funding_transaction) {
long ret = bindings.ChannelManager_funding_transaction_generated(this.ptr, temporary_channel_id, funding_transaction);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
return ret;
}
- /**
- * Restores a single, given channel to normal operation after a
- * ChannelMonitorUpdateErr::TemporaryFailure was returned from a channel monitor update
- * operation.
- *
- * All ChannelMonitor updates up to and including highest_applied_update_id must have been
- * fully committed in every copy of the given channels' ChannelMonitors.
- *
- * Note that there is no effect to calling with a highest_applied_update_id other than the
- * current latest ChannelMonitorUpdate and one call to this function after multiple
- * ChannelMonitorUpdateErr::TemporaryFailures is fine. The highest_applied_update_id field
- * exists largely only to prevent races between this and concurrent update_monitor calls.
- *
- * Thus, the anticipated use is, at a high level:
- * 1) You register a chain::Watch with this ChannelManager,
- * 2) it stores each update to disk, and begins updating any remote (eg watchtower) copies of
- * said ChannelMonitors as it can, returning ChannelMonitorUpdateErr::TemporaryFailures
- * any time it cannot do so instantly,
- * 3) update(s) are applied to each remote copy of a ChannelMonitor,
- * 4) once all remote copies are updated, you call this function with the update_id that
- * completed, and once it is the latest the Channel will be re-enabled.
- */
- public void channel_monitor_updated(OutPoint funding_txo, long highest_applied_update_id) {
- bindings.ChannelManager_channel_monitor_updated(this.ptr, funding_txo == null ? 0 : funding_txo.ptr & ~1, highest_applied_update_id);
- this.ptrs_to.add(funding_txo);
- }
-
/**
* Gets a payment secret and payment hash for use in an invoice given to a third party wishing
* to pay us.
*/
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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
TwoTuple_PaymentHashPaymentSecretZ ret_hu_conv = new TwoTuple_PaymentHashPaymentSecretZ(null, ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
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, payment_hash, min_value_msat.ptr, invoice_expiry_delta_secs, user_payment_id);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_PaymentSecretAPIErrorZ ret_hu_conv = Result_PaymentSecretAPIErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public MessageSendEventsProvider as_MessageSendEventsProvider() {
long ret = bindings.ChannelManager_as_MessageSendEventsProvider(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
MessageSendEventsProvider ret_hu_conv = new MessageSendEventsProvider(null, ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
public EventsProvider as_EventsProvider() {
long ret = bindings.ChannelManager_as_EventsProvider(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
EventsProvider ret_hu_conv = new EventsProvider(null, ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
public Listen as_Listen() {
long ret = bindings.ChannelManager_as_Listen(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Listen ret_hu_conv = new Listen(null, ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
public Confirm as_Confirm() {
long ret = bindings.ChannelManager_as_Confirm(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Confirm ret_hu_conv = new Confirm(null, ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
public BestBlock current_best_block() {
long ret = bindings.ChannelManager_current_best_block(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- BestBlock ret_hu_conv = new BestBlock(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public ChannelMessageHandler as_ChannelMessageHandler() {
long ret = bindings.ChannelManager_as_ChannelMessageHandler(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
ChannelMessageHandler ret_hu_conv = new ChannelMessageHandler(null, ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
return ret;
}
+ /**
+ * Constructs a new Payer which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned Payer must be freed before this_arg is
+ */
+ public Payer as_Payer() {
+ long ret = bindings.ChannelManager_as_Payer(this.ptr);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Payer ret_hu_conv = new Payer(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
}
final LDKChannelManagerPersisterHolder impl_holder = new LDKChannelManagerPersisterHolder();
impl_holder.held = new ChannelManagerPersister(new bindings.LDKChannelManagerPersister() {
@Override public long persist_manager(long channel_manager) {
- ChannelManager channel_manager_hu_conv = new ChannelManager(null, channel_manager);
+ ChannelManager channel_manager_hu_conv = null; if (channel_manager < 0 || channel_manager > 4096) { channel_manager_hu_conv = new ChannelManager(null, channel_manager); }
Result_NoneErrorZ ret = arg.persist_manager(channel_manager_hu_conv);
long result = ret != null ? ret.ptr : 0;
return result;
*/
public Result_NoneErrorZ persist_manager(ChannelManager channel_manager) {
long ret = bindings.ChannelManagerPersister_persist_manager(this.ptr, channel_manager == null ? 0 : channel_manager.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneErrorZ ret_hu_conv = Result_NoneErrorZ.constr_from_ptr(ret);
this.ptrs_to.add(channel_manager);
return ret_hu_conv;
*
* At a high-level, the process for deserializing a ChannelManager and resuming normal operation
* is:
- * 1) Deserialize all stored ChannelMonitors.
- * 2) Deserialize the ChannelManager by filling in this struct and calling:
- * <(BlockHash, ChannelManager)>::read(reader, args)
- * This may result in closing some Channels if the ChannelMonitor is newer than the stored
- * ChannelManager state to ensure no loss of funds. Thus, transactions may be broadcasted.
- * 3) If you are not fetching full blocks, register all relevant ChannelMonitor outpoints the same
- * way you would handle a `chain::Filter` call using ChannelMonitor::get_outputs_to_watch() and
- * ChannelMonitor::get_funding_txo().
- * 4) Reconnect blocks on your ChannelMonitors.
- * 5) Disconnect/connect blocks on the ChannelManager.
- * 6) Move the ChannelMonitors into your local chain::Watch.
+ * 1) Deserialize all stored [`ChannelMonitor`]s.
+ * 2) Deserialize the [`ChannelManager`] by filling in this struct and calling:
+ * `<(BlockHash, ChannelManager)>::read(reader, args)`
+ * This may result in closing some channels if the [`ChannelMonitor`] is newer than the stored
+ * [`ChannelManager`] state to ensure no loss of funds. Thus, transactions may be broadcasted.
+ * 3) If you are not fetching full blocks, register all relevant [`ChannelMonitor`] outpoints the
+ * same way you would handle a [`chain::Filter`] call using
+ * [`ChannelMonitor::get_outputs_to_watch`] and [`ChannelMonitor::get_funding_txo`].
+ * 4) Reconnect blocks on your [`ChannelMonitor`]s.
+ * 5) Disconnect/connect blocks on the [`ChannelManager`].
+ * 6) Re-persist the [`ChannelMonitor`]s to ensure the latest state is on disk.
+ * Note that if you're using a [`ChainMonitor`] for your [`chain::Watch`] implementation, you
+ * will likely accomplish this as a side-effect of calling [`chain::Watch::watch_channel`] in
+ * the next step.
+ * 7) Move the [`ChannelMonitor`]s into your local [`chain::Watch`]. If you're using a
+ * [`ChainMonitor`], this is done by calling [`chain::Watch::watch_channel`].
*
- * Note that the ordering of #4-6 is not of importance, however all three must occur before you
- * call any other methods on the newly-deserialized ChannelManager.
+ * Note that the ordering of #4-7 is not of importance, however all four must occur before you
+ * call any other methods on the newly-deserialized [`ChannelManager`].
*
* Note that because some channels may be closed during deserialization, it is critical that you
* always deserialize only the latest version of a ChannelManager and ChannelMonitors available to
* broadcast), and then later deserialize a newer version of the same ChannelManager (which will
* not force-close the same channels but consider them live), you may end up revoking a state for
* which you've already broadcasted the transaction.
+ *
+ * [`ChainMonitor`]: crate::chain::chainmonitor::ChainMonitor
*/
@SuppressWarnings("unchecked") // We correctly assign various generic arrays
public class ChannelManagerReadArgs extends CommonBase {
*/
public KeysInterface get_keys_manager() {
long ret = bindings.ChannelManagerReadArgs_get_keys_manager(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
KeysInterface ret_hu_conv = new KeysInterface(null, ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
public FeeEstimator get_fee_estimator() {
long ret = bindings.ChannelManagerReadArgs_get_fee_estimator(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
FeeEstimator ret_hu_conv = new FeeEstimator(null, ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
public Watch get_chain_monitor() {
long ret = bindings.ChannelManagerReadArgs_get_chain_monitor(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Watch ret_hu_conv = new Watch(null, ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
public BroadcasterInterface get_tx_broadcaster() {
long ret = bindings.ChannelManagerReadArgs_get_tx_broadcaster(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
BroadcasterInterface ret_hu_conv = new BroadcasterInterface(null, ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
public Logger get_logger() {
long ret = bindings.ChannelManagerReadArgs_get_logger(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Logger ret_hu_conv = new Logger(null, ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
public UserConfig get_default_config() {
long ret = bindings.ChannelManagerReadArgs_get_default_config(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- UserConfig ret_hu_conv = new UserConfig(null, ret);
+ 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);
return ret_hu_conv;
}
*/
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);
- if (ret >= 0 && ret < 1024) { return null; }
- ChannelManagerReadArgs ret_hu_conv = new ChannelManagerReadArgs(null, ret);
+ 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);
ret_hu_conv.ptrs_to.add(keys_manager);
ret_hu_conv.ptrs_to.add(fee_estimator);
final LDKChannelMessageHandlerHolder impl_holder = new LDKChannelMessageHandlerHolder();
impl_holder.held = new ChannelMessageHandler(new bindings.LDKChannelMessageHandler() {
@Override public void handle_open_channel(byte[] their_node_id, long their_features, long msg) {
- InitFeatures their_features_hu_conv = new InitFeatures(null, their_features);
+ InitFeatures their_features_hu_conv = null; if (their_features < 0 || their_features > 4096) { their_features_hu_conv = new InitFeatures(null, their_features); }
their_features_hu_conv.ptrs_to.add(this);
- OpenChannel msg_hu_conv = new OpenChannel(null, msg);
+ OpenChannel msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new OpenChannel(null, msg); }
arg.handle_open_channel(their_node_id, their_features_hu_conv, msg_hu_conv);
}
@Override public void handle_accept_channel(byte[] their_node_id, long their_features, long msg) {
- InitFeatures their_features_hu_conv = new InitFeatures(null, their_features);
+ InitFeatures their_features_hu_conv = null; if (their_features < 0 || their_features > 4096) { their_features_hu_conv = new InitFeatures(null, their_features); }
their_features_hu_conv.ptrs_to.add(this);
- AcceptChannel msg_hu_conv = new AcceptChannel(null, msg);
+ AcceptChannel msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new AcceptChannel(null, msg); }
arg.handle_accept_channel(their_node_id, their_features_hu_conv, msg_hu_conv);
}
@Override public void handle_funding_created(byte[] their_node_id, long msg) {
- FundingCreated msg_hu_conv = new FundingCreated(null, msg);
+ FundingCreated msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new FundingCreated(null, msg); }
arg.handle_funding_created(their_node_id, msg_hu_conv);
}
@Override public void handle_funding_signed(byte[] their_node_id, long msg) {
- FundingSigned msg_hu_conv = new FundingSigned(null, msg);
+ FundingSigned msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new FundingSigned(null, msg); }
arg.handle_funding_signed(their_node_id, msg_hu_conv);
}
@Override public void handle_funding_locked(byte[] their_node_id, long msg) {
- FundingLocked msg_hu_conv = new FundingLocked(null, msg);
+ FundingLocked msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new FundingLocked(null, msg); }
arg.handle_funding_locked(their_node_id, msg_hu_conv);
}
@Override public void handle_shutdown(byte[] their_node_id, long their_features, long msg) {
- InitFeatures their_features_hu_conv = new InitFeatures(null, their_features);
- Shutdown msg_hu_conv = new Shutdown(null, msg);
+ InitFeatures their_features_hu_conv = null; if (their_features < 0 || their_features > 4096) { their_features_hu_conv = new InitFeatures(null, their_features); }
+ Shutdown msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new Shutdown(null, msg); }
arg.handle_shutdown(their_node_id, their_features_hu_conv, msg_hu_conv);
}
@Override public void handle_closing_signed(byte[] their_node_id, long msg) {
- ClosingSigned msg_hu_conv = new ClosingSigned(null, msg);
+ ClosingSigned msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ClosingSigned(null, msg); }
arg.handle_closing_signed(their_node_id, msg_hu_conv);
}
@Override public void handle_update_add_htlc(byte[] their_node_id, long msg) {
- UpdateAddHTLC msg_hu_conv = new UpdateAddHTLC(null, msg);
+ UpdateAddHTLC msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new UpdateAddHTLC(null, msg); }
arg.handle_update_add_htlc(their_node_id, msg_hu_conv);
}
@Override public void handle_update_fulfill_htlc(byte[] their_node_id, long msg) {
- UpdateFulfillHTLC msg_hu_conv = new UpdateFulfillHTLC(null, msg);
+ UpdateFulfillHTLC msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new UpdateFulfillHTLC(null, msg); }
arg.handle_update_fulfill_htlc(their_node_id, msg_hu_conv);
}
@Override public void handle_update_fail_htlc(byte[] their_node_id, long msg) {
- UpdateFailHTLC msg_hu_conv = new UpdateFailHTLC(null, msg);
+ UpdateFailHTLC msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new UpdateFailHTLC(null, msg); }
arg.handle_update_fail_htlc(their_node_id, msg_hu_conv);
}
@Override public void handle_update_fail_malformed_htlc(byte[] their_node_id, long msg) {
- UpdateFailMalformedHTLC msg_hu_conv = new UpdateFailMalformedHTLC(null, msg);
+ UpdateFailMalformedHTLC msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new UpdateFailMalformedHTLC(null, msg); }
arg.handle_update_fail_malformed_htlc(their_node_id, msg_hu_conv);
}
@Override public void handle_commitment_signed(byte[] their_node_id, long msg) {
- CommitmentSigned msg_hu_conv = new CommitmentSigned(null, msg);
+ CommitmentSigned msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new CommitmentSigned(null, msg); }
arg.handle_commitment_signed(their_node_id, msg_hu_conv);
}
@Override public void handle_revoke_and_ack(byte[] their_node_id, long msg) {
- RevokeAndACK msg_hu_conv = new RevokeAndACK(null, msg);
+ RevokeAndACK msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new RevokeAndACK(null, msg); }
arg.handle_revoke_and_ack(their_node_id, msg_hu_conv);
}
@Override public void handle_update_fee(byte[] their_node_id, long msg) {
- UpdateFee msg_hu_conv = new UpdateFee(null, msg);
+ UpdateFee msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new UpdateFee(null, msg); }
arg.handle_update_fee(their_node_id, msg_hu_conv);
}
@Override public void handle_announcement_signatures(byte[] their_node_id, long msg) {
- AnnouncementSignatures msg_hu_conv = new AnnouncementSignatures(null, msg);
+ AnnouncementSignatures msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new AnnouncementSignatures(null, msg); }
arg.handle_announcement_signatures(their_node_id, msg_hu_conv);
}
@Override public void peer_disconnected(byte[] their_node_id, boolean no_connection_possible) {
arg.peer_disconnected(their_node_id, no_connection_possible);
}
@Override public void peer_connected(byte[] their_node_id, long msg) {
- Init msg_hu_conv = new Init(null, msg);
+ Init msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new Init(null, msg); }
arg.peer_connected(their_node_id, msg_hu_conv);
}
@Override public void handle_channel_reestablish(byte[] their_node_id, long msg) {
- ChannelReestablish msg_hu_conv = new ChannelReestablish(null, msg);
+ ChannelReestablish msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ChannelReestablish(null, msg); }
arg.handle_channel_reestablish(their_node_id, msg_hu_conv);
}
@Override public void handle_channel_update(byte[] their_node_id, long msg) {
- ChannelUpdate msg_hu_conv = new ChannelUpdate(null, msg);
+ ChannelUpdate msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ChannelUpdate(null, msg); }
arg.handle_channel_update(their_node_id, msg_hu_conv);
}
@Override public void handle_error(byte[] their_node_id, long msg) {
- ErrorMessage msg_hu_conv = new ErrorMessage(null, msg);
+ ErrorMessage msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ErrorMessage(null, msg); }
arg.handle_error(their_node_id, msg_hu_conv);
}
}, MessageSendEventsProvider.new_impl(MessageSendEventsProvider_impl).bindings_instance);
*/
public ChannelMonitor clone() {
long ret = bindings.ChannelMonitor_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- ChannelMonitor ret_hu_conv = new ChannelMonitor(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public Result_NoneMonitorUpdateErrorZ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneMonitorUpdateErrorZ ret_hu_conv = Result_NoneMonitorUpdateErrorZ.constr_from_ptr(ret);
this.ptrs_to.add(updates);
this.ptrs_to.add(broadcaster);
*/
public TwoTuple_OutPointScriptZ get_funding_txo() {
long ret = bindings.ChannelMonitor_get_funding_txo(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
TwoTuple_OutPointScriptZ ret_hu_conv = new TwoTuple_OutPointScriptZ(null, ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
public BestBlock current_best_block() {
long ret = bindings.ChannelMonitor_current_best_block(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- BestBlock ret_hu_conv = new BestBlock(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public ChannelMonitorUpdate clone() {
long ret = bindings.ChannelMonitorUpdate_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- ChannelMonitorUpdate ret_hu_conv = new ChannelMonitorUpdate(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_ChannelMonitorUpdateDecodeErrorZ read(byte[] ser) {
long ret = bindings.ChannelMonitorUpdate_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelMonitorUpdateDecodeErrorZ ret_hu_conv = Result_ChannelMonitorUpdateDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
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(funding_pubkey_arg, revocation_basepoint_arg, payment_point_arg, delayed_payment_basepoint_arg, htlc_basepoint_arg);
- if (ret >= 0 && ret < 1024) { return null; }
- ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public ChannelPublicKeys clone() {
long ret = bindings.ChannelPublicKeys_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_ChannelPublicKeysDecodeErrorZ read(byte[] ser) {
long ret = bindings.ChannelPublicKeys_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelPublicKeysDecodeErrorZ ret_hu_conv = Result_ChannelPublicKeysDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public ChannelReestablish clone() {
long ret = bindings.ChannelReestablish_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- ChannelReestablish ret_hu_conv = new ChannelReestablish(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_ChannelReestablishDecodeErrorZ read(byte[] ser) {
long ret = bindings.ChannelReestablish_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelReestablishDecodeErrorZ ret_hu_conv = Result_ChannelReestablishDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public ChannelPublicKeys get_holder_pubkeys() {
long ret = bindings.ChannelTransactionParameters_get_holder_pubkeys(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret);
+ 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);
return ret_hu_conv;
}
@Nullable
public CounterpartyChannelTransactionParameters get_counterparty_parameters() {
long ret = bindings.ChannelTransactionParameters_get_counterparty_parameters(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- CounterpartyChannelTransactionParameters ret_hu_conv = new CounterpartyChannelTransactionParameters(null, ret);
+ 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);
return ret_hu_conv;
}
@Nullable
public OutPoint get_funding_outpoint() {
long ret = bindings.ChannelTransactionParameters_get_funding_outpoint(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- OutPoint ret_hu_conv = new OutPoint(null, ret);
+ 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;
}
*/
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);
- if (ret >= 0 && ret < 1024) { return null; }
- ChannelTransactionParameters ret_hu_conv = new ChannelTransactionParameters(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public ChannelTransactionParameters clone() {
long ret = bindings.ChannelTransactionParameters_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- ChannelTransactionParameters ret_hu_conv = new ChannelTransactionParameters(null, ret);
+ 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;
}
*/
public DirectedChannelTransactionParameters as_holder_broadcastable() {
long ret = bindings.ChannelTransactionParameters_as_holder_broadcastable(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- DirectedChannelTransactionParameters ret_hu_conv = new DirectedChannelTransactionParameters(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public DirectedChannelTransactionParameters as_counterparty_broadcastable() {
long ret = bindings.ChannelTransactionParameters_as_counterparty_broadcastable(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- DirectedChannelTransactionParameters ret_hu_conv = new DirectedChannelTransactionParameters(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_ChannelTransactionParametersDecodeErrorZ read(byte[] ser) {
long ret = bindings.ChannelTransactionParameters_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_ChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public UnsignedChannelUpdate get_contents() {
long ret = bindings.ChannelUpdate_get_contents(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- UnsignedChannelUpdate ret_hu_conv = new UnsignedChannelUpdate(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static ChannelUpdate of(byte[] signature_arg, UnsignedChannelUpdate contents_arg) {
long ret = bindings.ChannelUpdate_new(signature_arg, contents_arg == null ? 0 : contents_arg.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
- ChannelUpdate ret_hu_conv = new ChannelUpdate(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public ChannelUpdate clone() {
long ret = bindings.ChannelUpdate_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- ChannelUpdate ret_hu_conv = new ChannelUpdate(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_ChannelUpdateDecodeErrorZ read(byte[] ser) {
long ret = bindings.ChannelUpdate_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelUpdateDecodeErrorZ ret_hu_conv = Result_ChannelUpdateDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
@Nullable
public ClosingSignedFeeRange get_fee_range() {
long ret = bindings.ClosingSigned_get_fee_range(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- ClosingSignedFeeRange ret_hu_conv = new ClosingSignedFeeRange(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static ClosingSigned of(byte[] channel_id_arg, long fee_satoshis_arg, byte[] signature_arg, ClosingSignedFeeRange fee_range_arg) {
long ret = bindings.ClosingSigned_new(channel_id_arg, fee_satoshis_arg, signature_arg, fee_range_arg == null ? 0 : fee_range_arg.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
- ClosingSigned ret_hu_conv = new ClosingSigned(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public ClosingSigned clone() {
long ret = bindings.ClosingSigned_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- ClosingSigned ret_hu_conv = new ClosingSigned(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_ClosingSignedDecodeErrorZ read(byte[] ser) {
long ret = bindings.ClosingSigned_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_ClosingSignedDecodeErrorZ ret_hu_conv = Result_ClosingSignedDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
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);
- if (ret >= 0 && ret < 1024) { return null; }
- ClosingSignedFeeRange ret_hu_conv = new ClosingSignedFeeRange(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public ClosingSignedFeeRange clone() {
long ret = bindings.ClosingSignedFeeRange_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- ClosingSignedFeeRange ret_hu_conv = new ClosingSignedFeeRange(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_ClosingSignedFeeRangeDecodeErrorZ read(byte[] ser) {
long ret = bindings.ClosingSignedFeeRange_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_ClosingSignedFeeRangeDecodeErrorZ ret_hu_conv = Result_ClosingSignedFeeRangeDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public ClosingTransaction clone() {
long ret = bindings.ClosingTransaction_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- ClosingTransaction ret_hu_conv = new ClosingTransaction(null, ret);
+ 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);
return ret_hu_conv;
}
*/
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);
- if (ret >= 0 && ret < 1024) { return null; }
- ClosingTransaction ret_hu_conv = new ClosingTransaction(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public TrustedClosingTransaction trust() {
long ret = bindings.ClosingTransaction_trust(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- TrustedClosingTransaction ret_hu_conv = new TrustedClosingTransaction(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public Result_TrustedClosingTransactionNoneZ verify(OutPoint funding_outpoint) {
long ret = bindings.ClosingTransaction_verify(this.ptr, funding_outpoint == null ? 0 : funding_outpoint.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_TrustedClosingTransactionNoneZ ret_hu_conv = Result_TrustedClosingTransactionNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public ClosureReason clone() {
long ret = bindings.ClosureReason_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
ClosureReason ret_hu_conv = ClosureReason.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
public static ClosureReason counterparty_force_closed(java.lang.String peer_msg) {
long ret = bindings.ClosureReason_counterparty_force_closed(peer_msg);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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;
*/
public static ClosureReason holder_force_closed() {
long ret = bindings.ClosureReason_holder_force_closed();
- if (ret >= 0 && ret < 1024) { return null; }
+ 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;
*/
public static ClosureReason cooperative_closure() {
long ret = bindings.ClosureReason_cooperative_closure();
- if (ret >= 0 && ret < 1024) { return null; }
+ 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;
*/
public static ClosureReason commitment_tx_confirmed() {
long ret = bindings.ClosureReason_commitment_tx_confirmed();
- if (ret >= 0 && ret < 1024) { return null; }
+ 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;
*/
public static ClosureReason processing_error(java.lang.String err) {
long ret = bindings.ClosureReason_processing_error(err);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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;
*/
public static ClosureReason disconnected_peer() {
long ret = bindings.ClosureReason_disconnected_peer();
- if (ret >= 0 && ret < 1024) { return null; }
+ 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;
*/
public static ClosureReason outdated_channel_manager() {
long ret = bindings.ClosureReason_outdated_channel_manager();
- if (ret >= 0 && ret < 1024) { return null; }
+ 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;
*/
public static CommitmentSigned of(byte[] channel_id_arg, byte[] signature_arg, byte[][] htlc_signatures_arg) {
long ret = bindings.CommitmentSigned_new(channel_id_arg, signature_arg, htlc_signatures_arg);
- if (ret >= 0 && ret < 1024) { return null; }
- CommitmentSigned ret_hu_conv = new CommitmentSigned(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public CommitmentSigned clone() {
long ret = bindings.CommitmentSigned_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- CommitmentSigned ret_hu_conv = new CommitmentSigned(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_CommitmentSignedDecodeErrorZ read(byte[] ser) {
long ret = bindings.CommitmentSigned_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_CommitmentSignedDecodeErrorZ ret_hu_conv = Result_CommitmentSignedDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public CommitmentTransaction clone() {
long ret = bindings.CommitmentTransaction_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- CommitmentTransaction ret_hu_conv = new CommitmentTransaction(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_CommitmentTransactionDecodeErrorZ read(byte[] ser) {
long ret = bindings.CommitmentTransaction_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_CommitmentTransactionDecodeErrorZ ret_hu_conv = Result_CommitmentTransactionDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public TrustedCommitmentTransaction trust() {
long ret = bindings.CommitmentTransaction_trust(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- TrustedCommitmentTransaction ret_hu_conv = new TrustedCommitmentTransaction(null, ret);
+ 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);
return ret_hu_conv;
}
*/
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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_TrustedCommitmentTransactionNoneZ ret_hu_conv = Result_TrustedCommitmentTransactionNoneZ.constr_from_ptr(ret);
this.ptrs_to.add(channel_parameters);
this.ptrs_to.add(broadcaster_keys);
UpdateAddHTLC[] ret_conv_15_arr = new UpdateAddHTLC[ret.length];
for (int p = 0; p < ret.length; p++) {
long ret_conv_15 = ret[p];
- UpdateAddHTLC ret_conv_15_hu_conv = new UpdateAddHTLC(null, ret_conv_15);
+ UpdateAddHTLC ret_conv_15_hu_conv = null; if (ret_conv_15 < 0 || ret_conv_15 > 4096) { ret_conv_15_hu_conv = new UpdateAddHTLC(null, ret_conv_15); }
ret_conv_15_hu_conv.ptrs_to.add(this);
ret_conv_15_arr[p] = ret_conv_15_hu_conv;
}
UpdateFulfillHTLC[] ret_conv_19_arr = new UpdateFulfillHTLC[ret.length];
for (int t = 0; t < ret.length; t++) {
long ret_conv_19 = ret[t];
- UpdateFulfillHTLC ret_conv_19_hu_conv = new UpdateFulfillHTLC(null, ret_conv_19);
+ UpdateFulfillHTLC ret_conv_19_hu_conv = null; if (ret_conv_19 < 0 || ret_conv_19 > 4096) { ret_conv_19_hu_conv = new UpdateFulfillHTLC(null, ret_conv_19); }
ret_conv_19_hu_conv.ptrs_to.add(this);
ret_conv_19_arr[t] = ret_conv_19_hu_conv;
}
UpdateFailHTLC[] ret_conv_16_arr = new UpdateFailHTLC[ret.length];
for (int q = 0; q < ret.length; q++) {
long ret_conv_16 = ret[q];
- UpdateFailHTLC ret_conv_16_hu_conv = new UpdateFailHTLC(null, ret_conv_16);
+ UpdateFailHTLC ret_conv_16_hu_conv = null; if (ret_conv_16 < 0 || ret_conv_16 > 4096) { ret_conv_16_hu_conv = new UpdateFailHTLC(null, ret_conv_16); }
ret_conv_16_hu_conv.ptrs_to.add(this);
ret_conv_16_arr[q] = ret_conv_16_hu_conv;
}
UpdateFailMalformedHTLC[] ret_conv_25_arr = new UpdateFailMalformedHTLC[ret.length];
for (int z = 0; z < ret.length; z++) {
long ret_conv_25 = ret[z];
- UpdateFailMalformedHTLC ret_conv_25_hu_conv = new UpdateFailMalformedHTLC(null, ret_conv_25);
+ UpdateFailMalformedHTLC ret_conv_25_hu_conv = null; if (ret_conv_25 < 0 || ret_conv_25 > 4096) { ret_conv_25_hu_conv = new UpdateFailMalformedHTLC(null, ret_conv_25); }
ret_conv_25_hu_conv.ptrs_to.add(this);
ret_conv_25_arr[z] = ret_conv_25_hu_conv;
}
@Nullable
public UpdateFee get_update_fee() {
long ret = bindings.CommitmentUpdate_get_update_fee(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- UpdateFee ret_hu_conv = new UpdateFee(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public CommitmentSigned get_commitment_signed() {
long ret = bindings.CommitmentUpdate_get_commitment_signed(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- CommitmentSigned ret_hu_conv = new CommitmentSigned(null, ret);
+ 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);
return ret_hu_conv;
}
*/
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);
- if (ret >= 0 && ret < 1024) { return null; }
- CommitmentUpdate ret_hu_conv = new CommitmentUpdate(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public CommitmentUpdate clone() {
long ret = bindings.CommitmentUpdate_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- CommitmentUpdate ret_hu_conv = new CommitmentUpdate(null, ret);
+ 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);
return ret_hu_conv;
}
class CommonBase {
long ptr;
LinkedList<Object> ptrs_to = new LinkedList();
- protected CommonBase(long ptr) { assert ptr < 0 || ptr > 1024; this.ptr = ptr; }
+ protected CommonBase(long ptr) { assert ptr < 0 || ptr > 4096; this.ptr = ptr; }
}
*/
public ChannelPublicKeys get_pubkeys() {
long ret = bindings.CounterpartyChannelTransactionParameters_get_pubkeys(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret);
+ 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);
return ret_hu_conv;
}
*/
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);
- if (ret >= 0 && ret < 1024) { return null; }
- CounterpartyChannelTransactionParameters ret_hu_conv = new CounterpartyChannelTransactionParameters(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public CounterpartyChannelTransactionParameters clone() {
long ret = bindings.CounterpartyChannelTransactionParameters_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- CounterpartyChannelTransactionParameters ret_hu_conv = new CounterpartyChannelTransactionParameters(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_CounterpartyChannelTransactionParametersDecodeErrorZ read(byte[] ser) {
long ret = bindings.CounterpartyChannelTransactionParameters_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_CounterpartyChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_CounterpartyChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
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);
- if (ret >= 0 && ret < 1024) { return null; }
- CounterpartyForwardingInfo ret_hu_conv = new CounterpartyForwardingInfo(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public CounterpartyForwardingInfo clone() {
long ret = bindings.CounterpartyForwardingInfo_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- CounterpartyForwardingInfo ret_hu_conv = new CounterpartyForwardingInfo(null, ret);
+ 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);
return ret_hu_conv;
}
*/
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, sender_node_id);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret);
this.ptrs_to.add(msg);
return ret_hu_conv;
*/
public Result_COption_TypeZDecodeErrorZ read(short message_type, byte[] buffer) {
long ret = bindings.CustomMessageReader_read(this.ptr, message_type, buffer);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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 DataLossProtect of(byte[] your_last_per_commitment_secret_arg, byte[] my_current_per_commitment_point_arg) {
long ret = bindings.DataLossProtect_new(your_last_per_commitment_secret_arg, my_current_per_commitment_point_arg);
- if (ret >= 0 && ret < 1024) { return null; }
- DataLossProtect ret_hu_conv = new DataLossProtect(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public DataLossProtect clone() {
long ret = bindings.DataLossProtect_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- DataLossProtect ret_hu_conv = new DataLossProtect(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public DecodeError clone() {
long ret = bindings.DecodeError_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- DecodeError ret_hu_conv = new DecodeError(null, ret);
+ 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);
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;
+
+
+/**
+ * A [`Router`] implemented using [`find_route`].
+ */
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class DefaultRouter extends CommonBase {
+ DefaultRouter(Object _dummy, long ptr) { super(ptr); }
+ @Override @SuppressWarnings("deprecation")
+ protected void finalize() throws Throwable {
+ super.finalize();
+ if (ptr != 0) { bindings.DefaultRouter_free(ptr); }
+ }
+
+ /**
+ * Creates a new router using the given [`NetworkGraph`] and [`Logger`].
+ */
+ 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);
+ 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);
+ ret_hu_conv.ptrs_to.add(network_graph);
+ ret_hu_conv.ptrs_to.add(logger);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Constructs a new Router which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned Router must be freed before this_arg is
+ */
+ public Router as_Router() {
+ long ret = bindings.DefaultRouter_as_Router(this.ptr);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Router ret_hu_conv = new Router(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
+}
*/
public OutPoint get_outpoint() {
long ret = bindings.DelayedPaymentOutputDescriptor_get_outpoint(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- OutPoint ret_hu_conv = new OutPoint(null, ret);
+ 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;
}
*/
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, per_commitment_point_arg, to_self_delay_arg, output_arg.ptr, revocation_pubkey_arg, channel_keys_id_arg, channel_value_satoshis_arg);
- if (ret >= 0 && ret < 1024) { return null; }
- DelayedPaymentOutputDescriptor ret_hu_conv = new DelayedPaymentOutputDescriptor(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public DelayedPaymentOutputDescriptor clone() {
long ret = bindings.DelayedPaymentOutputDescriptor_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- DelayedPaymentOutputDescriptor ret_hu_conv = new DelayedPaymentOutputDescriptor(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_DelayedPaymentOutputDescriptorDecodeErrorZ read(byte[] ser) {
long ret = bindings.DelayedPaymentOutputDescriptor_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_DelayedPaymentOutputDescriptorDecodeErrorZ ret_hu_conv = Result_DelayedPaymentOutputDescriptorDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Description clone() {
long ret = bindings.Description_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- Description ret_hu_conv = new Description(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_DescriptionCreationErrorZ of(java.lang.String description) {
long ret = bindings.Description_new(description);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_DescriptionCreationErrorZ ret_hu_conv = Result_DescriptionCreationErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public ChannelPublicKeys broadcaster_pubkeys() {
long ret = bindings.DirectedChannelTransactionParameters_broadcaster_pubkeys(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public ChannelPublicKeys countersignatory_pubkeys() {
long ret = bindings.DirectedChannelTransactionParameters_countersignatory_pubkeys(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public OutPoint funding_outpoint() {
long ret = bindings.DirectedChannelTransactionParameters_funding_outpoint(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- OutPoint ret_hu_conv = new OutPoint(null, ret);
+ 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;
}
*/
public Option_u64Z get_htlc_maximum_msat() {
long ret = bindings.DirectionalChannelInfo_get_htlc_maximum_msat(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public RoutingFees get_fees() {
long ret = bindings.DirectionalChannelInfo_get_fees(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- RoutingFees ret_hu_conv = new RoutingFees(null, ret);
+ 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);
return ret_hu_conv;
}
@Nullable
public ChannelUpdate get_last_update_message() {
long ret = bindings.DirectionalChannelInfo_get_last_update_message(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- ChannelUpdate ret_hu_conv = new ChannelUpdate(null, ret);
+ 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);
return ret_hu_conv;
}
*/
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);
- if (ret >= 0 && ret < 1024) { return null; }
- DirectionalChannelInfo ret_hu_conv = new DirectionalChannelInfo(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public DirectionalChannelInfo clone() {
long ret = bindings.DirectionalChannelInfo_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- DirectionalChannelInfo ret_hu_conv = new DirectionalChannelInfo(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_DirectionalChannelInfoDecodeErrorZ read(byte[] ser) {
long ret = bindings.DirectionalChannelInfo_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_DirectionalChannelInfoDecodeErrorZ ret_hu_conv = Result_DirectionalChannelInfoDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private DisconnectPeer(long ptr, bindings.LDKErrorAction.DisconnectPeer obj) {
super(null, ptr);
long msg = obj.msg;
- ErrorMessage msg_hu_conv = new ErrorMessage(null, msg);
+ ErrorMessage msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ErrorMessage(null, msg); }
msg_hu_conv.ptrs_to.add(this);
this.msg = msg_hu_conv;
}
private SendErrorMessage(long ptr, bindings.LDKErrorAction.SendErrorMessage obj) {
super(null, ptr);
long msg = obj.msg;
- ErrorMessage msg_hu_conv = new ErrorMessage(null, msg);
+ ErrorMessage msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ErrorMessage(null, msg); }
msg_hu_conv.ptrs_to.add(this);
this.msg = msg_hu_conv;
}
*/
public ErrorAction clone() {
long ret = bindings.ErrorAction_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
ErrorAction ret_hu_conv = ErrorAction.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
public static ErrorAction disconnect_peer(ErrorMessage msg) {
long ret = bindings.ErrorAction_disconnect_peer(msg == null ? 0 : msg.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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;
*/
public static ErrorAction ignore_error() {
long ret = bindings.ErrorAction_ignore_error();
- if (ret >= 0 && ret < 1024) { return null; }
+ 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;
*/
public static ErrorAction ignore_and_log(org.ldk.enums.Level a) {
long ret = bindings.ErrorAction_ignore_and_log(a);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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;
*/
public static ErrorAction send_error_message(ErrorMessage msg) {
long ret = bindings.ErrorAction_send_error_message(msg == null ? 0 : msg.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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;
*/
public static ErrorMessage of(byte[] channel_id_arg, java.lang.String data_arg) {
long ret = bindings.ErrorMessage_new(channel_id_arg, data_arg);
- if (ret >= 0 && ret < 1024) { return null; }
- ErrorMessage ret_hu_conv = new ErrorMessage(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public ErrorMessage clone() {
long ret = bindings.ErrorMessage_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- ErrorMessage ret_hu_conv = new ErrorMessage(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_ErrorMessageDecodeErrorZ read(byte[] ser) {
long ret = bindings.ErrorMessage_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_ErrorMessageDecodeErrorZ ret_hu_conv = Result_ErrorMessageDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public static ErroringMessageHandler of() {
long ret = bindings.ErroringMessageHandler_new();
- if (ret >= 0 && ret < 1024) { return null; }
- ErroringMessageHandler ret_hu_conv = new ErroringMessageHandler(null, ret);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ ErroringMessageHandler ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ErroringMessageHandler(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
return ret_hu_conv;
}
*/
public MessageSendEventsProvider as_MessageSendEventsProvider() {
long ret = bindings.ErroringMessageHandler_as_MessageSendEventsProvider(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
MessageSendEventsProvider ret_hu_conv = new MessageSendEventsProvider(null, ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
public ChannelMessageHandler as_ChannelMessageHandler() {
long ret = bindings.ErroringMessageHandler_as_ChannelMessageHandler(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
ChannelMessageHandler ret_hu_conv = new ChannelMessageHandler(null, ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
}
}
public final static class PaymentSent 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
+ *
+ * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ @Nullable public final byte[] payment_id;
/**
* The preimage to the hash given to ChannelManager::send_payment.
* Note that this serves as a payment receipt, if you wish to have such a thing, you must
* [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
*/
public final byte[] payment_hash;
+ /**
+ * The total fee which was spent at intermediate hops in this payment, across all paths.
+ *
+ * Note that, like [`Route::get_total_fees`] this does *not* include any potential
+ * overpayment to the recipient node.
+ *
+ * If the recipient or an intermediate node misbehaves and gives us free money, this may
+ * overstate the amount paid, though this is unlikely.
+ *
+ * [`Route::get_total_fees`]: crate::routing::router::Route::get_total_fees
+ */
+ public final Option_u64Z fee_paid_msat;
private PaymentSent(long ptr, bindings.LDKEvent.PaymentSent obj) {
super(null, ptr);
+ this.payment_id = obj.payment_id;
this.payment_preimage = obj.payment_preimage;
this.payment_hash = obj.payment_hash;
+ long fee_paid_msat = obj.fee_paid_msat;
+ Option_u64Z fee_paid_msat_hu_conv = Option_u64Z.constr_from_ptr(fee_paid_msat);
+ fee_paid_msat_hu_conv.ptrs_to.add(this);
+ this.fee_paid_msat = fee_paid_msat_hu_conv;
}
}
public final static class PaymentPathFailed 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
+ *
+ * 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.
*/
* retried. May be `None` for older [`Event`] serializations.
*/
public final Option_u64Z short_channel_id;
+ /**
+ * Parameters needed to compute a new [`Route`] when retrying the failed payment path.
+ *
+ * See [`find_route`] for details.
+ *
+ * [`Route`]: crate::routing::router::Route
+ * [`find_route`]: crate::routing::router::find_route
+ *
+ * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ @Nullable public final RouteParameters retry;
private PaymentPathFailed(long ptr, bindings.LDKEvent.PaymentPathFailed obj) {
super(null, ptr);
+ this.payment_id = obj.payment_id;
this.payment_hash = obj.payment_hash;
this.rejected_by_dest = obj.rejected_by_dest;
long network_update = obj.network_update;
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 = new RouteHop(null, path_conv_10);
+ 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;
}
Option_u64Z short_channel_id_hu_conv = Option_u64Z.constr_from_ptr(short_channel_id);
short_channel_id_hu_conv.ptrs_to.add(this);
this.short_channel_id = short_channel_id_hu_conv;
+ long retry = obj.retry;
+ RouteParameters retry_hu_conv = null; if (retry < 0 || retry > 4096) { retry_hu_conv = new RouteParameters(null, retry); }
+ retry_hu_conv.ptrs_to.add(this);
+ this.retry = retry_hu_conv;
}
}
public final static class PendingHTLCsForwardable extends Event {
*/
public Event clone() {
long ret = bindings.Event_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Event ret_hu_conv = Event.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
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(temporary_channel_id, channel_value_satoshis, output_script, user_channel_id);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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;
*/
public static Event payment_received(byte[] payment_hash, long amt, PaymentPurpose purpose) {
long ret = bindings.Event_payment_received(payment_hash, amt, purpose.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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 PaymentSent-variant Event
*/
- public static Event payment_sent(byte[] payment_preimage, byte[] payment_hash) {
- long ret = bindings.Event_payment_sent(payment_preimage, payment_hash);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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(payment_id, payment_preimage, payment_hash, fee_paid_msat.ptr);
+ 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 PaymentPathFailed-variant Event
*/
- public static Event payment_path_failed(byte[] payment_hash, boolean rejected_by_dest, Option_NetworkUpdateZ network_update, boolean all_paths_failed, RouteHop[] path, Option_u64Z short_channel_id) {
- long ret = bindings.Event_payment_path_failed(payment_hash, 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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(payment_id, payment_hash, 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);
+ 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;
*/
public static Event pending_htlcs_forwardable(long time_forwardable) {
long ret = bindings.Event_pending_htlcs_forwardable(time_forwardable);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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;
*/
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);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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;
*/
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);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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;
*/
public static Event channel_closed(byte[] channel_id, long user_channel_id, ClosureReason reason) {
long ret = bindings.Event_channel_closed(channel_id, user_channel_id, reason.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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;
*/
public static Event discard_funding(byte[] channel_id, byte[] transaction) {
long ret = bindings.Event_discard_funding(channel_id, transaction);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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;
*/
public ExpiryTime clone() {
long ret = bindings.ExpiryTime_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- ExpiryTime ret_hu_conv = new ExpiryTime(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_ExpiryTimeCreationErrorZ from_seconds(long seconds) {
long ret = bindings.ExpiryTime_from_seconds(seconds);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_ExpiryTimeCreationErrorZ ret_hu_conv = Result_ExpiryTimeCreationErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Fallback clone() {
long ret = bindings.Fallback_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Fallback ret_hu_conv = Fallback.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
public static Fallback seg_wit_program(UInt5 version, byte[] program) {
long ret = bindings.Fallback_seg_wit_program(version.getVal(), program);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public static Fallback pub_key_hash(byte[] a) {
long ret = bindings.Fallback_pub_key_hash(a);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public static Fallback script_hash(byte[] a) {
long ret = bindings.Fallback_script_hash(a);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public static FilesystemPersister of(java.lang.String path_to_channel_data) {
long ret = bindings.FilesystemPersister_new(path_to_channel_data);
- if (ret >= 0 && ret < 1024) { return null; }
- FilesystemPersister ret_hu_conv = new FilesystemPersister(null, ret);
+ 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);
return ret_hu_conv;
}
*/
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);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public Persist as_Persist() {
long ret = bindings.FilesystemPersister_as_Persist(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Persist ret_hu_conv = new Persist(null, ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
arg.register_tx(txid, script_pubkey);
}
@Override public long register_output(long output) {
- WatchedOutput output_hu_conv = new WatchedOutput(null, output);
+ WatchedOutput output_hu_conv = null; if (output < 0 || output > 4096) { output_hu_conv = new WatchedOutput(null, output); }
output_hu_conv.ptrs_to.add(this);
Option_C2Tuple_usizeTransactionZZ ret = arg.register_output(output_hu_conv);
long result = ret.ptr;
*/
public Option_C2Tuple_usizeTransactionZZ register_output(WatchedOutput output) {
long ret = bindings.Filter_register_output(this.ptr, output == null ? 0 : output.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
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(temporary_channel_id_arg, funding_txid_arg, funding_output_index_arg, signature_arg);
- if (ret >= 0 && ret < 1024) { return null; }
- FundingCreated ret_hu_conv = new FundingCreated(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public FundingCreated clone() {
long ret = bindings.FundingCreated_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- FundingCreated ret_hu_conv = new FundingCreated(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_FundingCreatedDecodeErrorZ read(byte[] ser) {
long ret = bindings.FundingCreated_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_FundingCreatedDecodeErrorZ ret_hu_conv = Result_FundingCreatedDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public static FundingLocked of(byte[] channel_id_arg, byte[] next_per_commitment_point_arg) {
long ret = bindings.FundingLocked_new(channel_id_arg, next_per_commitment_point_arg);
- if (ret >= 0 && ret < 1024) { return null; }
- FundingLocked ret_hu_conv = new FundingLocked(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public FundingLocked clone() {
long ret = bindings.FundingLocked_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- FundingLocked ret_hu_conv = new FundingLocked(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_FundingLockedDecodeErrorZ read(byte[] ser) {
long ret = bindings.FundingLocked_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_FundingLockedDecodeErrorZ ret_hu_conv = Result_FundingLockedDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public static FundingSigned of(byte[] channel_id_arg, byte[] signature_arg) {
long ret = bindings.FundingSigned_new(channel_id_arg, signature_arg);
- if (ret >= 0 && ret < 1024) { return null; }
- FundingSigned ret_hu_conv = new FundingSigned(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public FundingSigned clone() {
long ret = bindings.FundingSigned_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- FundingSigned ret_hu_conv = new FundingSigned(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_FundingSignedDecodeErrorZ read(byte[] ser) {
long ret = bindings.FundingSigned_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_FundingSignedDecodeErrorZ ret_hu_conv = Result_FundingSignedDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public static GossipTimestampFilter of(byte[] chain_hash_arg, int first_timestamp_arg, int timestamp_range_arg) {
long ret = bindings.GossipTimestampFilter_new(chain_hash_arg, first_timestamp_arg, timestamp_range_arg);
- if (ret >= 0 && ret < 1024) { return null; }
- GossipTimestampFilter ret_hu_conv = new GossipTimestampFilter(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public GossipTimestampFilter clone() {
long ret = bindings.GossipTimestampFilter_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- GossipTimestampFilter ret_hu_conv = new GossipTimestampFilter(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_GossipTimestampFilterDecodeErrorZ read(byte[] ser) {
long ret = bindings.GossipTimestampFilter_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_GossipTimestampFilterDecodeErrorZ ret_hu_conv = Result_GossipTimestampFilterDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Option_u32Z get_transaction_output_index() {
long ret = bindings.HTLCOutputInCommitment_get_transaction_output_index(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
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, payment_hash_arg, transaction_output_index_arg.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- HTLCOutputInCommitment ret_hu_conv = new HTLCOutputInCommitment(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public HTLCOutputInCommitment clone() {
long ret = bindings.HTLCOutputInCommitment_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- HTLCOutputInCommitment ret_hu_conv = new HTLCOutputInCommitment(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_HTLCOutputInCommitmentDecodeErrorZ read(byte[] ser) {
long ret = bindings.HTLCOutputInCommitment_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_HTLCOutputInCommitmentDecodeErrorZ ret_hu_conv = Result_HTLCOutputInCommitmentDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public HTLCUpdate clone() {
long ret = bindings.HTLCUpdate_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- HTLCUpdate ret_hu_conv = new HTLCUpdate(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_HTLCUpdateDecodeErrorZ read(byte[] ser) {
long ret = bindings.HTLCUpdate_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_HTLCUpdateDecodeErrorZ ret_hu_conv = Result_HTLCUpdateDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public HolderCommitmentTransaction clone() {
long ret = bindings.HolderCommitmentTransaction_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- HolderCommitmentTransaction ret_hu_conv = new HolderCommitmentTransaction(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_HolderCommitmentTransactionDecodeErrorZ read(byte[] ser) {
long ret = bindings.HolderCommitmentTransaction_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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, counterparty_sig, counterparty_htlc_sigs, holder_funding_key, counterparty_funding_key);
- if (ret >= 0 && ret < 1024) { return null; }
- HolderCommitmentTransaction ret_hu_conv = new HolderCommitmentTransaction(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static IgnoringMessageHandler of() {
long ret = bindings.IgnoringMessageHandler_new();
- if (ret >= 0 && ret < 1024) { return null; }
- IgnoringMessageHandler ret_hu_conv = new IgnoringMessageHandler(null, ret);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ IgnoringMessageHandler ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new IgnoringMessageHandler(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
return ret_hu_conv;
}
*/
public MessageSendEventsProvider as_MessageSendEventsProvider() {
long ret = bindings.IgnoringMessageHandler_as_MessageSendEventsProvider(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
MessageSendEventsProvider ret_hu_conv = new MessageSendEventsProvider(null, ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
public RoutingMessageHandler as_RoutingMessageHandler() {
long ret = bindings.IgnoringMessageHandler_as_RoutingMessageHandler(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
RoutingMessageHandler ret_hu_conv = new RoutingMessageHandler(null, ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
public CustomMessageReader as_CustomMessageReader() {
long ret = bindings.IgnoringMessageHandler_as_CustomMessageReader(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
CustomMessageReader ret_hu_conv = new CustomMessageReader(null, ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
public CustomMessageHandler as_CustomMessageHandler() {
long ret = bindings.IgnoringMessageHandler_as_CustomMessageHandler(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
CustomMessageHandler ret_hu_conv = new CustomMessageHandler(null, ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
public InMemorySigner clone() {
long ret = bindings.InMemorySigner_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- InMemorySigner ret_hu_conv = new InMemorySigner(null, ret);
+ 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);
return ret_hu_conv;
}
*/
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(funding_key, revocation_base_key, payment_key, delayed_payment_base_key, htlc_base_key, commitment_seed, channel_value_satoshis, channel_keys_id);
- if (ret >= 0 && ret < 1024) { return null; }
- InMemorySigner ret_hu_conv = new InMemorySigner(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public ChannelPublicKeys counterparty_pubkeys() {
long ret = bindings.InMemorySigner_counterparty_pubkeys(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public OutPoint funding_outpoint() {
long ret = bindings.InMemorySigner_funding_outpoint(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- OutPoint ret_hu_conv = new OutPoint(null, ret);
+ 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;
}
*/
public ChannelTransactionParameters get_channel_parameters() {
long ret = bindings.InMemorySigner_get_channel_parameters(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- ChannelTransactionParameters ret_hu_conv = new ChannelTransactionParameters(null, ret);
+ 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;
}
*/
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);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
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);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public BaseSign as_BaseSign() {
long ret = bindings.InMemorySigner_as_BaseSign(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
BaseSign ret_hu_conv = new BaseSign(null, ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
public Sign as_Sign() {
long ret = bindings.InMemorySigner_as_Sign(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Sign ret_hu_conv = new Sign(null, ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
public static Result_InMemorySignerDecodeErrorZ read(byte[] ser) {
long ret = bindings.InMemorySigner_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_InMemorySignerDecodeErrorZ ret_hu_conv = Result_InMemorySignerDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public InitFeatures get_features() {
long ret = bindings.Init_get_features(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- InitFeatures ret_hu_conv = new InitFeatures(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Init of(InitFeatures features_arg) {
long ret = bindings.Init_new(features_arg == null ? 0 : features_arg.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
- Init ret_hu_conv = new Init(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public Init clone() {
long ret = bindings.Init_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- Init ret_hu_conv = new Init(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_InitDecodeErrorZ read(byte[] ser) {
long ret = bindings.Init_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_InitDecodeErrorZ ret_hu_conv = Result_InitDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public InitFeatures clone() {
long ret = bindings.InitFeatures_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- InitFeatures ret_hu_conv = new InitFeatures(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static InitFeatures empty() {
long ret = bindings.InitFeatures_empty();
- if (ret >= 0 && ret < 1024) { return null; }
- InitFeatures ret_hu_conv = new InitFeatures(null, ret);
+ 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(ret_hu_conv);
return ret_hu_conv;
}
*/
public static InitFeatures known() {
long ret = bindings.InitFeatures_known();
- if (ret >= 0 && ret < 1024) { return null; }
- InitFeatures ret_hu_conv = new InitFeatures(null, ret);
+ 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(ret_hu_conv);
return ret_hu_conv;
}
*/
public static Result_InitFeaturesDecodeErrorZ read(byte[] ser) {
long ret = bindings.InitFeatures_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_InitFeaturesDecodeErrorZ ret_hu_conv = Result_InitFeaturesDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public static InvalidShutdownScript of(byte[] script_arg) {
long ret = bindings.InvalidShutdownScript_new(script_arg);
- if (ret >= 0 && ret < 1024) { return null; }
- InvalidShutdownScript ret_hu_conv = new InvalidShutdownScript(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public InvalidShutdownScript clone() {
long ret = bindings.InvalidShutdownScript_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- InvalidShutdownScript ret_hu_conv = new InvalidShutdownScript(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public Invoice clone() {
long ret = bindings.Invoice_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- Invoice ret_hu_conv = new Invoice(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public SignedRawInvoice into_signed_raw() {
long ret = bindings.Invoice_into_signed_raw(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- SignedRawInvoice ret_hu_conv = new SignedRawInvoice(null, ret);
+ 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);
;
return ret_hu_conv;
*/
public Result_NoneSemanticErrorZ check_signature() {
long ret = bindings.Invoice_check_signature(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_InvoiceSemanticErrorZ ret_hu_conv = Result_InvoiceSemanticErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
@Nullable
public InvoiceFeatures features() {
long ret = bindings.Invoice_features(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- InvoiceFeatures ret_hu_conv = new InvoiceFeatures(null, ret);
+ 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);
return ret_hu_conv;
}
return ret;
}
+ /**
+ * Returns whether the invoice has expired.
+ */
+ public boolean is_expired() {
+ boolean ret = bindings.Invoice_is_expired(this.ptr);
+ return ret;
+ }
+
/**
* Returns the invoice's `min_final_cltv_expiry` time, if present, otherwise
* [`DEFAULT_MIN_FINAL_CLTV_EXPIRY`].
PrivateRoute[] ret_conv_14_arr = new PrivateRoute[ret.length];
for (int o = 0; o < ret.length; o++) {
long ret_conv_14 = ret[o];
- PrivateRoute ret_conv_14_hu_conv = new PrivateRoute(null, ret_conv_14);
+ PrivateRoute ret_conv_14_hu_conv = null; if (ret_conv_14 < 0 || ret_conv_14 > 4096) { ret_conv_14_hu_conv = new PrivateRoute(null, ret_conv_14); }
ret_conv_14_hu_conv.ptrs_to.add(this);
ret_conv_14_arr[o] = ret_conv_14_hu_conv;
}
RouteHint[] ret_conv_11_arr = new RouteHint[ret.length];
for (int l = 0; l < ret.length; l++) {
long ret_conv_11 = ret[l];
- RouteHint ret_conv_11_hu_conv = new RouteHint(null, ret_conv_11);
+ RouteHint ret_conv_11_hu_conv = null; if (ret_conv_11 < 0 || ret_conv_11 > 4096) { ret_conv_11_hu_conv = new RouteHint(null, ret_conv_11); }
ret_conv_11_hu_conv.ptrs_to.add(this);
ret_conv_11_arr[l] = ret_conv_11_hu_conv;
}
}
/**
- * Returns the amount if specified in the invoice as pico <currency>.
+ * Returns the amount if specified in the invoice as millisatoshis.
*/
- public Option_u64Z amount_pico_btc() {
- long ret = bindings.Invoice_amount_pico_btc(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ public Option_u64Z amount_milli_satoshis() {
+ long ret = bindings.Invoice_amount_milli_satoshis(this.ptr);
+ 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);
return ret_hu_conv;
*/
public static Result_InvoiceNoneZ from_str(java.lang.String s) {
long ret = bindings.Invoice_from_str(s);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_InvoiceNoneZ ret_hu_conv = Result_InvoiceNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public InvoiceFeatures clone() {
long ret = bindings.InvoiceFeatures_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- InvoiceFeatures ret_hu_conv = new InvoiceFeatures(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static InvoiceFeatures empty() {
long ret = bindings.InvoiceFeatures_empty();
- if (ret >= 0 && ret < 1024) { return null; }
- InvoiceFeatures ret_hu_conv = new InvoiceFeatures(null, ret);
+ 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(ret_hu_conv);
return ret_hu_conv;
}
*/
public static InvoiceFeatures known() {
long ret = bindings.InvoiceFeatures_known();
- if (ret >= 0 && ret < 1024) { return null; }
- InvoiceFeatures ret_hu_conv = new InvoiceFeatures(null, ret);
+ 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(ret_hu_conv);
return ret_hu_conv;
}
*/
public static Result_InvoiceFeaturesDecodeErrorZ read(byte[] ser) {
long ret = bindings.InvoiceFeatures_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_InvoiceFeaturesDecodeErrorZ ret_hu_conv = Result_InvoiceFeaturesDecodeErrorZ.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;
+
+
+/**
+ * A utility for paying [`Invoice]`s.
+ */
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class InvoicePayer extends CommonBase {
+ InvoicePayer(Object _dummy, long ptr) { super(ptr); }
+ @Override @SuppressWarnings("deprecation")
+ protected void finalize() throws Throwable {
+ super.finalize();
+ if (ptr != 0) { bindings.InvoicePayer_free(ptr); }
+ }
+
+ /**
+ * Creates an invoice payer that retries failed payment paths.
+ *
+ * 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) {
+ 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);
+ 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);
+ ret_hu_conv.ptrs_to.add(payer);
+ ret_hu_conv.ptrs_to.add(router);
+ ret_hu_conv.ptrs_to.add(scorer);
+ ret_hu_conv.ptrs_to.add(logger);
+ ret_hu_conv.ptrs_to.add(event_handler);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Pays the given [`Invoice`], caching it for later use in case a retry is needed.
+ *
+ * You should ensure that the `invoice.payment_hash()` is unique and the same payment_hash has
+ * never been paid before. Because [`InvoicePayer`] is stateless no effort is made to do so
+ * for you.
+ */
+ public Result_PaymentIdPaymentErrorZ pay_invoice(Invoice invoice) {
+ long ret = bindings.InvoicePayer_pay_invoice(this.ptr, invoice == null ? 0 : invoice.ptr & ~1);
+ 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 the given zero-value [`Invoice`] using the given amount, caching it for later use in
+ * case a retry is needed.
+ *
+ * You should ensure that the `invoice.payment_hash()` is unique and the same payment_hash has
+ * never been paid before. Because [`InvoicePayer`] is stateless no effort is made to do so
+ * for you.
+ */
+ 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);
+ 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;
+ }
+
+ /**
+ * Removes the payment cached by the given payment hash.
+ *
+ * Should be called once a payment has failed or succeeded if not using [`InvoicePayer`] as an
+ * [`EventHandler`]. Otherwise, calling this method is unnecessary.
+ */
+ public void remove_cached_payment(byte[] payment_hash) {
+ bindings.InvoicePayer_remove_cached_payment(this.ptr, payment_hash);
+ }
+
+ /**
+ * Constructs a new EventHandler which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned EventHandler must be freed before this_arg is
+ */
+ public EventHandler as_EventHandler() {
+ long ret = bindings.InvoicePayer_as_EventHandler(this.ptr);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ EventHandler ret_hu_conv = new EventHandler(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
+}
*/
public InvoiceSignature clone() {
long ret = bindings.InvoiceSignature_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- InvoiceSignature ret_hu_conv = new InvoiceSignature(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public ShutdownScript get_shutdown_scriptpubkey() {
long ret = bindings.KeysInterface_get_shutdown_scriptpubkey(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- ShutdownScript ret_hu_conv = new ShutdownScript(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public Sign get_channel_signer(boolean inbound, long channel_value_satoshis) {
long ret = bindings.KeysInterface_get_channel_signer(this.ptr, inbound, channel_value_satoshis);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Sign ret_hu_conv = new Sign(null, ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
public Result_SignDecodeErrorZ read_chan_signer(byte[] reader) {
long ret = bindings.KeysInterface_read_chan_signer(this.ptr, reader);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_RecoverableSignatureNoneZ ret_hu_conv = Result_RecoverableSignatureNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public static KeysManager of(byte[] seed, long starting_time_secs, int starting_time_nanos) {
long ret = bindings.KeysManager_new(seed, starting_time_secs, starting_time_nanos);
- if (ret >= 0 && ret < 1024) { return null; }
- KeysManager ret_hu_conv = new KeysManager(null, ret);
+ 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);
return 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, params);
- if (ret >= 0 && ret < 1024) { return null; }
- InMemorySigner ret_hu_conv = new InMemorySigner(null, ret);
+ 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);
return ret_hu_conv;
}
*/
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);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
KeysInterface ret_hu_conv = new KeysInterface(null, ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
public ErrorAction get_action() {
long ret = bindings.LightningError_get_action(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
ErrorAction ret_hu_conv = ErrorAction.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
public static LightningError of(java.lang.String err_arg, ErrorAction action_arg) {
long ret = bindings.LightningError_new(err_arg, action_arg.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- LightningError ret_hu_conv = new LightningError(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public LightningError clone() {
long ret = bindings.LightningError_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- LightningError ret_hu_conv = new LightningError(null, ret);
+ 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);
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;
+
+
+/**
+ * A scorer that is accessed under a lock.
+ *
+ * Needed so that calls to [`Score::channel_penalty_msat`] in [`find_route`] can be made while
+ * having shared ownership of a scorer but without requiring internal locking in [`Score`]
+ * implementations. Internal locking would be detrimental to route finding performance and could
+ * result in [`Score::channel_penalty_msat`] returning a different value for the same channel.
+ *
+ * [`find_route`]: crate::routing::router::find_route
+ */
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class LockableScore extends CommonBase {
+ LockableScore(Object _dummy, long ptr) { super(ptr); }
+ @Override @SuppressWarnings("deprecation")
+ protected void finalize() throws Throwable {
+ super.finalize();
+ if (ptr != 0) { bindings.LockableScore_free(ptr); }
+ }
+
+ /**
+ * Constructs a new LockableScore from a Score
+ */
+ public static LockableScore of(Score score) {
+ long ret = bindings.LockableScore_new(score == null ? 0 : score.ptr);
+ 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);
+ 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;
+ }
+
+}
*/
public ChannelMessageHandler get_chan_handler() {
long ret = bindings.MessageHandler_get_chan_handler(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
ChannelMessageHandler ret_hu_conv = new ChannelMessageHandler(null, ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
public RoutingMessageHandler get_route_handler() {
long ret = bindings.MessageHandler_get_route_handler(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
RoutingMessageHandler ret_hu_conv = new RoutingMessageHandler(null, ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
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);
- if (ret >= 0 && ret < 1024) { return null; }
- MessageHandler ret_hu_conv = new MessageHandler(null, ret);
+ 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);
ret_hu_conv.ptrs_to.add(chan_handler_arg);
ret_hu_conv.ptrs_to.add(route_handler_arg);
super(null, ptr);
this.node_id = obj.node_id;
long msg = obj.msg;
- AcceptChannel msg_hu_conv = new AcceptChannel(null, msg);
+ AcceptChannel msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new AcceptChannel(null, msg); }
msg_hu_conv.ptrs_to.add(this);
this.msg = msg_hu_conv;
}
super(null, ptr);
this.node_id = obj.node_id;
long msg = obj.msg;
- OpenChannel msg_hu_conv = new OpenChannel(null, msg);
+ OpenChannel msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new OpenChannel(null, msg); }
msg_hu_conv.ptrs_to.add(this);
this.msg = msg_hu_conv;
}
super(null, ptr);
this.node_id = obj.node_id;
long msg = obj.msg;
- FundingCreated msg_hu_conv = new FundingCreated(null, msg);
+ FundingCreated msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new FundingCreated(null, msg); }
msg_hu_conv.ptrs_to.add(this);
this.msg = msg_hu_conv;
}
super(null, ptr);
this.node_id = obj.node_id;
long msg = obj.msg;
- FundingSigned msg_hu_conv = new FundingSigned(null, msg);
+ FundingSigned msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new FundingSigned(null, msg); }
msg_hu_conv.ptrs_to.add(this);
this.msg = msg_hu_conv;
}
super(null, ptr);
this.node_id = obj.node_id;
long msg = obj.msg;
- FundingLocked msg_hu_conv = new FundingLocked(null, msg);
+ FundingLocked msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new FundingLocked(null, msg); }
msg_hu_conv.ptrs_to.add(this);
this.msg = msg_hu_conv;
}
super(null, ptr);
this.node_id = obj.node_id;
long msg = obj.msg;
- AnnouncementSignatures msg_hu_conv = new AnnouncementSignatures(null, msg);
+ AnnouncementSignatures msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new AnnouncementSignatures(null, msg); }
msg_hu_conv.ptrs_to.add(this);
this.msg = msg_hu_conv;
}
super(null, ptr);
this.node_id = obj.node_id;
long updates = obj.updates;
- CommitmentUpdate updates_hu_conv = new CommitmentUpdate(null, updates);
+ CommitmentUpdate updates_hu_conv = null; if (updates < 0 || updates > 4096) { updates_hu_conv = new CommitmentUpdate(null, updates); }
updates_hu_conv.ptrs_to.add(this);
this.updates = updates_hu_conv;
}
super(null, ptr);
this.node_id = obj.node_id;
long msg = obj.msg;
- RevokeAndACK msg_hu_conv = new RevokeAndACK(null, msg);
+ RevokeAndACK msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new RevokeAndACK(null, msg); }
msg_hu_conv.ptrs_to.add(this);
this.msg = msg_hu_conv;
}
super(null, ptr);
this.node_id = obj.node_id;
long msg = obj.msg;
- ClosingSigned msg_hu_conv = new ClosingSigned(null, msg);
+ ClosingSigned msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ClosingSigned(null, msg); }
msg_hu_conv.ptrs_to.add(this);
this.msg = msg_hu_conv;
}
super(null, ptr);
this.node_id = obj.node_id;
long msg = obj.msg;
- Shutdown msg_hu_conv = new Shutdown(null, msg);
+ Shutdown msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new Shutdown(null, msg); }
msg_hu_conv.ptrs_to.add(this);
this.msg = msg_hu_conv;
}
super(null, ptr);
this.node_id = obj.node_id;
long msg = obj.msg;
- ChannelReestablish msg_hu_conv = new ChannelReestablish(null, msg);
+ ChannelReestablish msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ChannelReestablish(null, msg); }
msg_hu_conv.ptrs_to.add(this);
this.msg = msg_hu_conv;
}
private BroadcastChannelAnnouncement(long ptr, bindings.LDKMessageSendEvent.BroadcastChannelAnnouncement obj) {
super(null, ptr);
long msg = obj.msg;
- ChannelAnnouncement msg_hu_conv = new ChannelAnnouncement(null, msg);
+ ChannelAnnouncement msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ChannelAnnouncement(null, msg); }
msg_hu_conv.ptrs_to.add(this);
this.msg = msg_hu_conv;
long update_msg = obj.update_msg;
- ChannelUpdate update_msg_hu_conv = new ChannelUpdate(null, update_msg);
+ ChannelUpdate update_msg_hu_conv = null; if (update_msg < 0 || update_msg > 4096) { update_msg_hu_conv = new ChannelUpdate(null, update_msg); }
update_msg_hu_conv.ptrs_to.add(this);
this.update_msg = update_msg_hu_conv;
}
private BroadcastNodeAnnouncement(long ptr, bindings.LDKMessageSendEvent.BroadcastNodeAnnouncement obj) {
super(null, ptr);
long msg = obj.msg;
- NodeAnnouncement msg_hu_conv = new NodeAnnouncement(null, msg);
+ NodeAnnouncement msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new NodeAnnouncement(null, msg); }
msg_hu_conv.ptrs_to.add(this);
this.msg = msg_hu_conv;
}
private BroadcastChannelUpdate(long ptr, bindings.LDKMessageSendEvent.BroadcastChannelUpdate obj) {
super(null, ptr);
long msg = obj.msg;
- ChannelUpdate msg_hu_conv = new ChannelUpdate(null, msg);
+ ChannelUpdate msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ChannelUpdate(null, msg); }
msg_hu_conv.ptrs_to.add(this);
this.msg = msg_hu_conv;
}
super(null, ptr);
this.node_id = obj.node_id;
long msg = obj.msg;
- ChannelUpdate msg_hu_conv = new ChannelUpdate(null, msg);
+ ChannelUpdate msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ChannelUpdate(null, msg); }
msg_hu_conv.ptrs_to.add(this);
this.msg = msg_hu_conv;
}
super(null, ptr);
this.node_id = obj.node_id;
long msg = obj.msg;
- QueryChannelRange msg_hu_conv = new QueryChannelRange(null, msg);
+ QueryChannelRange msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new QueryChannelRange(null, msg); }
msg_hu_conv.ptrs_to.add(this);
this.msg = msg_hu_conv;
}
super(null, ptr);
this.node_id = obj.node_id;
long msg = obj.msg;
- QueryShortChannelIds msg_hu_conv = new QueryShortChannelIds(null, msg);
+ QueryShortChannelIds msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new QueryShortChannelIds(null, msg); }
msg_hu_conv.ptrs_to.add(this);
this.msg = msg_hu_conv;
}
super(null, ptr);
this.node_id = obj.node_id;
long msg = obj.msg;
- ReplyChannelRange msg_hu_conv = new ReplyChannelRange(null, msg);
+ ReplyChannelRange msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ReplyChannelRange(null, msg); }
msg_hu_conv.ptrs_to.add(this);
this.msg = msg_hu_conv;
}
*/
public MessageSendEvent clone() {
long ret = bindings.MessageSendEvent_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
public static MessageSendEvent send_accept_channel(byte[] node_id, AcceptChannel msg) {
long ret = bindings.MessageSendEvent_send_accept_channel(node_id, msg == null ? 0 : msg.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public static MessageSendEvent send_open_channel(byte[] node_id, OpenChannel msg) {
long ret = bindings.MessageSendEvent_send_open_channel(node_id, msg == null ? 0 : msg.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public static MessageSendEvent send_funding_created(byte[] node_id, FundingCreated msg) {
long ret = bindings.MessageSendEvent_send_funding_created(node_id, msg == null ? 0 : msg.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public static MessageSendEvent send_funding_signed(byte[] node_id, FundingSigned msg) {
long ret = bindings.MessageSendEvent_send_funding_signed(node_id, msg == null ? 0 : msg.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public static MessageSendEvent send_funding_locked(byte[] node_id, FundingLocked msg) {
long ret = bindings.MessageSendEvent_send_funding_locked(node_id, msg == null ? 0 : msg.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public static MessageSendEvent send_announcement_signatures(byte[] node_id, AnnouncementSignatures msg) {
long ret = bindings.MessageSendEvent_send_announcement_signatures(node_id, msg == null ? 0 : msg.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public static MessageSendEvent update_htlcs(byte[] node_id, CommitmentUpdate updates) {
long ret = bindings.MessageSendEvent_update_htlcs(node_id, updates == null ? 0 : updates.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public static MessageSendEvent send_revoke_and_ack(byte[] node_id, RevokeAndACK msg) {
long ret = bindings.MessageSendEvent_send_revoke_and_ack(node_id, msg == null ? 0 : msg.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public static MessageSendEvent send_closing_signed(byte[] node_id, ClosingSigned msg) {
long ret = bindings.MessageSendEvent_send_closing_signed(node_id, msg == null ? 0 : msg.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public static MessageSendEvent send_shutdown(byte[] node_id, Shutdown msg) {
long ret = bindings.MessageSendEvent_send_shutdown(node_id, msg == null ? 0 : msg.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public static MessageSendEvent send_channel_reestablish(byte[] node_id, ChannelReestablish msg) {
long ret = bindings.MessageSendEvent_send_channel_reestablish(node_id, msg == null ? 0 : msg.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public static MessageSendEvent broadcast_node_announcement(NodeAnnouncement msg) {
long ret = bindings.MessageSendEvent_broadcast_node_announcement(msg == null ? 0 : msg.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public static MessageSendEvent broadcast_channel_update(ChannelUpdate msg) {
long ret = bindings.MessageSendEvent_broadcast_channel_update(msg == null ? 0 : msg.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public static MessageSendEvent send_channel_update(byte[] node_id, ChannelUpdate msg) {
long ret = bindings.MessageSendEvent_send_channel_update(node_id, msg == null ? 0 : msg.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public static MessageSendEvent handle_error(byte[] node_id, ErrorAction action) {
long ret = bindings.MessageSendEvent_handle_error(node_id, action.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public static MessageSendEvent send_channel_range_query(byte[] node_id, QueryChannelRange msg) {
long ret = bindings.MessageSendEvent_send_channel_range_query(node_id, msg == null ? 0 : msg.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public static MessageSendEvent send_short_ids_query(byte[] node_id, QueryShortChannelIds msg) {
long ret = bindings.MessageSendEvent_send_short_ids_query(node_id, msg == null ? 0 : msg.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public static MessageSendEvent send_reply_channel_range(byte[] node_id, ReplyChannelRange msg) {
long ret = bindings.MessageSendEvent_send_reply_channel_range(node_id, msg == null ? 0 : msg.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
if (ptr != 0) { bindings.MinFinalCltvExpiry_free(ptr); }
}
+ public long get_a() {
+ long ret = bindings.MinFinalCltvExpiry_get_a(this.ptr);
+ return ret;
+ }
+
+ public void set_a(long val) {
+ bindings.MinFinalCltvExpiry_set_a(this.ptr, val);
+ }
+
+ /**
+ * Constructs a new MinFinalCltvExpiry given each field
+ */
+ public static MinFinalCltvExpiry of(long a_arg) {
+ long ret = bindings.MinFinalCltvExpiry_new(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);
+ return ret_hu_conv;
+ }
+
/**
* Creates a copy of the MinFinalCltvExpiry
*/
public MinFinalCltvExpiry clone() {
long ret = bindings.MinFinalCltvExpiry_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- MinFinalCltvExpiry ret_hu_conv = new MinFinalCltvExpiry(null, ret);
+ 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);
return ret_hu_conv;
}
if (raw_val.getClass() == bindings.LDKMonitorEvent.CommitmentTxConfirmed.class) {
return new CommitmentTxConfirmed(ptr, (bindings.LDKMonitorEvent.CommitmentTxConfirmed)raw_val);
}
+ if (raw_val.getClass() == bindings.LDKMonitorEvent.UpdateCompleted.class) {
+ return new UpdateCompleted(ptr, (bindings.LDKMonitorEvent.UpdateCompleted)raw_val);
+ }
+ if (raw_val.getClass() == bindings.LDKMonitorEvent.UpdateFailed.class) {
+ return new UpdateFailed(ptr, (bindings.LDKMonitorEvent.UpdateFailed)raw_val);
+ }
assert false; return null; // Unreachable without extending the (internal) bindings interface
}
private HTLCEvent(long ptr, bindings.LDKMonitorEvent.HTLCEvent obj) {
super(null, ptr);
long htlc_event = obj.htlc_event;
- HTLCUpdate htlc_event_hu_conv = new HTLCUpdate(null, htlc_event);
+ HTLCUpdate htlc_event_hu_conv = null; if (htlc_event < 0 || htlc_event > 4096) { htlc_event_hu_conv = new HTLCUpdate(null, htlc_event); }
htlc_event_hu_conv.ptrs_to.add(this);
this.htlc_event = htlc_event_hu_conv;
}
private CommitmentTxConfirmed(long ptr, bindings.LDKMonitorEvent.CommitmentTxConfirmed obj) {
super(null, ptr);
long commitment_tx_confirmed = obj.commitment_tx_confirmed;
- OutPoint commitment_tx_confirmed_hu_conv = new OutPoint(null, commitment_tx_confirmed);
+ OutPoint commitment_tx_confirmed_hu_conv = null; if (commitment_tx_confirmed < 0 || commitment_tx_confirmed > 4096) { commitment_tx_confirmed_hu_conv = new OutPoint(null, commitment_tx_confirmed); }
commitment_tx_confirmed_hu_conv.ptrs_to.add(this);
this.commitment_tx_confirmed = commitment_tx_confirmed_hu_conv;
}
}
+ public final static class UpdateCompleted extends MonitorEvent {
+ /**
+ * The funding outpoint of the [`ChannelMonitor`] that was updated
+ */
+ public final OutPoint funding_txo;
+ /**
+ * The Update ID from [`ChannelMonitorUpdate::update_id`] which was applied or
+ * [`ChannelMonitor::get_latest_update_id`].
+ *
+ * Note that this should only be set to a given update's ID if all previous updates for the
+ * same [`ChannelMonitor`] have been applied and persisted.
+ */
+ public final long monitor_update_id;
+ private UpdateCompleted(long ptr, bindings.LDKMonitorEvent.UpdateCompleted obj) {
+ super(null, ptr);
+ long funding_txo = obj.funding_txo;
+ OutPoint funding_txo_hu_conv = null; if (funding_txo < 0 || funding_txo > 4096) { funding_txo_hu_conv = new OutPoint(null, funding_txo); }
+ funding_txo_hu_conv.ptrs_to.add(this);
+ this.funding_txo = funding_txo_hu_conv;
+ this.monitor_update_id = obj.monitor_update_id;
+ }
+ }
+ public final static class UpdateFailed extends MonitorEvent {
+ public final OutPoint update_failed;
+ private UpdateFailed(long ptr, bindings.LDKMonitorEvent.UpdateFailed obj) {
+ super(null, ptr);
+ long update_failed = obj.update_failed;
+ OutPoint update_failed_hu_conv = null; if (update_failed < 0 || update_failed > 4096) { update_failed_hu_conv = new OutPoint(null, update_failed); }
+ update_failed_hu_conv.ptrs_to.add(this);
+ this.update_failed = update_failed_hu_conv;
+ }
+ }
/**
* Creates a copy of the MonitorEvent
*/
public MonitorEvent clone() {
long ret = bindings.MonitorEvent_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
MonitorEvent ret_hu_conv = MonitorEvent.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
public static MonitorEvent htlcevent(HTLCUpdate a) {
long ret = bindings.MonitorEvent_htlcevent(a == null ? 0 : a.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public static MonitorEvent commitment_tx_confirmed(OutPoint a) {
long ret = bindings.MonitorEvent_commitment_tx_confirmed(a == null ? 0 : a.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Utility method to constructs a new UpdateCompleted-variant MonitorEvent
+ */
+ 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);
+ 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);
return ret_hu_conv;
}
+ /**
+ * Utility method to constructs a new UpdateFailed-variant MonitorEvent
+ */
+ public static MonitorEvent update_failed(OutPoint a) {
+ long ret = bindings.MonitorEvent_update_failed(a == null ? 0 : a.ptr & ~1);
+ 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);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Serialize the MonitorEvent object into a byte array which can be read by MonitorEvent_read
+ */
+ public byte[] write() {
+ byte[] ret = bindings.MonitorEvent_write(this.ptr);
+ return ret;
+ }
+
}
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;
+ }
+
/**
* Creates a copy of the MonitorUpdateError
*/
public MonitorUpdateError clone() {
long ret = bindings.MonitorUpdateError_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- MonitorUpdateError ret_hu_conv = new MonitorUpdateError(null, ret);
+ 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;
}
--- /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;
+
+
+/**
+ * An opaque identifier describing a specific [`Persist`] method call.
+ */
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class MonitorUpdateId extends CommonBase {
+ MonitorUpdateId(Object _dummy, long ptr) { super(ptr); }
+ @Override @SuppressWarnings("deprecation")
+ protected void finalize() throws Throwable {
+ super.finalize();
+ if (ptr != 0) { bindings.MonitorUpdateId_free(ptr); }
+ }
+
+ /**
+ * Creates a copy of the MonitorUpdateId
+ */
+ public MonitorUpdateId clone() {
+ long ret = bindings.MonitorUpdateId_clone(this.ptr);
+ 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);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Checks if two MonitorUpdateIds contain equal inner contents.
+ */
+ public long hash() {
+ long ret = bindings.MonitorUpdateId_hash(this.ptr);
+ return ret;
+ }
+
+ /**
+ * Checks if two MonitorUpdateIds 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(MonitorUpdateId b) {
+ boolean ret = bindings.MonitorUpdateId_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
+ this.ptrs_to.add(b);
+ return ret;
+ }
+
+}
*/
public NetAddress clone() {
long ret = bindings.NetAddress_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
NetAddress ret_hu_conv = NetAddress.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
public static NetAddress ipv4(byte[] addr, short port) {
long ret = bindings.NetAddress_ipv4(addr, port);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public static NetAddress ipv6(byte[] addr, short port) {
long ret = bindings.NetAddress_ipv6(addr, port);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public static NetAddress onion_v2(byte[] addr, short port) {
long ret = bindings.NetAddress_onion_v2(addr, port);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public static NetAddress onion_v3(byte[] ed25519_pubkey, short checksum, byte version, short port) {
long ret = bindings.NetAddress_onion_v3(ed25519_pubkey, checksum, version, port);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public static Result_NetAddressDecodeErrorZ read(byte[] ser) {
long ret = bindings.NetAddress_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NetAddressDecodeErrorZ ret_hu_conv = Result_NetAddressDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public EventHandler as_EventHandler() {
long ret = bindings.NetGraphMsgHandler_as_EventHandler(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
EventHandler ret_hu_conv = new EventHandler(null, ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
}
- /**
- * Representation of the payment channel network
- */
- public NetworkGraph get_network_graph() {
- long ret = bindings.NetGraphMsgHandler_get_network_graph(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- NetworkGraph ret_hu_conv = new NetworkGraph(null, ret);
- ret_hu_conv.ptrs_to.add(this);
- return ret_hu_conv;
- }
-
- /**
- * Representation of the payment channel network
- */
- public void set_network_graph(NetworkGraph val) {
- bindings.NetGraphMsgHandler_set_network_graph(this.ptr, val == null ? 0 : val.ptr & ~1);
- }
-
/**
* Creates a new tracker of the actual state of the network of channels and nodes,
* assuming an existing Network Graph.
*/
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);
- if (ret >= 0 && ret < 1024) { return null; }
- NetGraphMsgHandler ret_hu_conv = new NetGraphMsgHandler(null, ret);
+ 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);
+ ret_hu_conv.ptrs_to.add(network_graph);
ret_hu_conv.ptrs_to.add(logger);
return ret_hu_conv;
}
*/
public RoutingMessageHandler as_RoutingMessageHandler() {
long ret = bindings.NetGraphMsgHandler_as_RoutingMessageHandler(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
RoutingMessageHandler ret_hu_conv = new RoutingMessageHandler(null, ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
public MessageSendEventsProvider as_MessageSendEventsProvider() {
long ret = bindings.NetGraphMsgHandler_as_MessageSendEventsProvider(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
MessageSendEventsProvider ret_hu_conv = new MessageSendEventsProvider(null, ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
public NetworkGraph clone() {
long ret = bindings.NetworkGraph_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- NetworkGraph ret_hu_conv = new NetworkGraph(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_NetworkGraphDecodeErrorZ read(byte[] ser) {
long ret = bindings.NetworkGraph_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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(genesis_hash);
- if (ret >= 0 && ret < 1024) { return null; }
- NetworkGraph ret_hu_conv = new NetworkGraph(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public ReadOnlyNetworkGraph read_only() {
long ret = bindings.NetworkGraph_read_only(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- ReadOnlyNetworkGraph ret_hu_conv = new ReadOnlyNetworkGraph(null, ret);
+ 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);
return ret_hu_conv;
}
*/
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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret);
this.ptrs_to.add(msg);
return ret_hu_conv;
*/
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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret);
this.ptrs_to.add(msg);
return ret_hu_conv;
*/
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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret);
this.ptrs_to.add(msg);
return ret_hu_conv;
*/
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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret);
this.ptrs_to.add(msg);
return ret_hu_conv;
*/
public Result_NoneLightningErrorZ update_channel(ChannelUpdate msg) {
long ret = bindings.NetworkGraph_update_channel(this.ptr, msg == null ? 0 : msg.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret);
this.ptrs_to.add(msg);
return ret_hu_conv;
*/
public Result_NoneLightningErrorZ update_channel_unsigned(UnsignedChannelUpdate msg) {
long ret = bindings.NetworkGraph_update_channel_unsigned(this.ptr, msg == null ? 0 : msg.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret);
this.ptrs_to.add(msg);
return ret_hu_conv;
private ChannelUpdateMessage(long ptr, bindings.LDKNetworkUpdate.ChannelUpdateMessage obj) {
super(null, ptr);
long msg = obj.msg;
- ChannelUpdate msg_hu_conv = new ChannelUpdate(null, msg);
+ ChannelUpdate msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ChannelUpdate(null, msg); }
msg_hu_conv.ptrs_to.add(this);
this.msg = msg_hu_conv;
}
*/
public NetworkUpdate clone() {
long ret = bindings.NetworkUpdate_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
NetworkUpdate ret_hu_conv = NetworkUpdate.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
public static NetworkUpdate channel_update_message(ChannelUpdate msg) {
long ret = bindings.NetworkUpdate_channel_update_message(msg == null ? 0 : msg.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public static NetworkUpdate node_failure(byte[] node_id, boolean is_permanent) {
long ret = bindings.NetworkUpdate_node_failure(node_id, is_permanent);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public UnsignedNodeAnnouncement get_contents() {
long ret = bindings.NodeAnnouncement_get_contents(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- UnsignedNodeAnnouncement ret_hu_conv = new UnsignedNodeAnnouncement(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static NodeAnnouncement of(byte[] signature_arg, UnsignedNodeAnnouncement contents_arg) {
long ret = bindings.NodeAnnouncement_new(signature_arg, contents_arg == null ? 0 : contents_arg.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
- NodeAnnouncement ret_hu_conv = new NodeAnnouncement(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public NodeAnnouncement clone() {
long ret = bindings.NodeAnnouncement_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- NodeAnnouncement ret_hu_conv = new NodeAnnouncement(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_NodeAnnouncementDecodeErrorZ read(byte[] ser) {
long ret = bindings.NodeAnnouncement_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NodeAnnouncementDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public NodeFeatures get_features() {
long ret = bindings.NodeAnnouncementInfo_get_features(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- NodeFeatures ret_hu_conv = new NodeFeatures(null, ret);
+ 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);
return ret_hu_conv;
}
@Nullable
public NodeAnnouncement get_announcement_message() {
long ret = bindings.NodeAnnouncementInfo_get_announcement_message(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- NodeAnnouncement ret_hu_conv = new NodeAnnouncement(null, ret);
+ 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);
return ret_hu_conv;
}
*/
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, rgb_arg, alias_arg, 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);
- if (ret >= 0 && ret < 1024) { return null; }
- NodeAnnouncementInfo ret_hu_conv = new NodeAnnouncementInfo(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public NodeAnnouncementInfo clone() {
long ret = bindings.NodeAnnouncementInfo_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- NodeAnnouncementInfo ret_hu_conv = new NodeAnnouncementInfo(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_NodeAnnouncementInfoDecodeErrorZ read(byte[] ser) {
long ret = bindings.NodeAnnouncementInfo_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NodeAnnouncementInfoDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementInfoDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public NodeFeatures clone() {
long ret = bindings.NodeFeatures_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- NodeFeatures ret_hu_conv = new NodeFeatures(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static NodeFeatures empty() {
long ret = bindings.NodeFeatures_empty();
- if (ret >= 0 && ret < 1024) { return null; }
- NodeFeatures ret_hu_conv = new NodeFeatures(null, ret);
+ 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(ret_hu_conv);
return ret_hu_conv;
}
*/
public static NodeFeatures known() {
long ret = bindings.NodeFeatures_known();
- if (ret >= 0 && ret < 1024) { return null; }
- NodeFeatures ret_hu_conv = new NodeFeatures(null, ret);
+ 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(ret_hu_conv);
return ret_hu_conv;
}
*/
public static Result_NodeFeaturesDecodeErrorZ read(byte[] ser) {
long ret = bindings.NodeFeatures_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NodeFeaturesDecodeErrorZ ret_hu_conv = Result_NodeFeaturesDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public NodeId clone() {
long ret = bindings.NodeId_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- NodeId ret_hu_conv = new NodeId(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static NodeId from_pubkey(byte[] pubkey) {
long ret = bindings.NodeId_from_pubkey(pubkey);
- if (ret >= 0 && ret < 1024) { return null; }
- NodeId ret_hu_conv = new NodeId(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_NodeIdDecodeErrorZ read(byte[] ser) {
long ret = bindings.NodeId_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NodeIdDecodeErrorZ ret_hu_conv = Result_NodeIdDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
@Nullable
public RoutingFees get_lowest_inbound_channel_fees() {
long ret = bindings.NodeInfo_get_lowest_inbound_channel_fees(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- RoutingFees ret_hu_conv = new RoutingFees(null, ret);
+ 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);
return ret_hu_conv;
}
@Nullable
public NodeAnnouncementInfo get_announcement_info() {
long ret = bindings.NodeInfo_get_announcement_info(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- NodeAnnouncementInfo ret_hu_conv = new NodeAnnouncementInfo(null, ret);
+ 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);
return ret_hu_conv;
}
*/
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);
- if (ret >= 0 && ret < 1024) { return null; }
- NodeInfo ret_hu_conv = new NodeInfo(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public NodeInfo clone() {
long ret = bindings.NodeInfo_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- NodeInfo ret_hu_conv = new NodeInfo(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_NodeInfoDecodeErrorZ read(byte[] ser) {
long ret = bindings.NodeInfo_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NodeInfoDecodeErrorZ ret_hu_conv = Result_NodeInfoDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public OpenChannel clone() {
long ret = bindings.OpenChannel_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- OpenChannel ret_hu_conv = new OpenChannel(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_OpenChannelDecodeErrorZ read(byte[] ser) {
long ret = bindings.OpenChannel_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_OpenChannelDecodeErrorZ ret_hu_conv = Result_OpenChannelDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public static Option_AccessZ some(Access o) {
long ret = bindings.COption_AccessZ_some(o == null ? 0 : o.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
ret_hu_conv.ptrs_to.add(o);
*/
public static Option_AccessZ none() {
long ret = bindings.COption_AccessZ_none();
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public static Option_C2Tuple_usizeTransactionZZ some(TwoTuple_usizeTransactionZ o) {
long ret = bindings.COption_C2Tuple_usizeTransactionZZ_some(o != null ? o.ptr : 0);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public static Option_C2Tuple_usizeTransactionZZ none() {
long ret = bindings.COption_C2Tuple_usizeTransactionZZ_none();
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public Option_C2Tuple_usizeTransactionZZ clone() {
long ret = bindings.COption_C2Tuple_usizeTransactionZZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
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);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public static Option_CVec_NetAddressZZ none() {
long ret = bindings.COption_CVec_NetAddressZZ_none();
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public Option_CVec_NetAddressZZ clone() {
long ret = bindings.COption_CVec_NetAddressZZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public static Option_FilterZ some(Filter o) {
long ret = bindings.COption_FilterZ_some(o == null ? 0 : o.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
ret_hu_conv.ptrs_to.add(o);
*/
public static Option_FilterZ none() {
long ret = bindings.COption_FilterZ_none();
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public static Option_NetworkUpdateZ some(NetworkUpdate o) {
long ret = bindings.COption_NetworkUpdateZ_some(o.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public static Option_NetworkUpdateZ none() {
long ret = bindings.COption_NetworkUpdateZ_none();
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public Option_NetworkUpdateZ clone() {
long ret = bindings.COption_NetworkUpdateZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public static Option_TypeZ some(Type o) {
long ret = bindings.COption_TypeZ_some(o == null ? 0 : o.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
ret_hu_conv.ptrs_to.add(o);
*/
public static Option_TypeZ none() {
long ret = bindings.COption_TypeZ_none();
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public Option_TypeZ clone() {
long ret = bindings.COption_TypeZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public static Option_u16Z some(short o) {
long ret = bindings.COption_u16Z_some(o);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public static Option_u16Z none() {
long ret = bindings.COption_u16Z_none();
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public Option_u16Z clone() {
long ret = bindings.COption_u16Z_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public static Option_u32Z some(int o) {
long ret = bindings.COption_u32Z_some(o);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public static Option_u32Z none() {
long ret = bindings.COption_u32Z_none();
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public Option_u32Z clone() {
long ret = bindings.COption_u32Z_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public static Option_u64Z some(long o) {
long ret = bindings.COption_u64Z_some(o);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public static Option_u64Z none() {
long ret = bindings.COption_u64Z_none();
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public Option_u64Z clone() {
long ret = bindings.COption_u64Z_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public static OutPoint of(byte[] txid_arg, short index_arg) {
long ret = bindings.OutPoint_new(txid_arg, index_arg);
- if (ret >= 0 && ret < 1024) { return null; }
- OutPoint ret_hu_conv = new OutPoint(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public OutPoint clone() {
long ret = bindings.OutPoint_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- OutPoint ret_hu_conv = new OutPoint(null, ret);
+ 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;
}
*/
public static Result_OutPointDecodeErrorZ read(byte[] ser) {
long ret = bindings.OutPoint_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_OutPointDecodeErrorZ ret_hu_conv = Result_OutPointDecodeErrorZ.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;
+
+
+/**
+ * The recipient of a payment.
+ */
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class Payee extends CommonBase {
+ Payee(Object _dummy, long ptr) { super(ptr); }
+ @Override @SuppressWarnings("deprecation")
+ protected void finalize() throws Throwable {
+ super.finalize();
+ if (ptr != 0) { bindings.Payee_free(ptr); }
+ }
+
+ /**
+ * The node id of the payee.
+ */
+ public byte[] get_pubkey() {
+ byte[] ret = bindings.Payee_get_pubkey(this.ptr);
+ return ret;
+ }
+
+ /**
+ * The node id of the payee.
+ */
+ public void set_pubkey(byte[] val) {
+ bindings.Payee_set_pubkey(this.ptr, val);
+ }
+
+ /**
+ * Features supported by the payee.
+ *
+ * May be set from the payee's invoice or via [`for_keysend`]. May be `None` if the invoice
+ * does not contain any features.
+ *
+ * [`for_keysend`]: Self::for_keysend
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ @Nullable
+ public InvoiceFeatures get_features() {
+ long ret = bindings.Payee_get_features(this.ptr);
+ 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);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Features supported by the payee.
+ *
+ * May be set from the payee's invoice or via [`for_keysend`]. May be `None` if the invoice
+ * does not contain any features.
+ *
+ * [`for_keysend`]: Self::for_keysend
+ *
+ * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ public void set_features(@Nullable InvoiceFeatures val) {
+ bindings.Payee_set_features(this.ptr, val == null ? 0 : val.ptr & ~1);
+ }
+
+ /**
+ * Hints for routing to the payee, containing channels connecting the payee to public nodes.
+ */
+ public RouteHint[] get_route_hints() {
+ long[] ret = bindings.Payee_get_route_hints(this.ptr);
+ RouteHint[] ret_conv_11_arr = new RouteHint[ret.length];
+ for (int l = 0; l < ret.length; l++) {
+ long ret_conv_11 = ret[l];
+ RouteHint ret_conv_11_hu_conv = null; if (ret_conv_11 < 0 || ret_conv_11 > 4096) { ret_conv_11_hu_conv = new RouteHint(null, ret_conv_11); }
+ ret_conv_11_hu_conv.ptrs_to.add(this);
+ ret_conv_11_arr[l] = ret_conv_11_hu_conv;
+ }
+ return ret_conv_11_arr;
+ }
+
+ /**
+ * Hints for routing to the payee, containing channels connecting the payee to public nodes.
+ */
+ 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);
+ }
+
+ /**
+ * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
+ */
+ public Option_u64Z get_expiry_time() {
+ long ret = bindings.Payee_get_expiry_time(this.ptr);
+ 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);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
+ */
+ public void set_expiry_time(Option_u64Z val) {
+ bindings.Payee_set_expiry_time(this.ptr, val.ptr);
+ }
+
+ /**
+ * Constructs a new Payee given each field
+ */
+ public static Payee of(byte[] pubkey_arg, InvoiceFeatures features_arg, RouteHint[] route_hints_arg, Option_u64Z expiry_time_arg) {
+ long ret = bindings.Payee_new(pubkey_arg, 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);
+ 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);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Creates a copy of the Payee
+ */
+ public Payee clone() {
+ long ret = bindings.Payee_clone(this.ptr);
+ 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);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Checks if two Payees contain equal inner contents.
+ */
+ public long hash() {
+ long ret = bindings.Payee_hash(this.ptr);
+ return ret;
+ }
+
+ /**
+ * Checks if two Payees 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(Payee b) {
+ boolean ret = bindings.Payee_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
+ this.ptrs_to.add(b);
+ return ret;
+ }
+
+ /**
+ * 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);
+ return ret;
+ }
+
+ /**
+ * Read a Payee from a byte array, created by Payee_write
+ */
+ public static Result_PayeeDecodeErrorZ read(byte[] ser) {
+ long ret = bindings.Payee_read(ser);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_PayeeDecodeErrorZ ret_hu_conv = Result_PayeeDecodeErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Creates a payee with the node id of the given `pubkey`.
+ */
+ public static Payee from_node_id(byte[] pubkey) {
+ long ret = bindings.Payee_from_node_id(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);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Creates a payee with the node id of the given `pubkey` to use for keysend payments.
+ */
+ public static Payee for_keysend(byte[] pubkey) {
+ long ret = bindings.Payee_for_keysend(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);
+ return ret_hu_conv;
+ }
+
+}
if (ptr != 0) { bindings.PayeePubKey_free(ptr); }
}
+ public byte[] get_a() {
+ byte[] ret = bindings.PayeePubKey_get_a(this.ptr);
+ return ret;
+ }
+
+ public void set_a(byte[] val) {
+ bindings.PayeePubKey_set_a(this.ptr, val);
+ }
+
+ /**
+ * Constructs a new PayeePubKey given each field
+ */
+ public static PayeePubKey of(byte[] a_arg) {
+ long ret = bindings.PayeePubKey_new(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);
+ return ret_hu_conv;
+ }
+
/**
* Creates a copy of the PayeePubKey
*/
public PayeePubKey clone() {
long ret = bindings.PayeePubKey_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- PayeePubKey ret_hu_conv = new PayeePubKey(null, ret);
+ 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);
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;
+
+/**
+ * A trait defining behavior of an [`Invoice`] payer.
+ */
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class Payer extends CommonBase {
+ final bindings.LDKPayer bindings_instance;
+ Payer(Object _dummy, long ptr) { super(ptr); bindings_instance = null; }
+ private Payer(bindings.LDKPayer arg) {
+ super(bindings.LDKPayer_new(arg));
+ this.ptrs_to.add(arg);
+ this.bindings_instance = arg;
+ }
+ @Override @SuppressWarnings("deprecation")
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.Payer_free(ptr); } super.finalize();
+ }
+
+ public static interface PayerInterface {
+ /**
+ * Returns the payer's node id.
+ */
+ byte[] node_id();
+ /**
+ * Returns the payer's channels.
+ */
+ ChannelDetails[] first_hops();
+ /**
+ * Sends a payment over the Lightning Network using the given [`Route`].
+ *
+ * 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);
+ /**
+ * Retries a failed payment path for the [`PaymentId`] using the given [`Route`].
+ */
+ Result_NonePaymentSendFailureZ retry_payment(Route route, byte[] payment_id);
+ }
+ private static class LDKPayerHolder { Payer held; }
+ public static Payer new_impl(PayerInterface arg) {
+ final LDKPayerHolder impl_holder = new LDKPayerHolder();
+ impl_holder.held = new Payer(new bindings.LDKPayer() {
+ @Override public byte[] node_id() {
+ byte[] ret = arg.node_id();
+ return ret;
+ }
+ @Override public long[] first_hops() {
+ ChannelDetails[] ret = arg.first_hops();
+ long[] result = ret != null ? Arrays.stream(ret).mapToLong(ret_conv_16 -> ret_conv_16 == null ? 0 : ret_conv_16.ptr & ~1).toArray() : null;
+ return result;
+ }
+ @Override public long send_payment(long route, byte[] payment_hash, byte[] payment_secret) {
+ Route route_hu_conv = null; if (route < 0 || route > 4096) { route_hu_conv = new Route(null, route); }
+ Result_PaymentIdPaymentSendFailureZ ret = arg.send_payment(route_hu_conv, payment_hash, payment_secret);
+ long result = ret != null ? ret.ptr : 0;
+ 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 ? ret.ptr : 0;
+ return result;
+ }
+ });
+ return impl_holder.held;
+ }
+ /**
+ * Returns the payer's node id.
+ */
+ public byte[] node_id() {
+ byte[] ret = bindings.Payer_node_id(this.ptr);
+ return ret;
+ }
+
+ /**
+ * Returns the payer's channels.
+ */
+ public ChannelDetails[] first_hops() {
+ long[] ret = bindings.Payer_first_hops(this.ptr);
+ ChannelDetails[] ret_conv_16_arr = new ChannelDetails[ret.length];
+ for (int q = 0; q < ret.length; q++) {
+ long ret_conv_16 = ret[q];
+ ChannelDetails ret_conv_16_hu_conv = null; if (ret_conv_16 < 0 || ret_conv_16 > 4096) { ret_conv_16_hu_conv = new ChannelDetails(null, ret_conv_16); }
+ ret_conv_16_hu_conv.ptrs_to.add(this);
+ ret_conv_16_arr[q] = ret_conv_16_hu_conv;
+ }
+ return ret_conv_16_arr;
+ }
+
+ /**
+ * Sends a payment over the Lightning Network using the given [`Route`].
+ *
+ * Note that payment_secret (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ 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, payment_hash, 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;
+ }
+
+ /**
+ * Retries a failed payment path for the [`PaymentId`] using the given [`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, 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;
+ }
+
+}
--- /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;
+
+
+/**
+ * An error that may occur when making a payment.
+ */
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class PaymentError extends CommonBase {
+ private PaymentError(Object _dummy, long ptr) { super(ptr); }
+ @Override @SuppressWarnings("deprecation")
+ protected void finalize() throws Throwable {
+ super.finalize();
+ if (ptr != 0) { bindings.PaymentError_free(ptr); }
+ }
+ static PaymentError constr_from_ptr(long ptr) {
+ bindings.LDKPaymentError raw_val = bindings.LDKPaymentError_ref_from_ptr(ptr);
+ if (raw_val.getClass() == bindings.LDKPaymentError.Invoice.class) {
+ return new Invoice(ptr, (bindings.LDKPaymentError.Invoice)raw_val);
+ }
+ if (raw_val.getClass() == bindings.LDKPaymentError.Routing.class) {
+ return new Routing(ptr, (bindings.LDKPaymentError.Routing)raw_val);
+ }
+ if (raw_val.getClass() == bindings.LDKPaymentError.Sending.class) {
+ return new Sending(ptr, (bindings.LDKPaymentError.Sending)raw_val);
+ }
+ assert false; return null; // Unreachable without extending the (internal) bindings interface
+ }
+
+ public final static class Invoice extends PaymentError {
+ public final String invoice;
+ private Invoice(long ptr, bindings.LDKPaymentError.Invoice obj) {
+ super(null, ptr);
+ this.invoice = obj.invoice;
+ }
+ }
+ public final static class Routing extends PaymentError {
+ public final LightningError routing;
+ private Routing(long ptr, bindings.LDKPaymentError.Routing obj) {
+ super(null, ptr);
+ long routing = obj.routing;
+ LightningError routing_hu_conv = null; if (routing < 0 || routing > 4096) { routing_hu_conv = new LightningError(null, routing); }
+ routing_hu_conv.ptrs_to.add(this);
+ this.routing = routing_hu_conv;
+ }
+ }
+ public final static class Sending extends PaymentError {
+ public final PaymentSendFailure sending;
+ private Sending(long ptr, bindings.LDKPaymentError.Sending obj) {
+ super(null, ptr);
+ long sending = obj.sending;
+ PaymentSendFailure sending_hu_conv = PaymentSendFailure.constr_from_ptr(sending);
+ sending_hu_conv.ptrs_to.add(this);
+ this.sending = sending_hu_conv;
+ }
+ }
+ /**
+ * Creates a copy of the PaymentError
+ */
+ public PaymentError clone() {
+ long ret = bindings.PaymentError_clone(this.ptr);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ PaymentError ret_hu_conv = PaymentError.constr_from_ptr(ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Utility method to constructs a new Invoice-variant PaymentError
+ */
+ public static PaymentError invoice(java.lang.String a) {
+ long ret = bindings.PaymentError_invoice(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);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Utility method to constructs a new Routing-variant PaymentError
+ */
+ public static PaymentError routing(LightningError a) {
+ long ret = bindings.PaymentError_routing(a == null ? 0 : a.ptr & ~1);
+ 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);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Utility method to constructs a new Sending-variant PaymentError
+ */
+ public static PaymentError sending(PaymentSendFailure a) {
+ long ret = bindings.PaymentError_sending(a.ptr);
+ 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);
+ 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;
-
-
-/**
- * A payment identifier used to uniquely identify a payment to LDK.
- */
-@SuppressWarnings("unchecked") // We correctly assign various generic arrays
-public class PaymentId extends CommonBase {
- PaymentId(Object _dummy, long ptr) { super(ptr); }
- @Override @SuppressWarnings("deprecation")
- protected void finalize() throws Throwable {
- super.finalize();
- if (ptr != 0) { bindings.PaymentId_free(ptr); }
- }
-
- /**
- * Checks if two PaymentIds contain equal inner contents.
- */
- public long hash() {
- long ret = bindings.PaymentId_hash(this.ptr);
- return ret;
- }
-
- /**
- * Creates a copy of the PaymentId
- */
- public PaymentId clone() {
- long ret = bindings.PaymentId_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- PaymentId ret_hu_conv = new PaymentId(null, ret);
- ret_hu_conv.ptrs_to.add(this);
- return ret_hu_conv;
- }
-
- /**
- * Checks if two PaymentIds 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(PaymentId b) {
- boolean ret = bindings.PaymentId_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
- this.ptrs_to.add(b);
- return ret;
- }
-
- /**
- * Serialize the PaymentId object into a byte array which can be read by PaymentId_read
- */
- public byte[] write() {
- byte[] ret = bindings.PaymentId_write(this.ptr);
- return ret;
- }
-
- /**
- * Read a PaymentId from a byte array, created by PaymentId_write
- */
- public static Result_PaymentIdDecodeErrorZ read(byte[] ser) {
- long ret = bindings.PaymentId_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
- Result_PaymentIdDecodeErrorZ ret_hu_conv = Result_PaymentIdDecodeErrorZ.constr_from_ptr(ret);
- return ret_hu_conv;
- }
-
-}
*/
public PaymentPurpose clone() {
long ret = bindings.PaymentPurpose_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
PaymentPurpose ret_hu_conv = PaymentPurpose.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
public static PaymentPurpose invoice_payment(byte[] payment_preimage, byte[] payment_secret, long user_payment_id) {
long ret = bindings.PaymentPurpose_invoice_payment(payment_preimage, payment_secret, user_payment_id);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public static PaymentPurpose spontaneous_payment(byte[] a) {
long ret = bindings.PaymentPurpose_spontaneous_payment(a);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
}
}
public final static class PartialFailure extends PaymentSendFailure {
- public final Result_NoneAPIErrorZ[] partial_failure;
+ /**
+ * The errors themselves, in the same order as the route hops.
+ */
+ public final Result_NoneAPIErrorZ[] results;
+ /**
+ * If some paths failed without irrevocably committing to the new HTLC(s), this will
+ * contain a [`RouteParameters`] object which can be used to calculate a new route that
+ * will pay all remaining unpaid balance.
+ *
+ * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ @Nullable public final RouteParameters failed_paths_retry;
+ /**
+ * The payment id for the payment, which is now at least partially pending.
+ */
+ public final byte[] payment_id;
private PartialFailure(long ptr, bindings.LDKPaymentSendFailure.PartialFailure obj) {
super(null, ptr);
- long[] partial_failure = obj.partial_failure;
- Result_NoneAPIErrorZ[] partial_failure_conv_22_arr = new Result_NoneAPIErrorZ[partial_failure.length];
- for (int w = 0; w < partial_failure.length; w++) {
- long partial_failure_conv_22 = partial_failure[w];
- Result_NoneAPIErrorZ partial_failure_conv_22_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(partial_failure_conv_22);
- partial_failure_conv_22_arr[w] = partial_failure_conv_22_hu_conv;
+ long[] results = obj.results;
+ Result_NoneAPIErrorZ[] results_conv_22_arr = new Result_NoneAPIErrorZ[results.length];
+ for (int w = 0; w < results.length; w++) {
+ long results_conv_22 = results[w];
+ Result_NoneAPIErrorZ results_conv_22_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(results_conv_22);
+ results_conv_22_arr[w] = results_conv_22_hu_conv;
}
- this.partial_failure = partial_failure_conv_22_arr;
+ this.results = results_conv_22_arr;
+ long failed_paths_retry = obj.failed_paths_retry;
+ RouteParameters failed_paths_retry_hu_conv = null; if (failed_paths_retry < 0 || failed_paths_retry > 4096) { failed_paths_retry_hu_conv = new RouteParameters(null, failed_paths_retry); }
+ failed_paths_retry_hu_conv.ptrs_to.add(this);
+ this.failed_paths_retry = failed_paths_retry_hu_conv;
+ this.payment_id = obj.payment_id;
}
}
/**
*/
public PaymentSendFailure clone() {
long ret = bindings.PaymentSendFailure_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
PaymentSendFailure ret_hu_conv = PaymentSendFailure.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
public static PaymentSendFailure parameter_error(APIError a) {
long ret = bindings.PaymentSendFailure_parameter_error(a.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
/**
* Utility method to constructs a new PartialFailure-variant PaymentSendFailure
*/
- public static PaymentSendFailure partial_failure(Result_NoneAPIErrorZ[] a) {
- long ret = bindings.PaymentSendFailure_partial_failure(a != null ? Arrays.stream(a).mapToLong(a_conv_22 -> a_conv_22 != null ? a_conv_22.ptr : 0).toArray() : null);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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, 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);
return ret_hu_conv;
*/
public static PeerHandleError of(boolean no_connection_possible_arg) {
long ret = bindings.PeerHandleError_new(no_connection_possible_arg);
- if (ret >= 0 && ret < 1024) { return null; }
- PeerHandleError ret_hu_conv = new PeerHandleError(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public PeerHandleError clone() {
long ret = bindings.PeerHandleError_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- PeerHandleError ret_hu_conv = new PeerHandleError(null, ret);
+ 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);
return ret_hu_conv;
}
*/
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), our_node_secret, ephemeral_random_data, logger == null ? 0 : logger.ptr, custom_message_handler == null ? 0 : custom_message_handler.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- PeerManager ret_hu_conv = new PeerManager(null, ret);
+ 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);
ret_hu_conv.ptrs_to.add(message_handler_chan_handler_arg);
ret_hu_conv.ptrs_to.add(message_handler_route_handler_arg);
*/
public Result_CVec_u8ZPeerHandleErrorZ new_outbound_connection(byte[] their_node_id, SocketDescriptor descriptor) {
long ret = bindings.PeerManager_new_outbound_connection(this.ptr, their_node_id, descriptor == null ? 0 : descriptor.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public Result_NonePeerHandleErrorZ new_inbound_connection(SocketDescriptor descriptor) {
long ret = bindings.PeerManager_new_inbound_connection(this.ptr, descriptor == null ? 0 : descriptor.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NonePeerHandleErrorZ ret_hu_conv = Result_NonePeerHandleErrorZ.constr_from_ptr(ret);
this.ptrs_to.add(descriptor);
return ret_hu_conv;
*/
public Result_NonePeerHandleErrorZ write_buffer_space_avail(SocketDescriptor descriptor) {
long ret = bindings.PeerManager_write_buffer_space_avail(this.ptr, descriptor == null ? 0 : descriptor.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_boolPeerHandleErrorZ ret_hu_conv = Result_boolPeerHandleErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
bindings.PeerManager_disconnect_by_node_id(this.ptr, node_id, no_connection_possible);
}
+ /**
+ * Disconnects all currently-connected peers. This is useful on platforms where there may be
+ * an indication that TCP sockets have stalled even if we weren't around to time them out
+ * using regular ping/pongs.
+ */
+ public void disconnect_all_peers() {
+ bindings.PeerManager_disconnect_all_peers(this.ptr);
+ }
+
/**
* Send pings to each peer and disconnect those which did not respond to the last round of
* pings.
* `Persist` defines behavior for persisting channel monitors: this could mean
* writing once to disk, and/or uploading to one or more backup services.
*
- * Note that for every new monitor, you **must** persist the new `ChannelMonitor`
- * to disk/backups. And, on every update, you **must** persist either the
- * `ChannelMonitorUpdate` or the updated monitor itself. Otherwise, there is risk
- * of situations such as revoking a transaction, then crashing before this
- * revocation can be persisted, then unintentionally broadcasting a revoked
- * transaction and losing money. This is a risk because previous channel states
- * are toxic, so it's important that whatever channel state is persisted is
- * kept up-to-date.
+ * Each method can return three possible values:
+ * If persistence (including any relevant `fsync()` calls) happens immediately, the
+ * implementation should return `Ok(())`, indicating normal channel operation should continue.
+ * If persistence happens asynchronously, implementations should first ensure the
+ * [`ChannelMonitor`] or [`ChannelMonitorUpdate`] are written durably to disk, and then return
+ * `Err(ChannelMonitorUpdateErr::TemporaryFailure)` while the update continues in the
+ * background. Once the update completes, [`ChainMonitor::channel_monitor_updated`] should be
+ * called with the corresponding [`MonitorUpdateId`].
+ *
+ * Note that unlike the direct [`chain::Watch`] interface,
+ * [`ChainMonitor::channel_monitor_updated`] must be called once for *each* update which occurs.
+ *
+ * If persistence fails for some reason, implementations should return
+ * `Err(ChannelMonitorUpdateErr::PermanentFailure)`, in which case the channel will likely be
+ * closed without broadcasting the latest state. See
+ * [`ChannelMonitorUpdateErr::PermanentFailure`] for more details.
*/
@SuppressWarnings("unchecked") // We correctly assign various generic arrays
public class Persist extends CommonBase {
public static interface PersistInterface {
/**
- * Persist a new channel's data. The data can be stored any way you want, but
- * the identifier provided by Rust-Lightning is the channel's outpoint (and
- * it is up to you to maintain a correct mapping between the outpoint and the
- * stored channel data). Note that you **must** persist every new monitor to
- * disk. See the `Persist` trait documentation for more details.
+ * Persist a new channel's data in response to a [`chain::Watch::watch_channel`] call. This is
+ * called by [`ChannelManager`] for new channels, or may be called directly, e.g. on startup.
+ *
+ * The data can be stored any way you want, but the identifier provided by LDK is the
+ * channel's outpoint (and it is up to you to maintain a correct mapping between the outpoint
+ * and the stored channel data). Note that you **must** persist every new monitor to disk.
+ *
+ * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
+ * if you return [`ChannelMonitorUpdateErr::TemporaryFailure`].
*
* See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`
* and [`ChannelMonitorUpdateErr`] for requirements when returning errors.
*
+ * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
* [`Writeable::write`]: crate::util::ser::Writeable::write
*/
- Result_NoneChannelMonitorUpdateErrZ persist_new_channel(OutPoint id, ChannelMonitor data);
+ Result_NoneChannelMonitorUpdateErrZ persist_new_channel(OutPoint channel_id, ChannelMonitor data, MonitorUpdateId update_id);
/**
- * Update one channel's data. The provided `ChannelMonitor` has already
- * applied the given update.
+ * Update one channel's data. The provided [`ChannelMonitor`] has already applied the given
+ * update.
+ *
+ * Note that on every update, you **must** persist either the [`ChannelMonitorUpdate`] or the
+ * updated monitor itself to disk/backups. See the [`Persist`] trait documentation for more
+ * details.
*
- * Note that on every update, you **must** persist either the
- * `ChannelMonitorUpdate` or the updated monitor itself to disk/backups. See
- * the `Persist` trait documentation for more details.
+ * During blockchain synchronization operations, this may be called with no
+ * [`ChannelMonitorUpdate`], in which case the full [`ChannelMonitor`] needs to be persisted.
+ * Note that after the full [`ChannelMonitor`] is persisted any previous
+ * [`ChannelMonitorUpdate`]s which were persisted should be discarded - they can no longer be
+ * applied to the persisted [`ChannelMonitor`] as they were already applied.
*
* If an implementer chooses to persist the updates only, they need to make
* sure that all the updates are applied to the `ChannelMonitors` *before
* them in batches. The size of each monitor grows `O(number of state updates)`
* whereas updates are small and `O(1)`.
*
+ * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
+ * if you return [`ChannelMonitorUpdateErr::TemporaryFailure`].
+ *
* See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`,
* [`Writeable::write`] on [`ChannelMonitorUpdate`] for writing out an update, and
* [`ChannelMonitorUpdateErr`] for requirements when returning errors.
*
* [`Writeable::write`]: crate::util::ser::Writeable::write
+ *
+ * Note that update (or a relevant inner pointer) may be NULL or all-0s to represent None
*/
- Result_NoneChannelMonitorUpdateErrZ update_persisted_channel(OutPoint id, ChannelMonitorUpdate update, ChannelMonitor data);
+ Result_NoneChannelMonitorUpdateErrZ update_persisted_channel(OutPoint channel_id, ChannelMonitorUpdate update, ChannelMonitor data, MonitorUpdateId update_id);
}
private static class LDKPersistHolder { Persist held; }
public static Persist new_impl(PersistInterface arg) {
final LDKPersistHolder impl_holder = new LDKPersistHolder();
impl_holder.held = new Persist(new bindings.LDKPersist() {
- @Override public long persist_new_channel(long id, long data) {
- OutPoint id_hu_conv = new OutPoint(null, id);
- id_hu_conv.ptrs_to.add(this);
- ChannelMonitor data_hu_conv = new ChannelMonitor(null, data);
- Result_NoneChannelMonitorUpdateErrZ ret = arg.persist_new_channel(id_hu_conv, data_hu_conv);
+ @Override public long persist_new_channel(long channel_id, long data, long update_id) {
+ OutPoint channel_id_hu_conv = null; if (channel_id < 0 || channel_id > 4096) { channel_id_hu_conv = new OutPoint(null, channel_id); }
+ channel_id_hu_conv.ptrs_to.add(this);
+ ChannelMonitor data_hu_conv = null; if (data < 0 || data > 4096) { data_hu_conv = new ChannelMonitor(null, data); }
+ MonitorUpdateId update_id_hu_conv = null; if (update_id < 0 || update_id > 4096) { update_id_hu_conv = new MonitorUpdateId(null, update_id); }
+ update_id_hu_conv.ptrs_to.add(this);
+ Result_NoneChannelMonitorUpdateErrZ ret = arg.persist_new_channel(channel_id_hu_conv, data_hu_conv, update_id_hu_conv);
long result = ret != null ? ret.ptr : 0;
return result;
}
- @Override public long update_persisted_channel(long id, long update, long data) {
- OutPoint id_hu_conv = new OutPoint(null, id);
- id_hu_conv.ptrs_to.add(this);
- ChannelMonitorUpdate update_hu_conv = new ChannelMonitorUpdate(null, update);
- ChannelMonitor data_hu_conv = new ChannelMonitor(null, data);
- Result_NoneChannelMonitorUpdateErrZ ret = arg.update_persisted_channel(id_hu_conv, update_hu_conv, data_hu_conv);
+ @Override public long update_persisted_channel(long channel_id, long update, long data, long update_id) {
+ OutPoint channel_id_hu_conv = null; if (channel_id < 0 || channel_id > 4096) { channel_id_hu_conv = new OutPoint(null, channel_id); }
+ channel_id_hu_conv.ptrs_to.add(this);
+ ChannelMonitorUpdate update_hu_conv = null; if (update < 0 || update > 4096) { update_hu_conv = new ChannelMonitorUpdate(null, update); }
+ ChannelMonitor data_hu_conv = null; if (data < 0 || data > 4096) { data_hu_conv = new ChannelMonitor(null, data); }
+ MonitorUpdateId update_id_hu_conv = null; if (update_id < 0 || update_id > 4096) { update_id_hu_conv = new MonitorUpdateId(null, update_id); }
+ update_id_hu_conv.ptrs_to.add(this);
+ Result_NoneChannelMonitorUpdateErrZ ret = arg.update_persisted_channel(channel_id_hu_conv, update_hu_conv, data_hu_conv, update_id_hu_conv);
long result = ret != null ? ret.ptr : 0;
return result;
}
return impl_holder.held;
}
/**
- * Persist a new channel's data. The data can be stored any way you want, but
- * the identifier provided by Rust-Lightning is the channel's outpoint (and
- * it is up to you to maintain a correct mapping between the outpoint and the
- * stored channel data). Note that you **must** persist every new monitor to
- * disk. See the `Persist` trait documentation for more details.
+ * Persist a new channel's data in response to a [`chain::Watch::watch_channel`] call. This is
+ * called by [`ChannelManager`] for new channels, or may be called directly, e.g. on startup.
+ *
+ * The data can be stored any way you want, but the identifier provided by LDK is the
+ * channel's outpoint (and it is up to you to maintain a correct mapping between the outpoint
+ * and the stored channel data). Note that you **must** persist every new monitor to disk.
+ *
+ * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
+ * if you return [`ChannelMonitorUpdateErr::TemporaryFailure`].
*
* See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`
* and [`ChannelMonitorUpdateErr`] for requirements when returning errors.
*
+ * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
* [`Writeable::write`]: crate::util::ser::Writeable::write
*/
- public Result_NoneChannelMonitorUpdateErrZ persist_new_channel(OutPoint id, ChannelMonitor data) {
- long ret = bindings.Persist_persist_new_channel(this.ptr, id == null ? 0 : id.ptr & ~1, data == null ? 0 : data.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneChannelMonitorUpdateErrZ ret_hu_conv = Result_NoneChannelMonitorUpdateErrZ.constr_from_ptr(ret);
this.ptrs_to.add(data);
return ret_hu_conv;
}
/**
- * Update one channel's data. The provided `ChannelMonitor` has already
- * applied the given update.
+ * Update one channel's data. The provided [`ChannelMonitor`] has already applied the given
+ * update.
*
- * Note that on every update, you **must** persist either the
- * `ChannelMonitorUpdate` or the updated monitor itself to disk/backups. See
- * the `Persist` trait documentation for more details.
+ * Note that on every update, you **must** persist either the [`ChannelMonitorUpdate`] or the
+ * updated monitor itself to disk/backups. See the [`Persist`] trait documentation for more
+ * details.
+ *
+ * During blockchain synchronization operations, this may be called with no
+ * [`ChannelMonitorUpdate`], in which case the full [`ChannelMonitor`] needs to be persisted.
+ * Note that after the full [`ChannelMonitor`] is persisted any previous
+ * [`ChannelMonitorUpdate`]s which were persisted should be discarded - they can no longer be
+ * applied to the persisted [`ChannelMonitor`] as they were already applied.
*
* If an implementer chooses to persist the updates only, they need to make
* sure that all the updates are applied to the `ChannelMonitors` *before
* them in batches. The size of each monitor grows `O(number of state updates)`
* whereas updates are small and `O(1)`.
*
+ * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
+ * if you return [`ChannelMonitorUpdateErr::TemporaryFailure`].
+ *
* See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`,
* [`Writeable::write`] on [`ChannelMonitorUpdate`] for writing out an update, and
* [`ChannelMonitorUpdateErr`] for requirements when returning errors.
*
* [`Writeable::write`]: crate::util::ser::Writeable::write
+ *
+ * Note that update (or a relevant inner pointer) may be NULL or all-0s to represent None
*/
- public Result_NoneChannelMonitorUpdateErrZ update_persisted_channel(OutPoint id, ChannelMonitorUpdate update, ChannelMonitor data) {
- long ret = bindings.Persist_update_persisted_channel(this.ptr, id == null ? 0 : id.ptr & ~1, update == null ? 0 : update.ptr & ~1, data == null ? 0 : data.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneChannelMonitorUpdateErrZ ret_hu_conv = Result_NoneChannelMonitorUpdateErrZ.constr_from_ptr(ret);
this.ptrs_to.add(update);
this.ptrs_to.add(data);
*/
public static Ping of(short ponglen_arg, short byteslen_arg) {
long ret = bindings.Ping_new(ponglen_arg, byteslen_arg);
- if (ret >= 0 && ret < 1024) { return null; }
- Ping ret_hu_conv = new Ping(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public Ping clone() {
long ret = bindings.Ping_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- Ping ret_hu_conv = new Ping(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_PingDecodeErrorZ read(byte[] ser) {
long ret = bindings.Ping_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_PingDecodeErrorZ ret_hu_conv = Result_PingDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public static Pong of(short byteslen_arg) {
long ret = bindings.Pong_new(byteslen_arg);
- if (ret >= 0 && ret < 1024) { return null; }
- Pong ret_hu_conv = new Pong(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public Pong clone() {
long ret = bindings.Pong_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- Pong ret_hu_conv = new Pong(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_PongDecodeErrorZ read(byte[] ser) {
long ret = bindings.Pong_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_PongDecodeErrorZ ret_hu_conv = Result_PongDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public PositiveTimestamp clone() {
long ret = bindings.PositiveTimestamp_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- PositiveTimestamp ret_hu_conv = new PositiveTimestamp(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_PositiveTimestampCreationErrorZ from_unix_timestamp(long unix_seconds) {
long ret = bindings.PositiveTimestamp_from_unix_timestamp(unix_seconds);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_PositiveTimestampCreationErrorZ ret_hu_conv = Result_PositiveTimestampCreationErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public PrivateRoute clone() {
long ret = bindings.PrivateRoute_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- PrivateRoute ret_hu_conv = new PrivateRoute(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_PrivateRouteCreationErrorZ of(RouteHint hops) {
long ret = bindings.PrivateRoute_new(hops == null ? 0 : hops.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
- RouteHint ret_hu_conv = new RouteHint(null, ret);
+ 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);
;
return ret_hu_conv;
*/
public static QueryChannelRange of(byte[] chain_hash_arg, int first_blocknum_arg, int number_of_blocks_arg) {
long ret = bindings.QueryChannelRange_new(chain_hash_arg, first_blocknum_arg, number_of_blocks_arg);
- if (ret >= 0 && ret < 1024) { return null; }
- QueryChannelRange ret_hu_conv = new QueryChannelRange(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public QueryChannelRange clone() {
long ret = bindings.QueryChannelRange_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- QueryChannelRange ret_hu_conv = new QueryChannelRange(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_QueryChannelRangeDecodeErrorZ read(byte[] ser) {
long ret = bindings.QueryChannelRange_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_QueryChannelRangeDecodeErrorZ ret_hu_conv = Result_QueryChannelRangeDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public static QueryShortChannelIds of(byte[] chain_hash_arg, long[] short_channel_ids_arg) {
long ret = bindings.QueryShortChannelIds_new(chain_hash_arg, short_channel_ids_arg);
- if (ret >= 0 && ret < 1024) { return null; }
- QueryShortChannelIds ret_hu_conv = new QueryShortChannelIds(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public QueryShortChannelIds clone() {
long ret = bindings.QueryShortChannelIds_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- QueryShortChannelIds ret_hu_conv = new QueryShortChannelIds(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_QueryShortChannelIdsDecodeErrorZ read(byte[] ser) {
long ret = bindings.QueryShortChannelIds_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_QueryShortChannelIdsDecodeErrorZ ret_hu_conv = Result_QueryShortChannelIdsDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public PositiveTimestamp get_timestamp() {
long ret = bindings.RawDataPart_get_timestamp(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- PositiveTimestamp ret_hu_conv = new PositiveTimestamp(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public RawDataPart clone() {
long ret = bindings.RawDataPart_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- RawDataPart ret_hu_conv = new RawDataPart(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public RawDataPart get_data() {
long ret = bindings.RawInvoice_get_data(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- RawDataPart ret_hu_conv = new RawDataPart(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public RawInvoice clone() {
long ret = bindings.RawInvoice_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- RawInvoice ret_hu_conv = new RawInvoice(null, ret);
+ 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);
return ret_hu_conv;
}
@Nullable
public Sha256 payment_hash() {
long ret = bindings.RawInvoice_payment_hash(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- Sha256 ret_hu_conv = new Sha256(null, ret);
+ 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);
return ret_hu_conv;
}
@Nullable
public Description description() {
long ret = bindings.RawInvoice_description(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- Description ret_hu_conv = new Description(null, ret);
+ 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);
return ret_hu_conv;
}
@Nullable
public PayeePubKey payee_pub_key() {
long ret = bindings.RawInvoice_payee_pub_key(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- PayeePubKey ret_hu_conv = new PayeePubKey(null, ret);
+ 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);
return ret_hu_conv;
}
@Nullable
public Sha256 description_hash() {
long ret = bindings.RawInvoice_description_hash(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- Sha256 ret_hu_conv = new Sha256(null, ret);
+ 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);
return ret_hu_conv;
}
@Nullable
public ExpiryTime expiry_time() {
long ret = bindings.RawInvoice_expiry_time(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- ExpiryTime ret_hu_conv = new ExpiryTime(null, ret);
+ 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);
return ret_hu_conv;
}
@Nullable
public MinFinalCltvExpiry min_final_cltv_expiry() {
long ret = bindings.RawInvoice_min_final_cltv_expiry(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- MinFinalCltvExpiry ret_hu_conv = new MinFinalCltvExpiry(null, ret);
+ 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);
return ret_hu_conv;
}
@Nullable
public InvoiceFeatures features() {
long ret = bindings.RawInvoice_features(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- InvoiceFeatures ret_hu_conv = new InvoiceFeatures(null, ret);
+ 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);
return ret_hu_conv;
}
PrivateRoute[] ret_conv_14_arr = new PrivateRoute[ret.length];
for (int o = 0; o < ret.length; o++) {
long ret_conv_14 = ret[o];
- PrivateRoute ret_conv_14_hu_conv = new PrivateRoute(null, ret_conv_14);
+ PrivateRoute ret_conv_14_hu_conv = null; if (ret_conv_14 < 0 || ret_conv_14 > 4096) { ret_conv_14_hu_conv = new PrivateRoute(null, ret_conv_14); }
ret_conv_14_hu_conv.ptrs_to.add(this);
ret_conv_14_arr[o] = ret_conv_14_hu_conv;
}
public Option_u64Z amount_pico_btc() {
long ret = bindings.RawInvoice_amount_pico_btc(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public Option_CVec_NetAddressZZ get_addresses(byte[] pubkey) {
long ret = bindings.ReadOnlyNetworkGraph_get_addresses(this.ptr, pubkey);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
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(chain_hash_arg, first_blocknum_arg, number_of_blocks_arg, sync_complete_arg, short_channel_ids_arg);
- if (ret >= 0 && ret < 1024) { return null; }
- ReplyChannelRange ret_hu_conv = new ReplyChannelRange(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public ReplyChannelRange clone() {
long ret = bindings.ReplyChannelRange_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- ReplyChannelRange ret_hu_conv = new ReplyChannelRange(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_ReplyChannelRangeDecodeErrorZ read(byte[] ser) {
long ret = bindings.ReplyChannelRange_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_ReplyChannelRangeDecodeErrorZ ret_hu_conv = Result_ReplyChannelRangeDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public static ReplyShortChannelIdsEnd of(byte[] chain_hash_arg, boolean full_information_arg) {
long ret = bindings.ReplyShortChannelIdsEnd_new(chain_hash_arg, full_information_arg);
- if (ret >= 0 && ret < 1024) { return null; }
- ReplyShortChannelIdsEnd ret_hu_conv = new ReplyShortChannelIdsEnd(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public ReplyShortChannelIdsEnd clone() {
long ret = bindings.ReplyShortChannelIdsEnd_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- ReplyShortChannelIdsEnd ret_hu_conv = new ReplyShortChannelIdsEnd(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_ReplyShortChannelIdsEndDecodeErrorZ read(byte[] ser) {
long ret = bindings.ReplyShortChannelIdsEnd_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_ReplyShortChannelIdsEndDecodeErrorZ ret_hu_conv = Result_ReplyShortChannelIdsEndDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_AcceptChannelDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_AcceptChannelDecodeErrorZ_get_ok(ptr);
- AcceptChannel res_hu_conv = new AcceptChannel(null, res);
+ AcceptChannel res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new AcceptChannel(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_AcceptChannelDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_AcceptChannelDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_AcceptChannelDecodeErrorZ ok(AcceptChannel o) {
long ret = bindings.CResult_AcceptChannelDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_AcceptChannelDecodeErrorZ ret_hu_conv = Result_AcceptChannelDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_AcceptChannelDecodeErrorZ clone() {
long ret = bindings.CResult_AcceptChannelDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_AcceptChannelDecodeErrorZ ret_hu_conv = Result_AcceptChannelDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_AnnouncementSignaturesDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_AnnouncementSignaturesDecodeErrorZ_get_ok(ptr);
- AnnouncementSignatures res_hu_conv = new AnnouncementSignatures(null, res);
+ AnnouncementSignatures res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new AnnouncementSignatures(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_AnnouncementSignaturesDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_AnnouncementSignaturesDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_AnnouncementSignaturesDecodeErrorZ ok(AnnouncementSignatures o) {
long ret = bindings.CResult_AnnouncementSignaturesDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_AnnouncementSignaturesDecodeErrorZ ret_hu_conv = Result_AnnouncementSignaturesDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_AnnouncementSignaturesDecodeErrorZ clone() {
long ret = bindings.CResult_AnnouncementSignaturesDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_AnnouncementSignaturesDecodeErrorZ ret_hu_conv = Result_AnnouncementSignaturesDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_BuiltCommitmentTransactionDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_BuiltCommitmentTransactionDecodeErrorZ_get_ok(ptr);
- BuiltCommitmentTransaction res_hu_conv = new BuiltCommitmentTransaction(null, res);
+ BuiltCommitmentTransaction res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new BuiltCommitmentTransaction(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_BuiltCommitmentTransactionDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_BuiltCommitmentTransactionDecodeErrorZ ok(BuiltCommitmentTransaction o) {
long ret = bindings.CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_BuiltCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_BuiltCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_BuiltCommitmentTransactionDecodeErrorZ clone() {
long ret = bindings.CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_BuiltCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_BuiltCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ ok(TwoTuple_BlockHashChannelManagerZ o) {
long ret = bindings.CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(o != null ? o.ptr : 0);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ ret_hu_conv = Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ ok(TwoTuple_BlockHashChannelMonitorZ o) {
long ret = bindings.CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(o != null ? o.ptr : 0);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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 Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ clone() {
long ret = bindings.CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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_PaymentHashPaymentIdZPaymentSendFailureZ ok(TwoTuple_PaymentHashPaymentIdZ o) {
long ret = bindings.CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(o != null ? o.ptr : 0);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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 Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ clone() {
long ret = bindings.CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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_SignatureCVec_SignatureZZNoneZ ok(TwoTuple_SignatureCVec_SignatureZZ o) {
long ret = bindings.CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(o != null ? o.ptr : 0);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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 static Result_C2Tuple_SignatureCVec_SignatureZZNoneZ err() {
long ret = bindings.CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err();
- if (ret >= 0 && ret < 1024) { return null; }
+ 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 Result_C2Tuple_SignatureCVec_SignatureZZNoneZ clone() {
long ret = bindings.CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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;
}
private Result_COption_TypeZDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_COption_TypeZDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_COption_TypeZDecodeErrorZ ok(Option_TypeZ o) {
long ret = bindings.CResult_COption_TypeZDecodeErrorZ_ok(o.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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 Result_COption_TypeZDecodeErrorZ clone() {
long ret = bindings.CResult_COption_TypeZDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_COption_TypeZDecodeErrorZ ret_hu_conv = Result_COption_TypeZDecodeErrorZ.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_CResult_NetAddressu8ZDecodeErrorZ extends CommonBase {
- private Result_CResult_NetAddressu8ZDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
- protected void finalize() throws Throwable {
- if (ptr != 0) { bindings.CResult_CResult_NetAddressu8ZDecodeErrorZ_free(ptr); } super.finalize();
- }
-
- static Result_CResult_NetAddressu8ZDecodeErrorZ constr_from_ptr(long ptr) {
- if (bindings.LDKCResult_CResult_NetAddressu8ZDecodeErrorZ_result_ok(ptr)) {
- return new Result_CResult_NetAddressu8ZDecodeErrorZ_OK(null, ptr);
- } else {
- return new Result_CResult_NetAddressu8ZDecodeErrorZ_Err(null, ptr);
- }
- }
- public static final class Result_CResult_NetAddressu8ZDecodeErrorZ_OK extends Result_CResult_NetAddressu8ZDecodeErrorZ {
- public final Result_NetAddressu8Z res;
- private Result_CResult_NetAddressu8ZDecodeErrorZ_OK(Object _dummy, long ptr) {
- super(_dummy, ptr);
- long res = bindings.LDKCResult_CResult_NetAddressu8ZDecodeErrorZ_get_ok(ptr);
- Result_NetAddressu8Z res_hu_conv = Result_NetAddressu8Z.constr_from_ptr(res);
- this.res = res_hu_conv;
- }
- }
-
- public static final class Result_CResult_NetAddressu8ZDecodeErrorZ_Err extends Result_CResult_NetAddressu8ZDecodeErrorZ {
- public final DecodeError err;
- private Result_CResult_NetAddressu8ZDecodeErrorZ_Err(Object _dummy, long ptr) {
- super(_dummy, ptr);
- long err = bindings.LDKCResult_CResult_NetAddressu8ZDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
- err_hu_conv.ptrs_to.add(this);
- this.err = err_hu_conv;
- }
- }
-
- /**
- * Creates a new CResult_CResult_NetAddressu8ZDecodeErrorZ in the success state.
- */
- public static Result_CResult_NetAddressu8ZDecodeErrorZ ok(Result_NetAddressu8Z o) {
- long ret = bindings.CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(o != null ? o.ptr : 0);
- if (ret >= 0 && ret < 1024) { return null; }
- Result_CResult_NetAddressu8ZDecodeErrorZ ret_hu_conv = Result_CResult_NetAddressu8ZDecodeErrorZ.constr_from_ptr(ret);
- return ret_hu_conv;
- }
-
- /**
- * Creates a new CResult_CResult_NetAddressu8ZDecodeErrorZ in the error state.
- */
- public static Result_CResult_NetAddressu8ZDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_CResult_NetAddressu8ZDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
- Result_CResult_NetAddressu8ZDecodeErrorZ ret_hu_conv = Result_CResult_NetAddressu8ZDecodeErrorZ.constr_from_ptr(ret);
- return ret_hu_conv;
- }
-
- /**
- * Creates a new CResult_CResult_NetAddressu8ZDecodeErrorZ which has the same data as `orig`
- * but with all dynamically-allocated buffers duplicated in new buffers.
- */
- public Result_CResult_NetAddressu8ZDecodeErrorZ clone() {
- long ret = bindings.CResult_CResult_NetAddressu8ZDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- Result_CResult_NetAddressu8ZDecodeErrorZ ret_hu_conv = Result_CResult_NetAddressu8ZDecodeErrorZ.constr_from_ptr(ret);
- return ret_hu_conv;
- }
-
-}
*/
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);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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 Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ clone() {
long ret = bindings.CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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_CVec_u8ZZNoneZ ok(byte[][] o) {
long ret = bindings.CResult_CVec_CVec_u8ZZNoneZ_ok(o);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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 static Result_CVec_CVec_u8ZZNoneZ err() {
long ret = bindings.CResult_CVec_CVec_u8ZZNoneZ_err();
- if (ret >= 0 && ret < 1024) { return null; }
+ 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 Result_CVec_CVec_u8ZZNoneZ clone() {
long ret = bindings.CResult_CVec_CVec_u8ZZNoneZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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 static Result_CVec_SignatureZNoneZ ok(byte[][] o) {
long ret = bindings.CResult_CVec_SignatureZNoneZ_ok(o);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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 static Result_CVec_SignatureZNoneZ err() {
long ret = bindings.CResult_CVec_SignatureZNoneZ_err();
- if (ret >= 0 && ret < 1024) { return null; }
+ 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 Result_CVec_SignatureZNoneZ clone() {
long ret = bindings.CResult_CVec_SignatureZNoneZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_CVec_SignatureZNoneZ ret_hu_conv = Result_CVec_SignatureZNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_CVec_u8ZPeerHandleErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_CVec_u8ZPeerHandleErrorZ_get_err(ptr);
- PeerHandleError err_hu_conv = new PeerHandleError(null, err);
+ PeerHandleError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new PeerHandleError(null, err); }
err_hu_conv.ptrs_to.add(this);
this.err = err_hu_conv;
}
*/
public static Result_CVec_u8ZPeerHandleErrorZ ok(byte[] o) {
long ret = bindings.CResult_CVec_u8ZPeerHandleErrorZ_ok(o);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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 Result_CVec_u8ZPeerHandleErrorZ clone() {
long ret = bindings.CResult_CVec_u8ZPeerHandleErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_CVec_u8ZPeerHandleErrorZ ret_hu_conv = Result_CVec_u8ZPeerHandleErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_ChannelAnnouncementDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_ChannelAnnouncementDecodeErrorZ_get_ok(ptr);
- ChannelAnnouncement res_hu_conv = new ChannelAnnouncement(null, res);
+ ChannelAnnouncement res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new ChannelAnnouncement(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_ChannelAnnouncementDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_ChannelAnnouncementDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_ChannelAnnouncementDecodeErrorZ ok(ChannelAnnouncement o) {
long ret = bindings.CResult_ChannelAnnouncementDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_ChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_ChannelAnnouncementDecodeErrorZ clone() {
long ret = bindings.CResult_ChannelAnnouncementDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_ChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_ChannelConfigDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_ChannelConfigDecodeErrorZ_get_ok(ptr);
- ChannelConfig res_hu_conv = new ChannelConfig(null, res);
+ ChannelConfig res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new ChannelConfig(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_ChannelConfigDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_ChannelConfigDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_ChannelConfigDecodeErrorZ ok(ChannelConfig o) {
long ret = bindings.CResult_ChannelConfigDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelConfigDecodeErrorZ ret_hu_conv = Result_ChannelConfigDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_ChannelConfigDecodeErrorZ clone() {
long ret = bindings.CResult_ChannelConfigDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelConfigDecodeErrorZ ret_hu_conv = Result_ChannelConfigDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_ChannelFeaturesDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_ChannelFeaturesDecodeErrorZ_get_ok(ptr);
- ChannelFeatures res_hu_conv = new ChannelFeatures(null, res);
+ ChannelFeatures res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new ChannelFeatures(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_ChannelFeaturesDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_ChannelFeaturesDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_ChannelFeaturesDecodeErrorZ ok(ChannelFeatures o) {
long ret = bindings.CResult_ChannelFeaturesDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelFeaturesDecodeErrorZ ret_hu_conv = Result_ChannelFeaturesDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_ChannelInfoDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_ChannelInfoDecodeErrorZ_get_ok(ptr);
- ChannelInfo res_hu_conv = new ChannelInfo(null, res);
+ ChannelInfo res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new ChannelInfo(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_ChannelInfoDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_ChannelInfoDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_ChannelInfoDecodeErrorZ ok(ChannelInfo o) {
long ret = bindings.CResult_ChannelInfoDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelInfoDecodeErrorZ ret_hu_conv = Result_ChannelInfoDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_ChannelInfoDecodeErrorZ clone() {
long ret = bindings.CResult_ChannelInfoDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelInfoDecodeErrorZ ret_hu_conv = Result_ChannelInfoDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_ChannelMonitorUpdateDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(ptr);
- ChannelMonitorUpdate res_hu_conv = new ChannelMonitorUpdate(null, res);
+ ChannelMonitorUpdate res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new ChannelMonitorUpdate(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_ChannelMonitorUpdateDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_ChannelMonitorUpdateDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_ChannelMonitorUpdateDecodeErrorZ ok(ChannelMonitorUpdate o) {
long ret = bindings.CResult_ChannelMonitorUpdateDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelMonitorUpdateDecodeErrorZ ret_hu_conv = Result_ChannelMonitorUpdateDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_ChannelMonitorUpdateDecodeErrorZ clone() {
long ret = bindings.CResult_ChannelMonitorUpdateDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelMonitorUpdateDecodeErrorZ ret_hu_conv = Result_ChannelMonitorUpdateDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_ChannelPublicKeysDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_ChannelPublicKeysDecodeErrorZ_get_ok(ptr);
- ChannelPublicKeys res_hu_conv = new ChannelPublicKeys(null, res);
+ ChannelPublicKeys res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new ChannelPublicKeys(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_ChannelPublicKeysDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_ChannelPublicKeysDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_ChannelPublicKeysDecodeErrorZ ok(ChannelPublicKeys o) {
long ret = bindings.CResult_ChannelPublicKeysDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelPublicKeysDecodeErrorZ ret_hu_conv = Result_ChannelPublicKeysDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_ChannelPublicKeysDecodeErrorZ clone() {
long ret = bindings.CResult_ChannelPublicKeysDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelPublicKeysDecodeErrorZ ret_hu_conv = Result_ChannelPublicKeysDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_ChannelReestablishDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_ChannelReestablishDecodeErrorZ_get_ok(ptr);
- ChannelReestablish res_hu_conv = new ChannelReestablish(null, res);
+ ChannelReestablish res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new ChannelReestablish(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_ChannelReestablishDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_ChannelReestablishDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_ChannelReestablishDecodeErrorZ ok(ChannelReestablish o) {
long ret = bindings.CResult_ChannelReestablishDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelReestablishDecodeErrorZ ret_hu_conv = Result_ChannelReestablishDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_ChannelReestablishDecodeErrorZ clone() {
long ret = bindings.CResult_ChannelReestablishDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelReestablishDecodeErrorZ ret_hu_conv = Result_ChannelReestablishDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_ChannelTransactionParametersDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_ChannelTransactionParametersDecodeErrorZ_get_ok(ptr);
- ChannelTransactionParameters res_hu_conv = new ChannelTransactionParameters(null, res);
+ ChannelTransactionParameters res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new ChannelTransactionParameters(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_ChannelTransactionParametersDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_ChannelTransactionParametersDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_ChannelTransactionParametersDecodeErrorZ ok(ChannelTransactionParameters o) {
long ret = bindings.CResult_ChannelTransactionParametersDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_ChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_ChannelTransactionParametersDecodeErrorZ clone() {
long ret = bindings.CResult_ChannelTransactionParametersDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_ChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_ChannelUpdateDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_ChannelUpdateDecodeErrorZ_get_ok(ptr);
- ChannelUpdate res_hu_conv = new ChannelUpdate(null, res);
+ ChannelUpdate res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new ChannelUpdate(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_ChannelUpdateDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_ChannelUpdateDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_ChannelUpdateDecodeErrorZ ok(ChannelUpdate o) {
long ret = bindings.CResult_ChannelUpdateDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelUpdateDecodeErrorZ ret_hu_conv = Result_ChannelUpdateDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_ChannelUpdateDecodeErrorZ clone() {
long ret = bindings.CResult_ChannelUpdateDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelUpdateDecodeErrorZ ret_hu_conv = Result_ChannelUpdateDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_ClosingSignedDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_ClosingSignedDecodeErrorZ_get_ok(ptr);
- ClosingSigned res_hu_conv = new ClosingSigned(null, res);
+ ClosingSigned res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new ClosingSigned(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_ClosingSignedDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_ClosingSignedDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_ClosingSignedDecodeErrorZ ok(ClosingSigned o) {
long ret = bindings.CResult_ClosingSignedDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_ClosingSignedDecodeErrorZ ret_hu_conv = Result_ClosingSignedDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_ClosingSignedDecodeErrorZ clone() {
long ret = bindings.CResult_ClosingSignedDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_ClosingSignedDecodeErrorZ ret_hu_conv = Result_ClosingSignedDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_ClosingSignedFeeRangeDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_ClosingSignedFeeRangeDecodeErrorZ_get_ok(ptr);
- ClosingSignedFeeRange res_hu_conv = new ClosingSignedFeeRange(null, res);
+ ClosingSignedFeeRange res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new ClosingSignedFeeRange(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_ClosingSignedFeeRangeDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_ClosingSignedFeeRangeDecodeErrorZ ok(ClosingSignedFeeRange o) {
long ret = bindings.CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_ClosingSignedFeeRangeDecodeErrorZ ret_hu_conv = Result_ClosingSignedFeeRangeDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_ClosingSignedFeeRangeDecodeErrorZ clone() {
long ret = bindings.CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_ClosingSignedFeeRangeDecodeErrorZ ret_hu_conv = Result_ClosingSignedFeeRangeDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_CommitmentSignedDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_CommitmentSignedDecodeErrorZ_get_ok(ptr);
- CommitmentSigned res_hu_conv = new CommitmentSigned(null, res);
+ CommitmentSigned res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new CommitmentSigned(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_CommitmentSignedDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_CommitmentSignedDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_CommitmentSignedDecodeErrorZ ok(CommitmentSigned o) {
long ret = bindings.CResult_CommitmentSignedDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_CommitmentSignedDecodeErrorZ ret_hu_conv = Result_CommitmentSignedDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_CommitmentSignedDecodeErrorZ clone() {
long ret = bindings.CResult_CommitmentSignedDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_CommitmentSignedDecodeErrorZ ret_hu_conv = Result_CommitmentSignedDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_CommitmentTransactionDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_CommitmentTransactionDecodeErrorZ_get_ok(ptr);
- CommitmentTransaction res_hu_conv = new CommitmentTransaction(null, res);
+ CommitmentTransaction res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new CommitmentTransaction(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_CommitmentTransactionDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_CommitmentTransactionDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_CommitmentTransactionDecodeErrorZ ok(CommitmentTransaction o) {
long ret = bindings.CResult_CommitmentTransactionDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_CommitmentTransactionDecodeErrorZ ret_hu_conv = Result_CommitmentTransactionDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_CommitmentTransactionDecodeErrorZ clone() {
long ret = bindings.CResult_CommitmentTransactionDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_CommitmentTransactionDecodeErrorZ ret_hu_conv = Result_CommitmentTransactionDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_CounterpartyChannelTransactionParametersDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_ok(ptr);
- CounterpartyChannelTransactionParameters res_hu_conv = new CounterpartyChannelTransactionParameters(null, res);
+ CounterpartyChannelTransactionParameters res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new CounterpartyChannelTransactionParameters(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_CounterpartyChannelTransactionParametersDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_CounterpartyChannelTransactionParametersDecodeErrorZ ok(CounterpartyChannelTransactionParameters o) {
long ret = bindings.CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_CounterpartyChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_CounterpartyChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_CounterpartyChannelTransactionParametersDecodeErrorZ clone() {
long ret = bindings.CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_CounterpartyChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_CounterpartyChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_DelayedPaymentOutputDescriptorDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(ptr);
- DelayedPaymentOutputDescriptor res_hu_conv = new DelayedPaymentOutputDescriptor(null, res);
+ DelayedPaymentOutputDescriptor res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new DelayedPaymentOutputDescriptor(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_DelayedPaymentOutputDescriptorDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_DelayedPaymentOutputDescriptorDecodeErrorZ ok(DelayedPaymentOutputDescriptor o) {
long ret = bindings.CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_DelayedPaymentOutputDescriptorDecodeErrorZ ret_hu_conv = Result_DelayedPaymentOutputDescriptorDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_DelayedPaymentOutputDescriptorDecodeErrorZ clone() {
long ret = bindings.CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_DelayedPaymentOutputDescriptorDecodeErrorZ ret_hu_conv = Result_DelayedPaymentOutputDescriptorDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_DescriptionCreationErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_DescriptionCreationErrorZ_get_ok(ptr);
- Description res_hu_conv = new Description(null, res);
+ Description res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new Description(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
*/
public static Result_DescriptionCreationErrorZ ok(Description o) {
long ret = bindings.CResult_DescriptionCreationErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_DescriptionCreationErrorZ ret_hu_conv = Result_DescriptionCreationErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_DescriptionCreationErrorZ clone() {
long ret = bindings.CResult_DescriptionCreationErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_DescriptionCreationErrorZ ret_hu_conv = Result_DescriptionCreationErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_DirectionalChannelInfoDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_DirectionalChannelInfoDecodeErrorZ_get_ok(ptr);
- DirectionalChannelInfo res_hu_conv = new DirectionalChannelInfo(null, res);
+ DirectionalChannelInfo res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new DirectionalChannelInfo(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_DirectionalChannelInfoDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_DirectionalChannelInfoDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_DirectionalChannelInfoDecodeErrorZ ok(DirectionalChannelInfo o) {
long ret = bindings.CResult_DirectionalChannelInfoDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_DirectionalChannelInfoDecodeErrorZ ret_hu_conv = Result_DirectionalChannelInfoDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_DirectionalChannelInfoDecodeErrorZ clone() {
long ret = bindings.CResult_DirectionalChannelInfoDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_DirectionalChannelInfoDecodeErrorZ ret_hu_conv = Result_DirectionalChannelInfoDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_ErrorMessageDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_ErrorMessageDecodeErrorZ_get_ok(ptr);
- ErrorMessage res_hu_conv = new ErrorMessage(null, res);
+ ErrorMessage res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new ErrorMessage(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_ErrorMessageDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_ErrorMessageDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_ErrorMessageDecodeErrorZ ok(ErrorMessage o) {
long ret = bindings.CResult_ErrorMessageDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_ErrorMessageDecodeErrorZ ret_hu_conv = Result_ErrorMessageDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_ErrorMessageDecodeErrorZ clone() {
long ret = bindings.CResult_ErrorMessageDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_ErrorMessageDecodeErrorZ ret_hu_conv = Result_ErrorMessageDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_ExpiryTimeCreationErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_ExpiryTimeCreationErrorZ_get_ok(ptr);
- ExpiryTime res_hu_conv = new ExpiryTime(null, res);
+ ExpiryTime res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new ExpiryTime(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
*/
public static Result_ExpiryTimeCreationErrorZ ok(ExpiryTime o) {
long ret = bindings.CResult_ExpiryTimeCreationErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_ExpiryTimeCreationErrorZ ret_hu_conv = Result_ExpiryTimeCreationErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_ExpiryTimeCreationErrorZ clone() {
long ret = bindings.CResult_ExpiryTimeCreationErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_ExpiryTimeCreationErrorZ ret_hu_conv = Result_ExpiryTimeCreationErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_FundingCreatedDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_FundingCreatedDecodeErrorZ_get_ok(ptr);
- FundingCreated res_hu_conv = new FundingCreated(null, res);
+ FundingCreated res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new FundingCreated(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_FundingCreatedDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_FundingCreatedDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_FundingCreatedDecodeErrorZ ok(FundingCreated o) {
long ret = bindings.CResult_FundingCreatedDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_FundingCreatedDecodeErrorZ ret_hu_conv = Result_FundingCreatedDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_FundingCreatedDecodeErrorZ clone() {
long ret = bindings.CResult_FundingCreatedDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_FundingCreatedDecodeErrorZ ret_hu_conv = Result_FundingCreatedDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_FundingLockedDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_FundingLockedDecodeErrorZ_get_ok(ptr);
- FundingLocked res_hu_conv = new FundingLocked(null, res);
+ FundingLocked res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new FundingLocked(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_FundingLockedDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_FundingLockedDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_FundingLockedDecodeErrorZ ok(FundingLocked o) {
long ret = bindings.CResult_FundingLockedDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_FundingLockedDecodeErrorZ ret_hu_conv = Result_FundingLockedDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_FundingLockedDecodeErrorZ clone() {
long ret = bindings.CResult_FundingLockedDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_FundingLockedDecodeErrorZ ret_hu_conv = Result_FundingLockedDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_FundingSignedDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_FundingSignedDecodeErrorZ_get_ok(ptr);
- FundingSigned res_hu_conv = new FundingSigned(null, res);
+ FundingSigned res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new FundingSigned(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_FundingSignedDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_FundingSignedDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_FundingSignedDecodeErrorZ ok(FundingSigned o) {
long ret = bindings.CResult_FundingSignedDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_FundingSignedDecodeErrorZ ret_hu_conv = Result_FundingSignedDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_FundingSignedDecodeErrorZ clone() {
long ret = bindings.CResult_FundingSignedDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_FundingSignedDecodeErrorZ ret_hu_conv = Result_FundingSignedDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_GossipTimestampFilterDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_GossipTimestampFilterDecodeErrorZ_get_ok(ptr);
- GossipTimestampFilter res_hu_conv = new GossipTimestampFilter(null, res);
+ GossipTimestampFilter res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new GossipTimestampFilter(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_GossipTimestampFilterDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_GossipTimestampFilterDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_GossipTimestampFilterDecodeErrorZ ok(GossipTimestampFilter o) {
long ret = bindings.CResult_GossipTimestampFilterDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_GossipTimestampFilterDecodeErrorZ ret_hu_conv = Result_GossipTimestampFilterDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_GossipTimestampFilterDecodeErrorZ clone() {
long ret = bindings.CResult_GossipTimestampFilterDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_GossipTimestampFilterDecodeErrorZ ret_hu_conv = Result_GossipTimestampFilterDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_HTLCOutputInCommitmentDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok(ptr);
- HTLCOutputInCommitment res_hu_conv = new HTLCOutputInCommitment(null, res);
+ HTLCOutputInCommitment res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new HTLCOutputInCommitment(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_HTLCOutputInCommitmentDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_HTLCOutputInCommitmentDecodeErrorZ ok(HTLCOutputInCommitment o) {
long ret = bindings.CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_HTLCOutputInCommitmentDecodeErrorZ ret_hu_conv = Result_HTLCOutputInCommitmentDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_HTLCOutputInCommitmentDecodeErrorZ clone() {
long ret = bindings.CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_HTLCOutputInCommitmentDecodeErrorZ ret_hu_conv = Result_HTLCOutputInCommitmentDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_HTLCUpdateDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_HTLCUpdateDecodeErrorZ_get_ok(ptr);
- HTLCUpdate res_hu_conv = new HTLCUpdate(null, res);
+ HTLCUpdate res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new HTLCUpdate(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_HTLCUpdateDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_HTLCUpdateDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_HTLCUpdateDecodeErrorZ ok(HTLCUpdate o) {
long ret = bindings.CResult_HTLCUpdateDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_HTLCUpdateDecodeErrorZ ret_hu_conv = Result_HTLCUpdateDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_HTLCUpdateDecodeErrorZ clone() {
long ret = bindings.CResult_HTLCUpdateDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_HTLCUpdateDecodeErrorZ ret_hu_conv = Result_HTLCUpdateDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_HolderCommitmentTransactionDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_HolderCommitmentTransactionDecodeErrorZ_get_ok(ptr);
- HolderCommitmentTransaction res_hu_conv = new HolderCommitmentTransaction(null, res);
+ HolderCommitmentTransaction res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new HolderCommitmentTransaction(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_HolderCommitmentTransactionDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_HolderCommitmentTransactionDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_HolderCommitmentTransactionDecodeErrorZ ok(HolderCommitmentTransaction o) {
long ret = bindings.CResult_HolderCommitmentTransactionDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_HolderCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_HolderCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_HolderCommitmentTransactionDecodeErrorZ clone() {
long ret = bindings.CResult_HolderCommitmentTransactionDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_HolderCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_HolderCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_InMemorySignerDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_InMemorySignerDecodeErrorZ_get_ok(ptr);
- InMemorySigner res_hu_conv = new InMemorySigner(null, res);
+ InMemorySigner res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new InMemorySigner(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_InMemorySignerDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_InMemorySignerDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_InMemorySignerDecodeErrorZ ok(InMemorySigner o) {
long ret = bindings.CResult_InMemorySignerDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_InMemorySignerDecodeErrorZ ret_hu_conv = Result_InMemorySignerDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_InMemorySignerDecodeErrorZ clone() {
long ret = bindings.CResult_InMemorySignerDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_InMemorySignerDecodeErrorZ ret_hu_conv = Result_InMemorySignerDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_InitDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_InitDecodeErrorZ_get_ok(ptr);
- Init res_hu_conv = new Init(null, res);
+ Init res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new Init(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_InitDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_InitDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_InitDecodeErrorZ ok(Init o) {
long ret = bindings.CResult_InitDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_InitDecodeErrorZ ret_hu_conv = Result_InitDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_InitDecodeErrorZ clone() {
long ret = bindings.CResult_InitDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_InitDecodeErrorZ ret_hu_conv = Result_InitDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_InitFeaturesDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_InitFeaturesDecodeErrorZ_get_ok(ptr);
- InitFeatures res_hu_conv = new InitFeatures(null, res);
+ InitFeatures res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new InitFeatures(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_InitFeaturesDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_InitFeaturesDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_InitFeaturesDecodeErrorZ ok(InitFeatures o) {
long ret = bindings.CResult_InitFeaturesDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_InitFeaturesDecodeErrorZ ret_hu_conv = Result_InitFeaturesDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_InvoiceFeaturesDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_InvoiceFeaturesDecodeErrorZ_get_ok(ptr);
- InvoiceFeatures res_hu_conv = new InvoiceFeatures(null, res);
+ InvoiceFeatures res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new InvoiceFeatures(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_InvoiceFeaturesDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_InvoiceFeaturesDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_InvoiceFeaturesDecodeErrorZ ok(InvoiceFeatures o) {
long ret = bindings.CResult_InvoiceFeaturesDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_InvoiceFeaturesDecodeErrorZ ret_hu_conv = Result_InvoiceFeaturesDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_InvoiceNoneZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_InvoiceNoneZ_get_ok(ptr);
- Invoice res_hu_conv = new Invoice(null, res);
+ Invoice res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new Invoice(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
*/
public static Result_InvoiceNoneZ ok(Invoice o) {
long ret = bindings.CResult_InvoiceNoneZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_InvoiceNoneZ ret_hu_conv = Result_InvoiceNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public static Result_InvoiceNoneZ err() {
long ret = bindings.CResult_InvoiceNoneZ_err();
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_InvoiceNoneZ ret_hu_conv = Result_InvoiceNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_InvoiceNoneZ clone() {
long ret = bindings.CResult_InvoiceNoneZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_InvoiceNoneZ ret_hu_conv = Result_InvoiceNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_InvoiceSemanticErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_InvoiceSemanticErrorZ_get_ok(ptr);
- Invoice res_hu_conv = new Invoice(null, res);
+ Invoice res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new Invoice(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
*/
public static Result_InvoiceSemanticErrorZ ok(Invoice o) {
long ret = bindings.CResult_InvoiceSemanticErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_InvoiceSemanticErrorZ ret_hu_conv = Result_InvoiceSemanticErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_InvoiceSemanticErrorZ clone() {
long ret = bindings.CResult_InvoiceSemanticErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_InvoiceSemanticErrorZ ret_hu_conv = Result_InvoiceSemanticErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_InvoiceSignOrCreationErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_InvoiceSignOrCreationErrorZ_get_ok(ptr);
- Invoice res_hu_conv = new Invoice(null, res);
+ Invoice res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new Invoice(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
*/
public static Result_InvoiceSignOrCreationErrorZ ok(Invoice o) {
long ret = bindings.CResult_InvoiceSignOrCreationErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_InvoiceSignOrCreationErrorZ ret_hu_conv = Result_InvoiceSignOrCreationErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_InvoiceSignOrCreationErrorZ clone() {
long ret = bindings.CResult_InvoiceSignOrCreationErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_InvoiceSignOrCreationErrorZ ret_hu_conv = Result_InvoiceSignOrCreationErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_LockedChannelMonitorNoneZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_LockedChannelMonitorNoneZ_get_ok(ptr);
- LockedChannelMonitor res_hu_conv = new LockedChannelMonitor(null, res);
+ LockedChannelMonitor res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new LockedChannelMonitor(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
*/
public static Result_LockedChannelMonitorNoneZ ok(LockedChannelMonitor o) {
long ret = bindings.CResult_LockedChannelMonitorNoneZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
// Due to rust's strict-ownership memory model, in some cases we need to "move"
*/
public static Result_LockedChannelMonitorNoneZ err() {
long ret = bindings.CResult_LockedChannelMonitorNoneZ_err();
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_LockedChannelMonitorNoneZ ret_hu_conv = Result_LockedChannelMonitorNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_NetAddressDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_NetAddressDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_NetAddressDecodeErrorZ ok(NetAddress o) {
long ret = bindings.CResult_NetAddressDecodeErrorZ_ok(o.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NetAddressDecodeErrorZ ret_hu_conv = Result_NetAddressDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_NetAddressDecodeErrorZ clone() {
long ret = bindings.CResult_NetAddressDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NetAddressDecodeErrorZ ret_hu_conv = Result_NetAddressDecodeErrorZ.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_NetAddressu8Z extends CommonBase {
- private Result_NetAddressu8Z(Object _dummy, long ptr) { super(ptr); }
- protected void finalize() throws Throwable {
- if (ptr != 0) { bindings.CResult_NetAddressu8Z_free(ptr); } super.finalize();
- }
-
- static Result_NetAddressu8Z constr_from_ptr(long ptr) {
- if (bindings.LDKCResult_NetAddressu8Z_result_ok(ptr)) {
- return new Result_NetAddressu8Z_OK(null, ptr);
- } else {
- return new Result_NetAddressu8Z_Err(null, ptr);
- }
- }
- public static final class Result_NetAddressu8Z_OK extends Result_NetAddressu8Z {
- public final NetAddress res;
- private Result_NetAddressu8Z_OK(Object _dummy, long ptr) {
- super(_dummy, ptr);
- long res = bindings.LDKCResult_NetAddressu8Z_get_ok(ptr);
- NetAddress res_hu_conv = NetAddress.constr_from_ptr(res);
- res_hu_conv.ptrs_to.add(this);
- this.res = res_hu_conv;
- }
- }
-
- public static final class Result_NetAddressu8Z_Err extends Result_NetAddressu8Z {
- public final byte err;
- private Result_NetAddressu8Z_Err(Object _dummy, long ptr) {
- super(_dummy, ptr);
- this.err = bindings.LDKCResult_NetAddressu8Z_get_err(ptr);
- }
- }
-
- /**
- * Creates a new CResult_NetAddressu8Z in the success state.
- */
- public static Result_NetAddressu8Z ok(NetAddress o) {
- long ret = bindings.CResult_NetAddressu8Z_ok(o.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- Result_NetAddressu8Z ret_hu_conv = Result_NetAddressu8Z.constr_from_ptr(ret);
- return ret_hu_conv;
- }
-
- /**
- * Creates a new CResult_NetAddressu8Z in the error state.
- */
- public static Result_NetAddressu8Z err(byte e) {
- long ret = bindings.CResult_NetAddressu8Z_err(e);
- if (ret >= 0 && ret < 1024) { return null; }
- Result_NetAddressu8Z ret_hu_conv = Result_NetAddressu8Z.constr_from_ptr(ret);
- return ret_hu_conv;
- }
-
- /**
- * Creates a new CResult_NetAddressu8Z which has the same data as `orig`
- * but with all dynamically-allocated buffers duplicated in new buffers.
- */
- public Result_NetAddressu8Z clone() {
- long ret = bindings.CResult_NetAddressu8Z_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- Result_NetAddressu8Z ret_hu_conv = Result_NetAddressu8Z.constr_from_ptr(ret);
- return ret_hu_conv;
- }
-
-}
private Result_NetworkGraphDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_NetworkGraphDecodeErrorZ_get_ok(ptr);
- NetworkGraph res_hu_conv = new NetworkGraph(null, res);
+ NetworkGraph res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new NetworkGraph(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_NetworkGraphDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_NetworkGraphDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_NetworkGraphDecodeErrorZ ok(NetworkGraph o) {
long ret = bindings.CResult_NetworkGraphDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NetworkGraphDecodeErrorZ ret_hu_conv = Result_NetworkGraphDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_NetworkGraphDecodeErrorZ clone() {
long ret = bindings.CResult_NetworkGraphDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NetworkGraphDecodeErrorZ ret_hu_conv = Result_NetworkGraphDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_NodeAnnouncementDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_NodeAnnouncementDecodeErrorZ_get_ok(ptr);
- NodeAnnouncement res_hu_conv = new NodeAnnouncement(null, res);
+ NodeAnnouncement res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new NodeAnnouncement(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_NodeAnnouncementDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_NodeAnnouncementDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_NodeAnnouncementDecodeErrorZ ok(NodeAnnouncement o) {
long ret = bindings.CResult_NodeAnnouncementDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NodeAnnouncementDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_NodeAnnouncementDecodeErrorZ clone() {
long ret = bindings.CResult_NodeAnnouncementDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NodeAnnouncementDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_NodeAnnouncementInfoDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(ptr);
- NodeAnnouncementInfo res_hu_conv = new NodeAnnouncementInfo(null, res);
+ NodeAnnouncementInfo res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new NodeAnnouncementInfo(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_NodeAnnouncementInfoDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_NodeAnnouncementInfoDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_NodeAnnouncementInfoDecodeErrorZ ok(NodeAnnouncementInfo o) {
long ret = bindings.CResult_NodeAnnouncementInfoDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NodeAnnouncementInfoDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementInfoDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_NodeAnnouncementInfoDecodeErrorZ clone() {
long ret = bindings.CResult_NodeAnnouncementInfoDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NodeAnnouncementInfoDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementInfoDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_NodeFeaturesDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_NodeFeaturesDecodeErrorZ_get_ok(ptr);
- NodeFeatures res_hu_conv = new NodeFeatures(null, res);
+ NodeFeatures res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new NodeFeatures(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_NodeFeaturesDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_NodeFeaturesDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_NodeFeaturesDecodeErrorZ ok(NodeFeatures o) {
long ret = bindings.CResult_NodeFeaturesDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NodeFeaturesDecodeErrorZ ret_hu_conv = Result_NodeFeaturesDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_NodeIdDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_NodeIdDecodeErrorZ_get_ok(ptr);
- NodeId res_hu_conv = new NodeId(null, res);
+ NodeId res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new NodeId(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_NodeIdDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_NodeIdDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_NodeIdDecodeErrorZ ok(NodeId o) {
long ret = bindings.CResult_NodeIdDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NodeIdDecodeErrorZ ret_hu_conv = Result_NodeIdDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_NodeIdDecodeErrorZ clone() {
long ret = bindings.CResult_NodeIdDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NodeIdDecodeErrorZ ret_hu_conv = Result_NodeIdDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_NodeInfoDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_NodeInfoDecodeErrorZ_get_ok(ptr);
- NodeInfo res_hu_conv = new NodeInfo(null, res);
+ NodeInfo res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new NodeInfo(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_NodeInfoDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_NodeInfoDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_NodeInfoDecodeErrorZ ok(NodeInfo o) {
long ret = bindings.CResult_NodeInfoDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NodeInfoDecodeErrorZ ret_hu_conv = Result_NodeInfoDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_NodeInfoDecodeErrorZ clone() {
long ret = bindings.CResult_NodeInfoDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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_NoneAPIErrorZ ok() {
long ret = bindings.CResult_NoneAPIErrorZ_ok();
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public static Result_NoneAPIErrorZ err(APIError e) {
long ret = bindings.CResult_NoneAPIErrorZ_err(e.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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 clone() {
long ret = bindings.CResult_NoneAPIErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public static Result_NoneChannelMonitorUpdateErrZ ok() {
long ret = bindings.CResult_NoneChannelMonitorUpdateErrZ_ok();
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneChannelMonitorUpdateErrZ ret_hu_conv = Result_NoneChannelMonitorUpdateErrZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public static Result_NoneChannelMonitorUpdateErrZ err(org.ldk.enums.ChannelMonitorUpdateErr e) {
long ret = bindings.CResult_NoneChannelMonitorUpdateErrZ_err(e);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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 clone() {
long ret = bindings.CResult_NoneChannelMonitorUpdateErrZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneChannelMonitorUpdateErrZ ret_hu_conv = Result_NoneChannelMonitorUpdateErrZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public static Result_NoneErrorZ ok() {
long ret = bindings.CResult_NoneErrorZ_ok();
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneErrorZ ret_hu_conv = Result_NoneErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public static Result_NoneErrorZ err(org.ldk.enums.IOError e) {
long ret = bindings.CResult_NoneErrorZ_err(e);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneErrorZ ret_hu_conv = Result_NoneErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_NoneErrorZ clone() {
long ret = bindings.CResult_NoneErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneErrorZ ret_hu_conv = Result_NoneErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_NoneLightningErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_NoneLightningErrorZ_get_err(ptr);
- LightningError err_hu_conv = new LightningError(null, err);
+ LightningError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new LightningError(null, err); }
err_hu_conv.ptrs_to.add(this);
this.err = err_hu_conv;
}
*/
public static Result_NoneLightningErrorZ ok() {
long ret = bindings.CResult_NoneLightningErrorZ_ok();
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public static Result_NoneLightningErrorZ err(LightningError e) {
long ret = bindings.CResult_NoneLightningErrorZ_err(e == null ? 0 : e.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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 clone() {
long ret = bindings.CResult_NoneLightningErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_NoneMonitorUpdateErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_NoneMonitorUpdateErrorZ_get_err(ptr);
- MonitorUpdateError err_hu_conv = new MonitorUpdateError(null, err);
+ 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;
}
*/
public static Result_NoneMonitorUpdateErrorZ ok() {
long ret = bindings.CResult_NoneMonitorUpdateErrorZ_ok();
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneMonitorUpdateErrorZ ret_hu_conv = Result_NoneMonitorUpdateErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public static Result_NoneMonitorUpdateErrorZ err(MonitorUpdateError e) {
long ret = bindings.CResult_NoneMonitorUpdateErrorZ_err(e == null ? 0 : e.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneMonitorUpdateErrorZ ret_hu_conv = Result_NoneMonitorUpdateErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_NoneMonitorUpdateErrorZ clone() {
long ret = bindings.CResult_NoneMonitorUpdateErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneMonitorUpdateErrorZ ret_hu_conv = Result_NoneMonitorUpdateErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public static Result_NoneNoneZ ok() {
long ret = bindings.CResult_NoneNoneZ_ok();
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public static Result_NoneNoneZ err() {
long ret = bindings.CResult_NoneNoneZ_err();
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_NoneNoneZ clone() {
long ret = bindings.CResult_NoneNoneZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public static Result_NonePaymentSendFailureZ ok() {
long ret = bindings.CResult_NonePaymentSendFailureZ_ok();
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NonePaymentSendFailureZ ret_hu_conv = Result_NonePaymentSendFailureZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public static Result_NonePaymentSendFailureZ err(PaymentSendFailure e) {
long ret = bindings.CResult_NonePaymentSendFailureZ_err(e.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NonePaymentSendFailureZ ret_hu_conv = Result_NonePaymentSendFailureZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_NonePaymentSendFailureZ clone() {
long ret = bindings.CResult_NonePaymentSendFailureZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NonePaymentSendFailureZ ret_hu_conv = Result_NonePaymentSendFailureZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_NonePeerHandleErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_NonePeerHandleErrorZ_get_err(ptr);
- PeerHandleError err_hu_conv = new PeerHandleError(null, err);
+ PeerHandleError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new PeerHandleError(null, err); }
err_hu_conv.ptrs_to.add(this);
this.err = err_hu_conv;
}
*/
public static Result_NonePeerHandleErrorZ ok() {
long ret = bindings.CResult_NonePeerHandleErrorZ_ok();
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NonePeerHandleErrorZ ret_hu_conv = Result_NonePeerHandleErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public static Result_NonePeerHandleErrorZ err(PeerHandleError e) {
long ret = bindings.CResult_NonePeerHandleErrorZ_err(e == null ? 0 : e.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NonePeerHandleErrorZ ret_hu_conv = Result_NonePeerHandleErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_NonePeerHandleErrorZ clone() {
long ret = bindings.CResult_NonePeerHandleErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NonePeerHandleErrorZ ret_hu_conv = Result_NonePeerHandleErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public static Result_NoneSemanticErrorZ ok() {
long ret = bindings.CResult_NoneSemanticErrorZ_ok();
- if (ret >= 0 && ret < 1024) { return null; }
+ 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_NoneSemanticErrorZ err(org.ldk.enums.SemanticError e) {
long ret = bindings.CResult_NoneSemanticErrorZ_err(e);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneSemanticErrorZ ret_hu_conv = Result_NoneSemanticErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_NoneSemanticErrorZ clone() {
long ret = bindings.CResult_NoneSemanticErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneSemanticErrorZ ret_hu_conv = Result_NoneSemanticErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_OpenChannelDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_OpenChannelDecodeErrorZ_get_ok(ptr);
- OpenChannel res_hu_conv = new OpenChannel(null, res);
+ OpenChannel res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new OpenChannel(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_OpenChannelDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_OpenChannelDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_OpenChannelDecodeErrorZ ok(OpenChannel o) {
long ret = bindings.CResult_OpenChannelDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_OpenChannelDecodeErrorZ ret_hu_conv = Result_OpenChannelDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_OpenChannelDecodeErrorZ clone() {
long ret = bindings.CResult_OpenChannelDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_OpenChannelDecodeErrorZ ret_hu_conv = Result_OpenChannelDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_OutPointDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_OutPointDecodeErrorZ_get_ok(ptr);
- OutPoint res_hu_conv = new OutPoint(null, res);
+ OutPoint res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new OutPoint(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_OutPointDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_OutPointDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_OutPointDecodeErrorZ ok(OutPoint o) {
long ret = bindings.CResult_OutPointDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_OutPointDecodeErrorZ ret_hu_conv = Result_OutPointDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_OutPointDecodeErrorZ clone() {
long ret = bindings.CResult_OutPointDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_OutPointDecodeErrorZ ret_hu_conv = Result_OutPointDecodeErrorZ.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_PayeeDecodeErrorZ extends CommonBase {
+ private Result_PayeeDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_PayeeDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_PayeeDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_PayeeDecodeErrorZ_result_ok(ptr)) {
+ return new Result_PayeeDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_PayeeDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_PayeeDecodeErrorZ_OK extends Result_PayeeDecodeErrorZ {
+ public final Payee res;
+ private Result_PayeeDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long res = bindings.LDKCResult_PayeeDecodeErrorZ_get_ok(ptr);
+ Payee res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new Payee(null, res); }
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ }
+
+ public static final class Result_PayeeDecodeErrorZ_Err extends Result_PayeeDecodeErrorZ {
+ public final DecodeError err;
+ private Result_PayeeDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long err = bindings.LDKCResult_PayeeDecodeErrorZ_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_PayeeDecodeErrorZ in the success state.
+ */
+ public static Result_PayeeDecodeErrorZ ok(Payee o) {
+ long ret = bindings.CResult_PayeeDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_PayeeDecodeErrorZ ret_hu_conv = Result_PayeeDecodeErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Creates a new CResult_PayeeDecodeErrorZ in the error state.
+ */
+ public static Result_PayeeDecodeErrorZ err(DecodeError e) {
+ long ret = bindings.CResult_PayeeDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_PayeeDecodeErrorZ ret_hu_conv = Result_PayeeDecodeErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Creates a new CResult_PayeeDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+ public Result_PayeeDecodeErrorZ clone() {
+ long ret = bindings.CResult_PayeeDecodeErrorZ_clone(this.ptr);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_PayeeDecodeErrorZ ret_hu_conv = Result_PayeeDecodeErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+}
private Result_PayeePubKeyErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_PayeePubKeyErrorZ_get_ok(ptr);
- PayeePubKey res_hu_conv = new PayeePubKey(null, res);
+ PayeePubKey res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new PayeePubKey(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
*/
public static Result_PayeePubKeyErrorZ ok(PayeePubKey o) {
long ret = bindings.CResult_PayeePubKeyErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_PayeePubKeyErrorZ ret_hu_conv = Result_PayeePubKeyErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_PayeePubKeyErrorZ clone() {
long ret = bindings.CResult_PayeePubKeyErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_PayeePubKeyErrorZ ret_hu_conv = Result_PayeePubKeyErrorZ.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_PaymentIdDecodeErrorZ extends CommonBase {
- private Result_PaymentIdDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
- protected void finalize() throws Throwable {
- if (ptr != 0) { bindings.CResult_PaymentIdDecodeErrorZ_free(ptr); } super.finalize();
- }
-
- static Result_PaymentIdDecodeErrorZ constr_from_ptr(long ptr) {
- if (bindings.LDKCResult_PaymentIdDecodeErrorZ_result_ok(ptr)) {
- return new Result_PaymentIdDecodeErrorZ_OK(null, ptr);
- } else {
- return new Result_PaymentIdDecodeErrorZ_Err(null, ptr);
- }
- }
- public static final class Result_PaymentIdDecodeErrorZ_OK extends Result_PaymentIdDecodeErrorZ {
- public final PaymentId res;
- private Result_PaymentIdDecodeErrorZ_OK(Object _dummy, long ptr) {
- super(_dummy, ptr);
- long res = bindings.LDKCResult_PaymentIdDecodeErrorZ_get_ok(ptr);
- PaymentId res_hu_conv = new PaymentId(null, res);
- res_hu_conv.ptrs_to.add(this);
- this.res = res_hu_conv;
- }
- }
-
- public static final class Result_PaymentIdDecodeErrorZ_Err extends Result_PaymentIdDecodeErrorZ {
- public final DecodeError err;
- private Result_PaymentIdDecodeErrorZ_Err(Object _dummy, long ptr) {
- super(_dummy, ptr);
- long err = bindings.LDKCResult_PaymentIdDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
- err_hu_conv.ptrs_to.add(this);
- this.err = err_hu_conv;
- }
- }
-
- /**
- * Creates a new CResult_PaymentIdDecodeErrorZ in the success state.
- */
- public static Result_PaymentIdDecodeErrorZ ok(PaymentId o) {
- long ret = bindings.CResult_PaymentIdDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
- Result_PaymentIdDecodeErrorZ ret_hu_conv = Result_PaymentIdDecodeErrorZ.constr_from_ptr(ret);
- return ret_hu_conv;
- }
-
- /**
- * Creates a new CResult_PaymentIdDecodeErrorZ in the error state.
- */
- public static Result_PaymentIdDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_PaymentIdDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
- Result_PaymentIdDecodeErrorZ ret_hu_conv = Result_PaymentIdDecodeErrorZ.constr_from_ptr(ret);
- return ret_hu_conv;
- }
-
- /**
- * Creates a new CResult_PaymentIdDecodeErrorZ which has the same data as `orig`
- * but with all dynamically-allocated buffers duplicated in new buffers.
- */
- public Result_PaymentIdDecodeErrorZ clone() {
- long ret = bindings.CResult_PaymentIdDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- Result_PaymentIdDecodeErrorZ ret_hu_conv = Result_PaymentIdDecodeErrorZ.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_PaymentIdPaymentErrorZ extends CommonBase {
+ private Result_PaymentIdPaymentErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_PaymentIdPaymentErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_PaymentIdPaymentErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_PaymentIdPaymentErrorZ_result_ok(ptr)) {
+ return new Result_PaymentIdPaymentErrorZ_OK(null, ptr);
+ } else {
+ return new Result_PaymentIdPaymentErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_PaymentIdPaymentErrorZ_OK extends Result_PaymentIdPaymentErrorZ {
+ public final byte[] res;
+ private Result_PaymentIdPaymentErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ this.res = bindings.LDKCResult_PaymentIdPaymentErrorZ_get_ok(ptr);
+ }
+ }
+
+ public static final class Result_PaymentIdPaymentErrorZ_Err extends Result_PaymentIdPaymentErrorZ {
+ public final PaymentError err;
+ private Result_PaymentIdPaymentErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long err = bindings.LDKCResult_PaymentIdPaymentErrorZ_get_err(ptr);
+ PaymentError err_hu_conv = PaymentError.constr_from_ptr(err);
+ err_hu_conv.ptrs_to.add(this);
+ this.err = err_hu_conv;
+ }
+ }
+
+ /**
+ * Creates a new CResult_PaymentIdPaymentErrorZ in the success state.
+ */
+ public static Result_PaymentIdPaymentErrorZ ok(byte[] o) {
+ long ret = bindings.CResult_PaymentIdPaymentErrorZ_ok(o);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_PaymentIdPaymentErrorZ ret_hu_conv = Result_PaymentIdPaymentErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Creates a new CResult_PaymentIdPaymentErrorZ in the error state.
+ */
+ public static Result_PaymentIdPaymentErrorZ err(PaymentError e) {
+ long ret = bindings.CResult_PaymentIdPaymentErrorZ_err(e.ptr);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_PaymentIdPaymentErrorZ ret_hu_conv = Result_PaymentIdPaymentErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Creates a new CResult_PaymentIdPaymentErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+ public Result_PaymentIdPaymentErrorZ clone() {
+ long ret = bindings.CResult_PaymentIdPaymentErrorZ_clone(this.ptr);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_PaymentIdPaymentErrorZ ret_hu_conv = Result_PaymentIdPaymentErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+}
}
}
public static final class Result_PaymentIdPaymentSendFailureZ_OK extends Result_PaymentIdPaymentSendFailureZ {
- public final PaymentId res;
+ public final byte[] res;
private Result_PaymentIdPaymentSendFailureZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
- long res = bindings.LDKCResult_PaymentIdPaymentSendFailureZ_get_ok(ptr);
- PaymentId res_hu_conv = new PaymentId(null, res);
- res_hu_conv.ptrs_to.add(this);
- this.res = res_hu_conv;
+ this.res = bindings.LDKCResult_PaymentIdPaymentSendFailureZ_get_ok(ptr);
}
}
/**
* Creates a new CResult_PaymentIdPaymentSendFailureZ in the success state.
*/
- public static Result_PaymentIdPaymentSendFailureZ ok(PaymentId o) {
- long ret = bindings.CResult_PaymentIdPaymentSendFailureZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ public static Result_PaymentIdPaymentSendFailureZ ok(byte[] o) {
+ long ret = bindings.CResult_PaymentIdPaymentSendFailureZ_ok(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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_PaymentIdPaymentSendFailureZ ret_hu_conv = Result_PaymentIdPaymentSendFailureZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_PaymentIdPaymentSendFailureZ clone() {
long ret = bindings.CResult_PaymentIdPaymentSendFailureZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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_PaymentSecretAPIErrorZ ok(byte[] o) {
long ret = bindings.CResult_PaymentSecretAPIErrorZ_ok(o);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_PaymentSecretAPIErrorZ ret_hu_conv = Result_PaymentSecretAPIErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_PaymentSecretAPIErrorZ clone() {
long ret = bindings.CResult_PaymentSecretAPIErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_PaymentSecretAPIErrorZ ret_hu_conv = Result_PaymentSecretAPIErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_PingDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_PingDecodeErrorZ_get_ok(ptr);
- Ping res_hu_conv = new Ping(null, res);
+ Ping res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new Ping(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_PingDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_PingDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_PingDecodeErrorZ ok(Ping o) {
long ret = bindings.CResult_PingDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_PingDecodeErrorZ ret_hu_conv = Result_PingDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_PingDecodeErrorZ clone() {
long ret = bindings.CResult_PingDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_PingDecodeErrorZ ret_hu_conv = Result_PingDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_PongDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_PongDecodeErrorZ_get_ok(ptr);
- Pong res_hu_conv = new Pong(null, res);
+ Pong res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new Pong(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_PongDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_PongDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_PongDecodeErrorZ ok(Pong o) {
long ret = bindings.CResult_PongDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_PongDecodeErrorZ ret_hu_conv = Result_PongDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_PongDecodeErrorZ clone() {
long ret = bindings.CResult_PongDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_PongDecodeErrorZ ret_hu_conv = Result_PongDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_PositiveTimestampCreationErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_PositiveTimestampCreationErrorZ_get_ok(ptr);
- PositiveTimestamp res_hu_conv = new PositiveTimestamp(null, res);
+ PositiveTimestamp res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new PositiveTimestamp(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
*/
public static Result_PositiveTimestampCreationErrorZ ok(PositiveTimestamp o) {
long ret = bindings.CResult_PositiveTimestampCreationErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_PositiveTimestampCreationErrorZ ret_hu_conv = Result_PositiveTimestampCreationErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_PositiveTimestampCreationErrorZ clone() {
long ret = bindings.CResult_PositiveTimestampCreationErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_PositiveTimestampCreationErrorZ ret_hu_conv = Result_PositiveTimestampCreationErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_PrivateRouteCreationErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_PrivateRouteCreationErrorZ_get_ok(ptr);
- PrivateRoute res_hu_conv = new PrivateRoute(null, res);
+ PrivateRoute res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new PrivateRoute(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
*/
public static Result_PrivateRouteCreationErrorZ ok(PrivateRoute o) {
long ret = bindings.CResult_PrivateRouteCreationErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_PrivateRouteCreationErrorZ ret_hu_conv = Result_PrivateRouteCreationErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_PrivateRouteCreationErrorZ clone() {
long ret = bindings.CResult_PrivateRouteCreationErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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_PublicKeyErrorZ ok(byte[] o) {
long ret = bindings.CResult_PublicKeyErrorZ_ok(o);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_PublicKeyErrorZ ret_hu_conv = Result_PublicKeyErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_PublicKeyErrorZ clone() {
long ret = bindings.CResult_PublicKeyErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_PublicKeyErrorZ ret_hu_conv = Result_PublicKeyErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_QueryChannelRangeDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_QueryChannelRangeDecodeErrorZ_get_ok(ptr);
- QueryChannelRange res_hu_conv = new QueryChannelRange(null, res);
+ QueryChannelRange res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new QueryChannelRange(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_QueryChannelRangeDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_QueryChannelRangeDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_QueryChannelRangeDecodeErrorZ ok(QueryChannelRange o) {
long ret = bindings.CResult_QueryChannelRangeDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_QueryChannelRangeDecodeErrorZ ret_hu_conv = Result_QueryChannelRangeDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_QueryChannelRangeDecodeErrorZ clone() {
long ret = bindings.CResult_QueryChannelRangeDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_QueryChannelRangeDecodeErrorZ ret_hu_conv = Result_QueryChannelRangeDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_QueryShortChannelIdsDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_QueryShortChannelIdsDecodeErrorZ_get_ok(ptr);
- QueryShortChannelIds res_hu_conv = new QueryShortChannelIds(null, res);
+ QueryShortChannelIds res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new QueryShortChannelIds(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_QueryShortChannelIdsDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_QueryShortChannelIdsDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_QueryShortChannelIdsDecodeErrorZ ok(QueryShortChannelIds o) {
long ret = bindings.CResult_QueryShortChannelIdsDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_QueryShortChannelIdsDecodeErrorZ ret_hu_conv = Result_QueryShortChannelIdsDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_QueryShortChannelIdsDecodeErrorZ clone() {
long ret = bindings.CResult_QueryShortChannelIdsDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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_RecoverableSignatureNoneZ ok(byte[] arg) {
long ret = bindings.CResult_RecoverableSignatureNoneZ_ok(arg);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_RecoverableSignatureNoneZ ret_hu_conv = Result_RecoverableSignatureNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public static Result_RecoverableSignatureNoneZ err() {
long ret = bindings.CResult_RecoverableSignatureNoneZ_err();
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_RecoverableSignatureNoneZ ret_hu_conv = Result_RecoverableSignatureNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_RecoverableSignatureNoneZ clone() {
long ret = bindings.CResult_RecoverableSignatureNoneZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_RecoverableSignatureNoneZ ret_hu_conv = Result_RecoverableSignatureNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_ReplyChannelRangeDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_ReplyChannelRangeDecodeErrorZ_get_ok(ptr);
- ReplyChannelRange res_hu_conv = new ReplyChannelRange(null, res);
+ ReplyChannelRange res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new ReplyChannelRange(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_ReplyChannelRangeDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_ReplyChannelRangeDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_ReplyChannelRangeDecodeErrorZ ok(ReplyChannelRange o) {
long ret = bindings.CResult_ReplyChannelRangeDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_ReplyChannelRangeDecodeErrorZ ret_hu_conv = Result_ReplyChannelRangeDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_ReplyChannelRangeDecodeErrorZ clone() {
long ret = bindings.CResult_ReplyChannelRangeDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_ReplyChannelRangeDecodeErrorZ ret_hu_conv = Result_ReplyChannelRangeDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_ReplyShortChannelIdsEndDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ_get_ok(ptr);
- ReplyShortChannelIdsEnd res_hu_conv = new ReplyShortChannelIdsEnd(null, res);
+ ReplyShortChannelIdsEnd res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new ReplyShortChannelIdsEnd(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_ReplyShortChannelIdsEndDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_ReplyShortChannelIdsEndDecodeErrorZ ok(ReplyShortChannelIdsEnd o) {
long ret = bindings.CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_ReplyShortChannelIdsEndDecodeErrorZ ret_hu_conv = Result_ReplyShortChannelIdsEndDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_ReplyShortChannelIdsEndDecodeErrorZ clone() {
long ret = bindings.CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_ReplyShortChannelIdsEndDecodeErrorZ ret_hu_conv = Result_ReplyShortChannelIdsEndDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_RevokeAndACKDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_RevokeAndACKDecodeErrorZ_get_ok(ptr);
- RevokeAndACK res_hu_conv = new RevokeAndACK(null, res);
+ RevokeAndACK res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new RevokeAndACK(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_RevokeAndACKDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_RevokeAndACKDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_RevokeAndACKDecodeErrorZ ok(RevokeAndACK o) {
long ret = bindings.CResult_RevokeAndACKDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_RevokeAndACKDecodeErrorZ ret_hu_conv = Result_RevokeAndACKDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_RevokeAndACKDecodeErrorZ clone() {
long ret = bindings.CResult_RevokeAndACKDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_RevokeAndACKDecodeErrorZ ret_hu_conv = Result_RevokeAndACKDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_RouteDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_RouteDecodeErrorZ_get_ok(ptr);
- Route res_hu_conv = new Route(null, res);
+ Route res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new Route(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_RouteDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_RouteDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_RouteDecodeErrorZ ok(Route o) {
long ret = bindings.CResult_RouteDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_RouteDecodeErrorZ ret_hu_conv = Result_RouteDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_RouteDecodeErrorZ clone() {
long ret = bindings.CResult_RouteDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_RouteDecodeErrorZ ret_hu_conv = Result_RouteDecodeErrorZ.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_RouteHintDecodeErrorZ extends CommonBase {
+ private Result_RouteHintDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_RouteHintDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_RouteHintDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_RouteHintDecodeErrorZ_result_ok(ptr)) {
+ return new Result_RouteHintDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_RouteHintDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_RouteHintDecodeErrorZ_OK extends Result_RouteHintDecodeErrorZ {
+ public final RouteHint res;
+ private Result_RouteHintDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long res = bindings.LDKCResult_RouteHintDecodeErrorZ_get_ok(ptr);
+ RouteHint res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new RouteHint(null, res); }
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ }
+
+ public static final class Result_RouteHintDecodeErrorZ_Err extends Result_RouteHintDecodeErrorZ {
+ public final DecodeError err;
+ private Result_RouteHintDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long err = bindings.LDKCResult_RouteHintDecodeErrorZ_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_RouteHintDecodeErrorZ in the success state.
+ */
+ public static Result_RouteHintDecodeErrorZ ok(RouteHint o) {
+ long ret = bindings.CResult_RouteHintDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_RouteHintDecodeErrorZ ret_hu_conv = Result_RouteHintDecodeErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Creates a new CResult_RouteHintDecodeErrorZ in the error state.
+ */
+ public static Result_RouteHintDecodeErrorZ err(DecodeError e) {
+ long ret = bindings.CResult_RouteHintDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_RouteHintDecodeErrorZ ret_hu_conv = Result_RouteHintDecodeErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Creates a new CResult_RouteHintDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+ public Result_RouteHintDecodeErrorZ clone() {
+ long ret = bindings.CResult_RouteHintDecodeErrorZ_clone(this.ptr);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_RouteHintDecodeErrorZ ret_hu_conv = Result_RouteHintDecodeErrorZ.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_RouteHintHopDecodeErrorZ extends CommonBase {
+ private Result_RouteHintHopDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_RouteHintHopDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_RouteHintHopDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_RouteHintHopDecodeErrorZ_result_ok(ptr)) {
+ return new Result_RouteHintHopDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_RouteHintHopDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_RouteHintHopDecodeErrorZ_OK extends Result_RouteHintHopDecodeErrorZ {
+ public final RouteHintHop res;
+ private Result_RouteHintHopDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long res = bindings.LDKCResult_RouteHintHopDecodeErrorZ_get_ok(ptr);
+ RouteHintHop res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new RouteHintHop(null, res); }
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ }
+
+ public static final class Result_RouteHintHopDecodeErrorZ_Err extends Result_RouteHintHopDecodeErrorZ {
+ public final DecodeError err;
+ private Result_RouteHintHopDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long err = bindings.LDKCResult_RouteHintHopDecodeErrorZ_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_RouteHintHopDecodeErrorZ in the success state.
+ */
+ public static Result_RouteHintHopDecodeErrorZ ok(RouteHintHop o) {
+ long ret = bindings.CResult_RouteHintHopDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_RouteHintHopDecodeErrorZ ret_hu_conv = Result_RouteHintHopDecodeErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Creates a new CResult_RouteHintHopDecodeErrorZ in the error state.
+ */
+ public static Result_RouteHintHopDecodeErrorZ err(DecodeError e) {
+ long ret = bindings.CResult_RouteHintHopDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_RouteHintHopDecodeErrorZ ret_hu_conv = Result_RouteHintHopDecodeErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Creates a new CResult_RouteHintHopDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+ public Result_RouteHintHopDecodeErrorZ clone() {
+ long ret = bindings.CResult_RouteHintHopDecodeErrorZ_clone(this.ptr);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_RouteHintHopDecodeErrorZ ret_hu_conv = Result_RouteHintHopDecodeErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+}
private Result_RouteHopDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_RouteHopDecodeErrorZ_get_ok(ptr);
- RouteHop res_hu_conv = new RouteHop(null, res);
+ RouteHop res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new RouteHop(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_RouteHopDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_RouteHopDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_RouteHopDecodeErrorZ ok(RouteHop o) {
long ret = bindings.CResult_RouteHopDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_RouteHopDecodeErrorZ ret_hu_conv = Result_RouteHopDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_RouteHopDecodeErrorZ clone() {
long ret = bindings.CResult_RouteHopDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_RouteHopDecodeErrorZ ret_hu_conv = Result_RouteHopDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_RouteLightningErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_RouteLightningErrorZ_get_ok(ptr);
- Route res_hu_conv = new Route(null, res);
+ Route res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new Route(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_RouteLightningErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_RouteLightningErrorZ_get_err(ptr);
- LightningError err_hu_conv = new LightningError(null, err);
+ LightningError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new LightningError(null, err); }
err_hu_conv.ptrs_to.add(this);
this.err = err_hu_conv;
}
*/
public static Result_RouteLightningErrorZ ok(Route o) {
long ret = bindings.CResult_RouteLightningErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_RouteLightningErrorZ ret_hu_conv = Result_RouteLightningErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_RouteLightningErrorZ clone() {
long ret = bindings.CResult_RouteLightningErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_RouteLightningErrorZ ret_hu_conv = Result_RouteLightningErrorZ.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_RouteParametersDecodeErrorZ extends CommonBase {
+ private Result_RouteParametersDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_RouteParametersDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_RouteParametersDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_RouteParametersDecodeErrorZ_result_ok(ptr)) {
+ return new Result_RouteParametersDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_RouteParametersDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_RouteParametersDecodeErrorZ_OK extends Result_RouteParametersDecodeErrorZ {
+ public final RouteParameters res;
+ private Result_RouteParametersDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long res = bindings.LDKCResult_RouteParametersDecodeErrorZ_get_ok(ptr);
+ RouteParameters res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new RouteParameters(null, res); }
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ }
+
+ public static final class Result_RouteParametersDecodeErrorZ_Err extends Result_RouteParametersDecodeErrorZ {
+ public final DecodeError err;
+ private Result_RouteParametersDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long err = bindings.LDKCResult_RouteParametersDecodeErrorZ_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_RouteParametersDecodeErrorZ in the success state.
+ */
+ public static Result_RouteParametersDecodeErrorZ ok(RouteParameters o) {
+ long ret = bindings.CResult_RouteParametersDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_RouteParametersDecodeErrorZ ret_hu_conv = Result_RouteParametersDecodeErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Creates a new CResult_RouteParametersDecodeErrorZ in the error state.
+ */
+ public static Result_RouteParametersDecodeErrorZ err(DecodeError e) {
+ long ret = bindings.CResult_RouteParametersDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_RouteParametersDecodeErrorZ ret_hu_conv = Result_RouteParametersDecodeErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Creates a new CResult_RouteParametersDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+ public Result_RouteParametersDecodeErrorZ clone() {
+ long ret = bindings.CResult_RouteParametersDecodeErrorZ_clone(this.ptr);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_RouteParametersDecodeErrorZ ret_hu_conv = Result_RouteParametersDecodeErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+}
private Result_RoutingFeesDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_RoutingFeesDecodeErrorZ_get_ok(ptr);
- RoutingFees res_hu_conv = new RoutingFees(null, res);
+ RoutingFees res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new RoutingFees(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_RoutingFeesDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_RoutingFeesDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_RoutingFeesDecodeErrorZ ok(RoutingFees o) {
long ret = bindings.CResult_RoutingFeesDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_RoutingFeesDecodeErrorZ ret_hu_conv = Result_RoutingFeesDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_RoutingFeesDecodeErrorZ clone() {
long ret = bindings.CResult_RoutingFeesDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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_SecretKeyErrorZ ok(byte[] o) {
long ret = bindings.CResult_SecretKeyErrorZ_ok(o);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_SecretKeyErrorZ ret_hu_conv = Result_SecretKeyErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_ShutdownDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_ShutdownDecodeErrorZ_get_ok(ptr);
- Shutdown res_hu_conv = new Shutdown(null, res);
+ Shutdown res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new Shutdown(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_ShutdownDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_ShutdownDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_ShutdownDecodeErrorZ ok(Shutdown o) {
long ret = bindings.CResult_ShutdownDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_ShutdownDecodeErrorZ ret_hu_conv = Result_ShutdownDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_ShutdownDecodeErrorZ clone() {
long ret = bindings.CResult_ShutdownDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_ShutdownDecodeErrorZ ret_hu_conv = Result_ShutdownDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_ShutdownScriptDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_ShutdownScriptDecodeErrorZ_get_ok(ptr);
- ShutdownScript res_hu_conv = new ShutdownScript(null, res);
+ ShutdownScript res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new ShutdownScript(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_ShutdownScriptDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_ShutdownScriptDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_ShutdownScriptDecodeErrorZ ok(ShutdownScript o) {
long ret = bindings.CResult_ShutdownScriptDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_ShutdownScriptDecodeErrorZ ret_hu_conv = Result_ShutdownScriptDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_ShutdownScriptDecodeErrorZ clone() {
long ret = bindings.CResult_ShutdownScriptDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_ShutdownScriptDecodeErrorZ ret_hu_conv = Result_ShutdownScriptDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_ShutdownScriptInvalidShutdownScriptZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_ShutdownScriptInvalidShutdownScriptZ_get_ok(ptr);
- ShutdownScript res_hu_conv = new ShutdownScript(null, res);
+ ShutdownScript res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new ShutdownScript(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_ShutdownScriptInvalidShutdownScriptZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_ShutdownScriptInvalidShutdownScriptZ_get_err(ptr);
- InvalidShutdownScript err_hu_conv = new InvalidShutdownScript(null, err);
+ InvalidShutdownScript err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new InvalidShutdownScript(null, err); }
err_hu_conv.ptrs_to.add(this);
this.err = err_hu_conv;
}
*/
public static Result_ShutdownScriptInvalidShutdownScriptZ ok(ShutdownScript o) {
long ret = bindings.CResult_ShutdownScriptInvalidShutdownScriptZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_ShutdownScriptInvalidShutdownScriptZ ret_hu_conv = Result_ShutdownScriptInvalidShutdownScriptZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_ShutdownScriptInvalidShutdownScriptZ clone() {
long ret = bindings.CResult_ShutdownScriptInvalidShutdownScriptZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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_SiPrefixNoneZ ok(org.ldk.enums.SiPrefix o) {
long ret = bindings.CResult_SiPrefixNoneZ_ok(o);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_SiPrefixNoneZ ret_hu_conv = Result_SiPrefixNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public static Result_SiPrefixNoneZ err() {
long ret = bindings.CResult_SiPrefixNoneZ_err();
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_SiPrefixNoneZ ret_hu_conv = Result_SiPrefixNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_SiPrefixNoneZ clone() {
long ret = bindings.CResult_SiPrefixNoneZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_SiPrefixNoneZ ret_hu_conv = Result_SiPrefixNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_SignDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_SignDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_SignDecodeErrorZ ok(Sign o) {
long ret = bindings.CResult_SignDecodeErrorZ_ok(o == null ? 0 : o.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public static Result_SignDecodeErrorZ err(DecodeError e) {
long ret = bindings.CResult_SignDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_SignDecodeErrorZ ret_hu_conv = Result_SignDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_SignDecodeErrorZ clone() {
long ret = bindings.CResult_SignDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_SignDecodeErrorZ ret_hu_conv = Result_SignDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public static Result_SignatureNoneZ ok(byte[] o) {
long ret = bindings.CResult_SignatureNoneZ_ok(o);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public static Result_SignatureNoneZ err() {
long ret = bindings.CResult_SignatureNoneZ_err();
- if (ret >= 0 && ret < 1024) { return null; }
+ 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 clone() {
long ret = bindings.CResult_SignatureNoneZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_SignedRawInvoiceNoneZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_SignedRawInvoiceNoneZ_get_ok(ptr);
- SignedRawInvoice res_hu_conv = new SignedRawInvoice(null, res);
+ SignedRawInvoice res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new SignedRawInvoice(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
*/
public static Result_SignedRawInvoiceNoneZ ok(SignedRawInvoice o) {
long ret = bindings.CResult_SignedRawInvoiceNoneZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_SignedRawInvoiceNoneZ ret_hu_conv = Result_SignedRawInvoiceNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public static Result_SignedRawInvoiceNoneZ err() {
long ret = bindings.CResult_SignedRawInvoiceNoneZ_err();
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_SignedRawInvoiceNoneZ ret_hu_conv = Result_SignedRawInvoiceNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_SignedRawInvoiceNoneZ clone() {
long ret = bindings.CResult_SignedRawInvoiceNoneZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_SignedRawInvoiceNoneZ ret_hu_conv = Result_SignedRawInvoiceNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_SpendableOutputDescriptorDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_SpendableOutputDescriptorDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_SpendableOutputDescriptorDecodeErrorZ ok(SpendableOutputDescriptor o) {
long ret = bindings.CResult_SpendableOutputDescriptorDecodeErrorZ_ok(o.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_SpendableOutputDescriptorDecodeErrorZ ret_hu_conv = Result_SpendableOutputDescriptorDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_SpendableOutputDescriptorDecodeErrorZ clone() {
long ret = bindings.CResult_SpendableOutputDescriptorDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_SpendableOutputDescriptorDecodeErrorZ ret_hu_conv = Result_SpendableOutputDescriptorDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_StaticPaymentOutputDescriptorDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok(ptr);
- StaticPaymentOutputDescriptor res_hu_conv = new StaticPaymentOutputDescriptor(null, res);
+ StaticPaymentOutputDescriptor res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new StaticPaymentOutputDescriptor(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_StaticPaymentOutputDescriptorDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_StaticPaymentOutputDescriptorDecodeErrorZ ok(StaticPaymentOutputDescriptor o) {
long ret = bindings.CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_StaticPaymentOutputDescriptorDecodeErrorZ ret_hu_conv = Result_StaticPaymentOutputDescriptorDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_StaticPaymentOutputDescriptorDecodeErrorZ clone() {
long ret = bindings.CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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_StringErrorZ ok(java.lang.String o) {
long ret = bindings.CResult_StringErrorZ_ok(o);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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_TransactionNoneZ ok(byte[] o) {
long ret = bindings.CResult_TransactionNoneZ_ok(o);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_TransactionNoneZ ret_hu_conv = Result_TransactionNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public static Result_TransactionNoneZ err() {
long ret = bindings.CResult_TransactionNoneZ_err();
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_TransactionNoneZ ret_hu_conv = Result_TransactionNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_TransactionNoneZ clone() {
long ret = bindings.CResult_TransactionNoneZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_TransactionNoneZ ret_hu_conv = Result_TransactionNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_TrustedClosingTransactionNoneZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_TrustedClosingTransactionNoneZ_get_ok(ptr);
- TrustedClosingTransaction res_hu_conv = new TrustedClosingTransaction(null, res);
+ TrustedClosingTransaction res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new TrustedClosingTransaction(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
*/
public static Result_TrustedClosingTransactionNoneZ ok(TrustedClosingTransaction o) {
long ret = bindings.CResult_TrustedClosingTransactionNoneZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
// Due to rust's strict-ownership memory model, in some cases we need to "move"
*/
public static Result_TrustedClosingTransactionNoneZ err() {
long ret = bindings.CResult_TrustedClosingTransactionNoneZ_err();
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_TrustedClosingTransactionNoneZ ret_hu_conv = Result_TrustedClosingTransactionNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_TrustedCommitmentTransactionNoneZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_TrustedCommitmentTransactionNoneZ_get_ok(ptr);
- TrustedCommitmentTransaction res_hu_conv = new TrustedCommitmentTransaction(null, res);
+ TrustedCommitmentTransaction res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new TrustedCommitmentTransaction(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
*/
public static Result_TrustedCommitmentTransactionNoneZ ok(TrustedCommitmentTransaction o) {
long ret = bindings.CResult_TrustedCommitmentTransactionNoneZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
// Due to rust's strict-ownership memory model, in some cases we need to "move"
*/
public static Result_TrustedCommitmentTransactionNoneZ err() {
long ret = bindings.CResult_TrustedCommitmentTransactionNoneZ_err();
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_TrustedCommitmentTransactionNoneZ ret_hu_conv = Result_TrustedCommitmentTransactionNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_TxCreationKeysDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_TxCreationKeysDecodeErrorZ_get_ok(ptr);
- TxCreationKeys res_hu_conv = new TxCreationKeys(null, res);
+ TxCreationKeys res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new TxCreationKeys(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_TxCreationKeysDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_TxCreationKeysDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_TxCreationKeysDecodeErrorZ ok(TxCreationKeys o) {
long ret = bindings.CResult_TxCreationKeysDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_TxCreationKeysDecodeErrorZ ret_hu_conv = Result_TxCreationKeysDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_TxCreationKeysDecodeErrorZ clone() {
long ret = bindings.CResult_TxCreationKeysDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_TxCreationKeysDecodeErrorZ ret_hu_conv = Result_TxCreationKeysDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_TxCreationKeysErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_TxCreationKeysErrorZ_get_ok(ptr);
- TxCreationKeys res_hu_conv = new TxCreationKeys(null, res);
+ TxCreationKeys res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new TxCreationKeys(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
*/
public static Result_TxCreationKeysErrorZ ok(TxCreationKeys o) {
long ret = bindings.CResult_TxCreationKeysErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_TxCreationKeysErrorZ ret_hu_conv = Result_TxCreationKeysErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_TxCreationKeysErrorZ clone() {
long ret = bindings.CResult_TxCreationKeysErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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_TxOutAccessErrorZ ok(TxOut o) {
long ret = bindings.CResult_TxOutAccessErrorZ_ok(o.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_TxOutAccessErrorZ ret_hu_conv = Result_TxOutAccessErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_TxOutAccessErrorZ clone() {
long ret = bindings.CResult_TxOutAccessErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_TxOutAccessErrorZ ret_hu_conv = Result_TxOutAccessErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_UnsignedChannelAnnouncementDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ_get_ok(ptr);
- UnsignedChannelAnnouncement res_hu_conv = new UnsignedChannelAnnouncement(null, res);
+ UnsignedChannelAnnouncement res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new UnsignedChannelAnnouncement(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_UnsignedChannelAnnouncementDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_UnsignedChannelAnnouncementDecodeErrorZ ok(UnsignedChannelAnnouncement o) {
long ret = bindings.CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_UnsignedChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_UnsignedChannelAnnouncementDecodeErrorZ clone() {
long ret = bindings.CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_UnsignedChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_UnsignedChannelUpdateDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_UnsignedChannelUpdateDecodeErrorZ_get_ok(ptr);
- UnsignedChannelUpdate res_hu_conv = new UnsignedChannelUpdate(null, res);
+ UnsignedChannelUpdate res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new UnsignedChannelUpdate(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_UnsignedChannelUpdateDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_UnsignedChannelUpdateDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_UnsignedChannelUpdateDecodeErrorZ ok(UnsignedChannelUpdate o) {
long ret = bindings.CResult_UnsignedChannelUpdateDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_UnsignedChannelUpdateDecodeErrorZ ret_hu_conv = Result_UnsignedChannelUpdateDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_UnsignedChannelUpdateDecodeErrorZ clone() {
long ret = bindings.CResult_UnsignedChannelUpdateDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_UnsignedChannelUpdateDecodeErrorZ ret_hu_conv = Result_UnsignedChannelUpdateDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_UnsignedNodeAnnouncementDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ_get_ok(ptr);
- UnsignedNodeAnnouncement res_hu_conv = new UnsignedNodeAnnouncement(null, res);
+ UnsignedNodeAnnouncement res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new UnsignedNodeAnnouncement(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_UnsignedNodeAnnouncementDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_UnsignedNodeAnnouncementDecodeErrorZ ok(UnsignedNodeAnnouncement o) {
long ret = bindings.CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_UnsignedNodeAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedNodeAnnouncementDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_UnsignedNodeAnnouncementDecodeErrorZ clone() {
long ret = bindings.CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_UnsignedNodeAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedNodeAnnouncementDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_UpdateAddHTLCDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_UpdateAddHTLCDecodeErrorZ_get_ok(ptr);
- UpdateAddHTLC res_hu_conv = new UpdateAddHTLC(null, res);
+ UpdateAddHTLC res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new UpdateAddHTLC(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_UpdateAddHTLCDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_UpdateAddHTLCDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_UpdateAddHTLCDecodeErrorZ ok(UpdateAddHTLC o) {
long ret = bindings.CResult_UpdateAddHTLCDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_UpdateAddHTLCDecodeErrorZ ret_hu_conv = Result_UpdateAddHTLCDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_UpdateAddHTLCDecodeErrorZ clone() {
long ret = bindings.CResult_UpdateAddHTLCDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_UpdateAddHTLCDecodeErrorZ ret_hu_conv = Result_UpdateAddHTLCDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_UpdateFailHTLCDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_UpdateFailHTLCDecodeErrorZ_get_ok(ptr);
- UpdateFailHTLC res_hu_conv = new UpdateFailHTLC(null, res);
+ UpdateFailHTLC res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new UpdateFailHTLC(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_UpdateFailHTLCDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_UpdateFailHTLCDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_UpdateFailHTLCDecodeErrorZ ok(UpdateFailHTLC o) {
long ret = bindings.CResult_UpdateFailHTLCDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_UpdateFailHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailHTLCDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_UpdateFailHTLCDecodeErrorZ clone() {
long ret = bindings.CResult_UpdateFailHTLCDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_UpdateFailHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailHTLCDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_UpdateFailMalformedHTLCDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ_get_ok(ptr);
- UpdateFailMalformedHTLC res_hu_conv = new UpdateFailMalformedHTLC(null, res);
+ UpdateFailMalformedHTLC res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new UpdateFailMalformedHTLC(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_UpdateFailMalformedHTLCDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_UpdateFailMalformedHTLCDecodeErrorZ ok(UpdateFailMalformedHTLC o) {
long ret = bindings.CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_UpdateFailMalformedHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailMalformedHTLCDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_UpdateFailMalformedHTLCDecodeErrorZ clone() {
long ret = bindings.CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_UpdateFailMalformedHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailMalformedHTLCDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_UpdateFeeDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_UpdateFeeDecodeErrorZ_get_ok(ptr);
- UpdateFee res_hu_conv = new UpdateFee(null, res);
+ UpdateFee res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new UpdateFee(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_UpdateFeeDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_UpdateFeeDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_UpdateFeeDecodeErrorZ ok(UpdateFee o) {
long ret = bindings.CResult_UpdateFeeDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_UpdateFeeDecodeErrorZ ret_hu_conv = Result_UpdateFeeDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_UpdateFeeDecodeErrorZ clone() {
long ret = bindings.CResult_UpdateFeeDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_UpdateFeeDecodeErrorZ ret_hu_conv = Result_UpdateFeeDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_UpdateFulfillHTLCDecodeErrorZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
long res = bindings.LDKCResult_UpdateFulfillHTLCDecodeErrorZ_get_ok(ptr);
- UpdateFulfillHTLC res_hu_conv = new UpdateFulfillHTLC(null, res);
+ UpdateFulfillHTLC res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new UpdateFulfillHTLC(null, res); }
res_hu_conv.ptrs_to.add(this);
this.res = res_hu_conv;
}
private Result_UpdateFulfillHTLCDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_UpdateFulfillHTLCDecodeErrorZ_get_err(ptr);
- DecodeError err_hu_conv = new DecodeError(null, err);
+ 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;
}
*/
public static Result_UpdateFulfillHTLCDecodeErrorZ ok(UpdateFulfillHTLC o) {
long ret = bindings.CResult_UpdateFulfillHTLCDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_UpdateFulfillHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFulfillHTLCDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_UpdateFulfillHTLCDecodeErrorZ clone() {
long ret = bindings.CResult_UpdateFulfillHTLCDecodeErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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__u832APIErrorZ ok(byte[] o) {
long ret = bindings.CResult__u832APIErrorZ_ok(o);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result__u832APIErrorZ ret_hu_conv = Result__u832APIErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result__u832APIErrorZ clone() {
long ret = bindings.CResult__u832APIErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result__u832APIErrorZ ret_hu_conv = Result__u832APIErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_boolLightningErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_boolLightningErrorZ_get_err(ptr);
- LightningError err_hu_conv = new LightningError(null, err);
+ LightningError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new LightningError(null, err); }
err_hu_conv.ptrs_to.add(this);
this.err = err_hu_conv;
}
*/
public static Result_boolLightningErrorZ ok(boolean o) {
long ret = bindings.CResult_boolLightningErrorZ_ok(o);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_boolLightningErrorZ ret_hu_conv = Result_boolLightningErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_boolLightningErrorZ clone() {
long ret = bindings.CResult_boolLightningErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_boolLightningErrorZ ret_hu_conv = Result_boolLightningErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
private Result_boolPeerHandleErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_boolPeerHandleErrorZ_get_err(ptr);
- PeerHandleError err_hu_conv = new PeerHandleError(null, err);
+ PeerHandleError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new PeerHandleError(null, err); }
err_hu_conv.ptrs_to.add(this);
this.err = err_hu_conv;
}
*/
public static Result_boolPeerHandleErrorZ ok(boolean o) {
long ret = bindings.CResult_boolPeerHandleErrorZ_ok(o);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_boolPeerHandleErrorZ ret_hu_conv = Result_boolPeerHandleErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Result_boolPeerHandleErrorZ clone() {
long ret = bindings.CResult_boolPeerHandleErrorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_boolPeerHandleErrorZ ret_hu_conv = Result_boolPeerHandleErrorZ.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;
+
+
+/**
+ * Number of attempts to retry payment path failures for an [`Invoice`].
+ *
+ * Note that this is the number of *path* failures, not full payment retries. For multi-path
+ * payments, if this is less than the total number of paths, we will never even retry all of the
+ * payment's paths.
+ */
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class RetryAttempts extends CommonBase {
+ RetryAttempts(Object _dummy, long ptr) { super(ptr); }
+ @Override @SuppressWarnings("deprecation")
+ protected void finalize() throws Throwable {
+ super.finalize();
+ if (ptr != 0) { bindings.RetryAttempts_free(ptr); }
+ }
+
+ public long get_a() {
+ long ret = bindings.RetryAttempts_get_a(this.ptr);
+ return ret;
+ }
+
+ public void set_a(long val) {
+ bindings.RetryAttempts_set_a(this.ptr, val);
+ }
+
+ /**
+ * Constructs a new RetryAttempts given each field
+ */
+ public static RetryAttempts of(long a_arg) {
+ long ret = bindings.RetryAttempts_new(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);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Creates a copy of the RetryAttempts
+ */
+ public RetryAttempts clone() {
+ long ret = bindings.RetryAttempts_clone(this.ptr);
+ 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);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Checks if two RetryAttemptss 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(RetryAttempts b) {
+ boolean ret = bindings.RetryAttempts_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
+ this.ptrs_to.add(b);
+ return ret;
+ }
+
+ /**
+ * Checks if two RetryAttemptss contain equal inner contents.
+ */
+ public long hash() {
+ long ret = bindings.RetryAttempts_hash(this.ptr);
+ return ret;
+ }
+
+}
*/
public static RevokeAndACK of(byte[] channel_id_arg, byte[] per_commitment_secret_arg, byte[] next_per_commitment_point_arg) {
long ret = bindings.RevokeAndACK_new(channel_id_arg, per_commitment_secret_arg, next_per_commitment_point_arg);
- if (ret >= 0 && ret < 1024) { return null; }
- RevokeAndACK ret_hu_conv = new RevokeAndACK(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public RevokeAndACK clone() {
long ret = bindings.RevokeAndACK_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- RevokeAndACK ret_hu_conv = new RevokeAndACK(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_RevokeAndACKDecodeErrorZ read(byte[] ser) {
long ret = bindings.RevokeAndACK_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_RevokeAndACKDecodeErrorZ ret_hu_conv = Result_RevokeAndACKDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
RouteHop[] ret_conv_12_conv_10_arr = new RouteHop[ret_conv_12.length];
for (int k = 0; k < ret_conv_12.length; k++) {
long ret_conv_12_conv_10 = ret_conv_12[k];
- RouteHop ret_conv_12_conv_10_hu_conv = new RouteHop(null, ret_conv_12_conv_10);
+ RouteHop ret_conv_12_conv_10_hu_conv = null; if (ret_conv_12_conv_10 < 0 || ret_conv_12_conv_10 > 4096) { ret_conv_12_conv_10_hu_conv = new RouteHop(null, ret_conv_12_conv_10); }
ret_conv_12_conv_10_hu_conv.ptrs_to.add(this);
ret_conv_12_conv_10_arr[k] = ret_conv_12_conv_10_hu_conv;
}
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);
}
+ /**
+ * The `payee` parameter passed to [`find_route`].
+ * This is used by `ChannelManager` to track information which may be required for retries,
+ * provided back to you via [`Event::PaymentPathFailed`].
+ *
+ * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ @Nullable
+ public Payee get_payee() {
+ long ret = bindings.Route_get_payee(this.ptr);
+ 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);
+ return ret_hu_conv;
+ }
+
+ /**
+ * The `payee` parameter passed to [`find_route`].
+ * This is used by `ChannelManager` to track information which may be required for retries,
+ * provided back to you via [`Event::PaymentPathFailed`].
+ *
+ * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
+ *
+ * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ public void set_payee(@Nullable Payee val) {
+ bindings.Route_set_payee(this.ptr, val == null ? 0 : val.ptr & ~1);
+ }
+
/**
* Constructs a new Route given each field
*/
- public static Route of(RouteHop[][] paths_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);
- if (ret >= 0 && ret < 1024) { return null; }
- Route ret_hu_conv = new Route(null, ret);
+ 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);
+ 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);
return ret_hu_conv;
}
*/
public Route clone() {
long ret = bindings.Route_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- Route ret_hu_conv = new Route(null, ret);
+ 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);
return ret_hu_conv;
}
* Returns the total amount of fees paid on this [`Route`].
*
* This doesn't include any extra payment made to the recipient, which can happen in excess of
- * the amount passed to [`get_route`]'s `final_value_msat`.
+ * the amount passed to [`find_route`]'s `params.final_value_msat`.
*/
public long get_total_fees() {
long ret = bindings.Route_get_total_fees(this.ptr);
*/
public static Result_RouteDecodeErrorZ read(byte[] ser) {
long ret = bindings.Route_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_RouteDecodeErrorZ ret_hu_conv = Result_RouteDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
if (ptr != 0) { bindings.RouteHint_free(ptr); }
}
+ public RouteHintHop[] get_a() {
+ long[] ret = bindings.RouteHint_get_a(this.ptr);
+ RouteHintHop[] ret_conv_14_arr = new RouteHintHop[ret.length];
+ for (int o = 0; o < ret.length; o++) {
+ long ret_conv_14 = ret[o];
+ RouteHintHop ret_conv_14_hu_conv = null; if (ret_conv_14 < 0 || ret_conv_14 > 4096) { ret_conv_14_hu_conv = new RouteHintHop(null, ret_conv_14); }
+ ret_conv_14_hu_conv.ptrs_to.add(this);
+ ret_conv_14_arr[o] = ret_conv_14_hu_conv;
+ }
+ return ret_conv_14_arr;
+ }
+
+ 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);
+ }
+
+ /**
+ * Constructs a new RouteHint given each field
+ */
+ 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);
+ 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);
+ return ret_hu_conv;
+ }
+
/**
* Creates a copy of the RouteHint
*/
public RouteHint clone() {
long ret = bindings.RouteHint_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- RouteHint ret_hu_conv = new RouteHint(null, ret);
+ 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);
return ret_hu_conv;
}
return ret;
}
+ /**
+ * 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);
+ return ret;
+ }
+
+ /**
+ * Read a RouteHint from a byte array, created by RouteHint_write
+ */
+ public static Result_RouteHintDecodeErrorZ read(byte[] ser) {
+ long ret = bindings.RouteHint_read(ser);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_RouteHintDecodeErrorZ ret_hu_conv = Result_RouteHintDecodeErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
}
*/
public RoutingFees get_fees() {
long ret = bindings.RouteHintHop_get_fees(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- RoutingFees ret_hu_conv = new RoutingFees(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public Option_u64Z get_htlc_minimum_msat() {
long ret = bindings.RouteHintHop_get_htlc_minimum_msat(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public Option_u64Z get_htlc_maximum_msat() {
long ret = bindings.RouteHintHop_get_htlc_maximum_msat(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
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(src_node_id_arg, 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);
- if (ret >= 0 && ret < 1024) { return null; }
- RouteHintHop ret_hu_conv = new RouteHintHop(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public RouteHintHop clone() {
long ret = bindings.RouteHintHop_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- RouteHintHop ret_hu_conv = new RouteHintHop(null, ret);
+ 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);
return ret_hu_conv;
}
return ret;
}
+ /**
+ * 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);
+ return ret;
+ }
+
+ /**
+ * Read a RouteHintHop from a byte array, created by RouteHintHop_write
+ */
+ public static Result_RouteHintHopDecodeErrorZ read(byte[] ser) {
+ long ret = bindings.RouteHintHop_read(ser);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_RouteHintHopDecodeErrorZ ret_hu_conv = Result_RouteHintHopDecodeErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
}
*/
public NodeFeatures get_node_features() {
long ret = bindings.RouteHop_get_node_features(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- NodeFeatures ret_hu_conv = new NodeFeatures(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public ChannelFeatures get_channel_features() {
long ret = bindings.RouteHop_get_channel_features(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- ChannelFeatures ret_hu_conv = new ChannelFeatures(null, ret);
+ 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);
return ret_hu_conv;
}
*/
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(pubkey_arg, 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);
- if (ret >= 0 && ret < 1024) { return null; }
- RouteHop ret_hu_conv = new RouteHop(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public RouteHop clone() {
long ret = bindings.RouteHop_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- RouteHop ret_hu_conv = new RouteHop(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_RouteHopDecodeErrorZ read(byte[] ser) {
long ret = bindings.RouteHop_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_RouteHopDecodeErrorZ ret_hu_conv = Result_RouteHopDecodeErrorZ.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;
+
+
+/**
+ * Parameters needed to find a [`Route`] for paying a [`Payee`].
+ *
+ * Passed to [`find_route`] and also provided in [`Event::PaymentPathFailed`] for retrying a failed
+ * payment path.
+ *
+ * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
+ */
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class RouteParameters extends CommonBase {
+ RouteParameters(Object _dummy, long ptr) { super(ptr); }
+ @Override @SuppressWarnings("deprecation")
+ protected void finalize() throws Throwable {
+ super.finalize();
+ if (ptr != 0) { bindings.RouteParameters_free(ptr); }
+ }
+
+ /**
+ * The recipient of the failed payment path.
+ */
+ public Payee get_payee() {
+ long ret = bindings.RouteParameters_get_payee(this.ptr);
+ 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);
+ return ret_hu_conv;
+ }
+
+ /**
+ * The recipient of the failed payment path.
+ */
+ public void set_payee(Payee val) {
+ bindings.RouteParameters_set_payee(this.ptr, val == null ? 0 : val.ptr & ~1);
+ }
+
+ /**
+ * The amount in msats sent on the failed payment path.
+ */
+ public long get_final_value_msat() {
+ long ret = bindings.RouteParameters_get_final_value_msat(this.ptr);
+ return ret;
+ }
+
+ /**
+ * The amount in msats sent on the failed payment path.
+ */
+ public void set_final_value_msat(long val) {
+ bindings.RouteParameters_set_final_value_msat(this.ptr, val);
+ }
+
+ /**
+ * The CLTV on the final hop of the failed payment path.
+ */
+ public int get_final_cltv_expiry_delta() {
+ int ret = bindings.RouteParameters_get_final_cltv_expiry_delta(this.ptr);
+ return ret;
+ }
+
+ /**
+ * The CLTV on the final hop of the failed payment path.
+ */
+ public void set_final_cltv_expiry_delta(int val) {
+ bindings.RouteParameters_set_final_cltv_expiry_delta(this.ptr, val);
+ }
+
+ /**
+ * Constructs a new RouteParameters given each field
+ */
+ 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);
+ 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);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Creates a copy of the RouteParameters
+ */
+ public RouteParameters clone() {
+ long ret = bindings.RouteParameters_clone(this.ptr);
+ 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);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Serialize the RouteParameters object into a byte array which can be read by RouteParameters_read
+ */
+ public byte[] write() {
+ byte[] ret = bindings.RouteParameters_write(this.ptr);
+ return ret;
+ }
+
+ /**
+ * Read a RouteParameters from a byte array, created by RouteParameters_write
+ */
+ public static Result_RouteParametersDecodeErrorZ read(byte[] ser) {
+ long ret = bindings.RouteParameters_read(ser);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_RouteParametersDecodeErrorZ ret_hu_conv = Result_RouteParametersDecodeErrorZ.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;
+
+/**
+ * A trait defining behavior for routing an [`Invoice`] payment.
+ */
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class Router extends CommonBase {
+ final bindings.LDKRouter bindings_instance;
+ Router(Object _dummy, long ptr) { super(ptr); bindings_instance = null; }
+ private Router(bindings.LDKRouter arg) {
+ super(bindings.LDKRouter_new(arg));
+ this.ptrs_to.add(arg);
+ this.bindings_instance = arg;
+ }
+ @Override @SuppressWarnings("deprecation")
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.Router_free(ptr); } super.finalize();
+ }
+
+ public static interface RouterInterface {
+ /**
+ * Finds a [`Route`] between `payer` and `payee` for a payment with the given values.
+ *
+ * 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);
+ }
+ 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) {
+ 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++) {
+ long first_hops_conv_16 = first_hops[q];
+ ChannelDetails first_hops_conv_16_hu_conv = null; if (first_hops_conv_16 < 0 || first_hops_conv_16 > 4096) { first_hops_conv_16_hu_conv = new ChannelDetails(null, first_hops_conv_16); }
+ first_hops_conv_16_hu_conv.ptrs_to.add(this);
+ first_hops_conv_16_arr[q] = first_hops_conv_16_hu_conv;
+ }
+ 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);
+ long result = ret != null ? ret.ptr : 0;
+ return result;
+ }
+ });
+ return impl_holder.held;
+ }
+ /**
+ * Finds a [`Route`] between `payer` and `payee` for a payment with the given values.
+ *
+ * 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, payer, 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);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ 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); };
+ this.ptrs_to.add(scorer);
+ return ret_hu_conv;
+ }
+
+}
*/
public static RoutingFees of(int base_msat_arg, int proportional_millionths_arg) {
long ret = bindings.RoutingFees_new(base_msat_arg, proportional_millionths_arg);
- if (ret >= 0 && ret < 1024) { return null; }
- RoutingFees ret_hu_conv = new RoutingFees(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public RoutingFees clone() {
long ret = bindings.RoutingFees_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- RoutingFees ret_hu_conv = new RoutingFees(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_RoutingFeesDecodeErrorZ read(byte[] ser) {
long ret = bindings.RoutingFees_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_RoutingFeesDecodeErrorZ ret_hu_conv = Result_RoutingFeesDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
final LDKRoutingMessageHandlerHolder impl_holder = new LDKRoutingMessageHandlerHolder();
impl_holder.held = new RoutingMessageHandler(new bindings.LDKRoutingMessageHandler() {
@Override public long handle_node_announcement(long msg) {
- NodeAnnouncement msg_hu_conv = new NodeAnnouncement(null, msg);
+ NodeAnnouncement msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new NodeAnnouncement(null, msg); }
Result_boolLightningErrorZ ret = arg.handle_node_announcement(msg_hu_conv);
long result = ret != null ? ret.ptr : 0;
return result;
}
@Override public long handle_channel_announcement(long msg) {
- ChannelAnnouncement msg_hu_conv = new ChannelAnnouncement(null, msg);
+ ChannelAnnouncement msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ChannelAnnouncement(null, msg); }
Result_boolLightningErrorZ ret = arg.handle_channel_announcement(msg_hu_conv);
long result = ret != null ? ret.ptr : 0;
return result;
}
@Override public long handle_channel_update(long msg) {
- ChannelUpdate msg_hu_conv = new ChannelUpdate(null, msg);
+ ChannelUpdate msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ChannelUpdate(null, msg); }
Result_boolLightningErrorZ ret = arg.handle_channel_update(msg_hu_conv);
long result = ret != null ? ret.ptr : 0;
return result;
return result;
}
@Override public void sync_routing_table(byte[] their_node_id, long init) {
- Init init_hu_conv = new Init(null, init);
+ Init init_hu_conv = null; if (init < 0 || init > 4096) { init_hu_conv = new Init(null, init); }
arg.sync_routing_table(their_node_id, init_hu_conv);
}
@Override public long handle_reply_channel_range(byte[] their_node_id, long msg) {
- ReplyChannelRange msg_hu_conv = new ReplyChannelRange(null, msg);
+ ReplyChannelRange msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ReplyChannelRange(null, msg); }
msg_hu_conv.ptrs_to.add(this);
Result_NoneLightningErrorZ ret = arg.handle_reply_channel_range(their_node_id, msg_hu_conv);
long result = ret != null ? ret.ptr : 0;
return result;
}
@Override public long handle_reply_short_channel_ids_end(byte[] their_node_id, long msg) {
- ReplyShortChannelIdsEnd msg_hu_conv = new ReplyShortChannelIdsEnd(null, msg);
+ ReplyShortChannelIdsEnd msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new ReplyShortChannelIdsEnd(null, msg); }
msg_hu_conv.ptrs_to.add(this);
Result_NoneLightningErrorZ ret = arg.handle_reply_short_channel_ids_end(their_node_id, msg_hu_conv);
long result = ret != null ? ret.ptr : 0;
return result;
}
@Override public long handle_query_channel_range(byte[] their_node_id, long msg) {
- QueryChannelRange msg_hu_conv = new QueryChannelRange(null, msg);
+ QueryChannelRange msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new QueryChannelRange(null, msg); }
msg_hu_conv.ptrs_to.add(this);
Result_NoneLightningErrorZ ret = arg.handle_query_channel_range(their_node_id, msg_hu_conv);
long result = ret != null ? ret.ptr : 0;
return result;
}
@Override public long handle_query_short_channel_ids(byte[] their_node_id, long msg) {
- QueryShortChannelIds msg_hu_conv = new QueryShortChannelIds(null, msg);
+ QueryShortChannelIds msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new QueryShortChannelIds(null, msg); }
msg_hu_conv.ptrs_to.add(this);
Result_NoneLightningErrorZ ret = arg.handle_query_short_channel_ids(their_node_id, msg_hu_conv);
long result = ret != null ? ret.ptr : 0;
*/
public Result_boolLightningErrorZ handle_node_announcement(NodeAnnouncement msg) {
long ret = bindings.RoutingMessageHandler_handle_node_announcement(this.ptr, msg == null ? 0 : msg.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_boolLightningErrorZ ret_hu_conv = Result_boolLightningErrorZ.constr_from_ptr(ret);
this.ptrs_to.add(msg);
return ret_hu_conv;
*/
public Result_boolLightningErrorZ handle_channel_announcement(ChannelAnnouncement msg) {
long ret = bindings.RoutingMessageHandler_handle_channel_announcement(this.ptr, msg == null ? 0 : msg.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_boolLightningErrorZ ret_hu_conv = Result_boolLightningErrorZ.constr_from_ptr(ret);
this.ptrs_to.add(msg);
return ret_hu_conv;
*/
public Result_boolLightningErrorZ handle_channel_update(ChannelUpdate msg) {
long ret = bindings.RoutingMessageHandler_handle_channel_update(this.ptr, msg == null ? 0 : msg.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_boolLightningErrorZ ret_hu_conv = Result_boolLightningErrorZ.constr_from_ptr(ret);
this.ptrs_to.add(msg);
return ret_hu_conv;
NodeAnnouncement[] ret_conv_18_arr = new NodeAnnouncement[ret.length];
for (int s = 0; s < ret.length; s++) {
long ret_conv_18 = ret[s];
- NodeAnnouncement ret_conv_18_hu_conv = new NodeAnnouncement(null, ret_conv_18);
+ NodeAnnouncement ret_conv_18_hu_conv = null; if (ret_conv_18 < 0 || ret_conv_18 > 4096) { ret_conv_18_hu_conv = new NodeAnnouncement(null, ret_conv_18); }
ret_conv_18_hu_conv.ptrs_to.add(this);
ret_conv_18_arr[s] = ret_conv_18_hu_conv;
}
*/
public Result_NoneLightningErrorZ handle_reply_channel_range(byte[] their_node_id, ReplyChannelRange msg) {
long ret = bindings.RoutingMessageHandler_handle_reply_channel_range(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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, their_node_id, msg == null ? 0 : msg.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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, their_node_id, msg == null ? 0 : msg.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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, their_node_id, msg == null ? 0 : msg.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
public static interface ScoreInterface {
/**
- * Returns the fee in msats willing to be paid to avoid routing through the given channel.
+ * Returns the fee in msats willing to be paid to avoid routing through the given channel
+ * in the direction from `source` to `target`.
*/
- long channel_penalty_msat(long short_channel_id);
+ long channel_penalty_msat(long short_channel_id, 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);
+ /**
+ * Serialize the object into a byte array
+ */
+ byte[] write();
}
private static class LDKScoreHolder { Score held; }
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 ret = arg.channel_penalty_msat(short_channel_id);
+ @Override public long channel_penalty_msat(long short_channel_id, long source, long target) {
+ 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);
+ return ret;
+ }
+ @Override public void payment_path_failed(long[] path, long short_channel_id) {
+ 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_failed(path_conv_10_arr, short_channel_id);
+ }
+ @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.
+ * Returns the fee in msats willing to be paid to avoid routing through the given channel
+ * in the direction from `source` to `target`.
+ */
+ 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);
+ this.ptrs_to.add(source);
+ this.ptrs_to.add(target);
+ return ret;
+ }
+
+ /**
+ * Handles updating channel penalties after failing to route through a channel.
+ */
+ 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);
+ }
+
+ /**
+ * Serialize the object into a byte array
*/
- public long channel_penalty_msat(long short_channel_id) {
- long ret = bindings.Score_channel_penalty_msat(this.ptr, short_channel_id);
+ public byte[] write() {
+ byte[] ret = bindings.Score_write(this.ptr);
return ret;
}
* [`routing::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.
+ * slightly higher fees are available. Will further penalize channels that fail to relay payments.
*
* See [module-level documentation] for usage.
*
}
/**
- * Creates a new scorer using `base_penalty_msat` as the channel penalty.
+ * Creates a new scorer using the given scoring parameters.
*/
- public static Scorer of(long base_penalty_msat) {
- long ret = bindings.Scorer_new(base_penalty_msat);
- if (ret >= 0 && ret < 1024) { return null; }
- Scorer ret_hu_conv = new Scorer(null, ret);
+ 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));
+ 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);
return ret_hu_conv;
}
*/
public static Scorer with_default() {
long ret = bindings.Scorer_default();
- if (ret >= 0 && ret < 1024) { return null; }
- Scorer ret_hu_conv = new Scorer(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public Score as_Score() {
long ret = bindings.Scorer_as_Score(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Score ret_hu_conv = new Score(null, ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
}
+ /**
+ * Serialize the Scorer object into a byte array which can be read by Scorer_read
+ */
+ public byte[] write() {
+ byte[] ret = bindings.Scorer_write(this.ptr);
+ return ret;
+ }
+
+ /**
+ * Read a Scorer from a byte array, created by Scorer_write
+ */
+ public static Result_ScorerDecodeErrorZ read(byte[] ser) {
+ long ret = bindings.Scorer_read(ser);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_ScorerDecodeErrorZ ret_hu_conv = Result_ScorerDecodeErrorZ.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;
+
+
+/**
+ * Parameters for configuring [`Scorer`].
+ */
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class ScoringParameters extends CommonBase {
+ ScoringParameters(Object _dummy, long ptr) { super(ptr); }
+ @Override @SuppressWarnings("deprecation")
+ protected void finalize() throws Throwable {
+ super.finalize();
+ if (ptr != 0) { bindings.ScoringParameters_free(ptr); }
+ }
+
+ /**
+ * A fixed penalty in msats to apply to each channel.
+ */
+ public long get_base_penalty_msat() {
+ long ret = bindings.ScoringParameters_get_base_penalty_msat(this.ptr);
+ return ret;
+ }
+
+ /**
+ * A fixed penalty in msats to apply to each channel.
+ */
+ public void set_base_penalty_msat(long val) {
+ bindings.ScoringParameters_set_base_penalty_msat(this.ptr, 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`]: Self::failure_penalty_half_life
+ */
+ public long get_failure_penalty_msat() {
+ long ret = bindings.ScoringParameters_get_failure_penalty_msat(this.ptr);
+ 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`]: Self::failure_penalty_half_life
+ */
+ public void set_failure_penalty_msat(long val) {
+ bindings.ScoringParameters_set_failure_penalty_msat(this.ptr, val);
+ }
+
+ /**
+ * The time required to elapse before any accumulated [`failure_penalty_msat`] penalties are
+ * cut in half.
+ *
+ * # Note
+ *
+ * When time is an [`Eternity`], as is default when enabling feature `no-std`, it 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);
+ return ret;
+ }
+
+ /**
+ * The time required to elapse before any accumulated [`failure_penalty_msat`] penalties are
+ * cut in half.
+ *
+ * # Note
+ *
+ * When time is an [`Eternity`], as is default when enabling feature `no-std`, it 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);
+ }
+
+ /**
+ * 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);
+ 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);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Serialize the ScoringParameters object into a byte array which can be read by ScoringParameters_read
+ */
+ public byte[] write() {
+ byte[] ret = bindings.ScoringParameters_write(this.ptr);
+ return ret;
+ }
+
+ /**
+ * Read a ScoringParameters from a byte array, created by ScoringParameters_write
+ */
+ public static Result_ScoringParametersDecodeErrorZ read(byte[] ser) {
+ long ret = bindings.ScoringParameters_read(ser);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_ScoringParametersDecodeErrorZ ret_hu_conv = Result_ScoringParametersDecodeErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Creates a "default" ScoringParameters. See struct and individual field documentaiton for details on which values are used.
+ */
+ public static ScoringParameters with_default() {
+ long ret = bindings.ScoringParameters_default();
+ 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);
+ return ret_hu_conv;
+ }
+
+}
*/
public Sha256 clone() {
long ret = bindings.Sha256_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- Sha256 ret_hu_conv = new Sha256(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Shutdown of(byte[] channel_id_arg, byte[] scriptpubkey_arg) {
long ret = bindings.Shutdown_new(channel_id_arg, scriptpubkey_arg);
- if (ret >= 0 && ret < 1024) { return null; }
- Shutdown ret_hu_conv = new Shutdown(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public Shutdown clone() {
long ret = bindings.Shutdown_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- Shutdown ret_hu_conv = new Shutdown(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_ShutdownDecodeErrorZ read(byte[] ser) {
long ret = bindings.Shutdown_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_ShutdownDecodeErrorZ ret_hu_conv = Result_ShutdownDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public ShutdownScript clone() {
long ret = bindings.ShutdownScript_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- ShutdownScript ret_hu_conv = new ShutdownScript(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_ShutdownScriptDecodeErrorZ read(byte[] ser) {
long ret = bindings.ShutdownScript_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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(pubkey_hash);
- if (ret >= 0 && ret < 1024) { return null; }
- ShutdownScript ret_hu_conv = new ShutdownScript(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static ShutdownScript new_p2wsh(byte[] script_hash) {
long ret = bindings.ShutdownScript_new_p2wsh(script_hash);
- if (ret >= 0 && ret < 1024) { return null; }
- ShutdownScript ret_hu_conv = new ShutdownScript(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_ShutdownScriptInvalidShutdownScriptZ new_witness_program(byte version, byte[] program) {
long ret = bindings.ShutdownScript_new_witness_program(version, program);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_ShutdownScriptInvalidShutdownScriptZ ret_hu_conv = Result_ShutdownScriptInvalidShutdownScriptZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public Sign clone() {
long ret = bindings.Sign_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Sign ret_hu_conv = new Sign(null, ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
public SignOrCreationError clone() {
long ret = bindings.SignOrCreationError_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
SignOrCreationError ret_hu_conv = SignOrCreationError.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
public static SignOrCreationError sign_error() {
long ret = bindings.SignOrCreationError_sign_error();
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public static SignOrCreationError creation_error(org.ldk.enums.CreationError a) {
long ret = bindings.SignOrCreationError_creation_error(a);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public SignedRawInvoice clone() {
long ret = bindings.SignedRawInvoice_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- SignedRawInvoice ret_hu_conv = new SignedRawInvoice(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public ThreeTuple_RawInvoice_u832InvoiceSignatureZ into_parts() {
long ret = bindings.SignedRawInvoice_into_parts(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
- RawInvoice ret_hu_conv = new RawInvoice(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public InvoiceSignature signature() {
long ret = bindings.SignedRawInvoice_signature(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- InvoiceSignature ret_hu_conv = new InvoiceSignature(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public Result_PayeePubKeyErrorZ recover_payee_pub_key() {
long ret = bindings.SignedRawInvoice_recover_payee_pub_key(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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_SignedRawInvoiceNoneZ from_str(java.lang.String s) {
long ret = bindings.SignedRawInvoice_from_str(s);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_SignedRawInvoiceNoneZ ret_hu_conv = Result_SignedRawInvoiceNoneZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public SocketDescriptor clone() {
long ret = bindings.SocketDescriptor_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
SocketDescriptor ret_hu_conv = new SocketDescriptor(null, ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
private StaticOutput(long ptr, bindings.LDKSpendableOutputDescriptor.StaticOutput obj) {
super(null, ptr);
long outpoint = obj.outpoint;
- OutPoint outpoint_hu_conv = new OutPoint(null, outpoint);
+ OutPoint outpoint_hu_conv = null; if (outpoint < 0 || outpoint > 4096) { outpoint_hu_conv = new OutPoint(null, outpoint); }
outpoint_hu_conv.ptrs_to.add(this);
this.outpoint = outpoint_hu_conv;
long output = obj.output;
private DelayedPaymentOutput(long ptr, bindings.LDKSpendableOutputDescriptor.DelayedPaymentOutput obj) {
super(null, ptr);
long delayed_payment_output = obj.delayed_payment_output;
- DelayedPaymentOutputDescriptor delayed_payment_output_hu_conv = new DelayedPaymentOutputDescriptor(null, delayed_payment_output);
+ DelayedPaymentOutputDescriptor delayed_payment_output_hu_conv = null; if (delayed_payment_output < 0 || delayed_payment_output > 4096) { delayed_payment_output_hu_conv = new DelayedPaymentOutputDescriptor(null, delayed_payment_output); }
delayed_payment_output_hu_conv.ptrs_to.add(this);
this.delayed_payment_output = delayed_payment_output_hu_conv;
}
private StaticPaymentOutput(long ptr, bindings.LDKSpendableOutputDescriptor.StaticPaymentOutput obj) {
super(null, ptr);
long static_payment_output = obj.static_payment_output;
- StaticPaymentOutputDescriptor static_payment_output_hu_conv = new StaticPaymentOutputDescriptor(null, static_payment_output);
+ StaticPaymentOutputDescriptor static_payment_output_hu_conv = null; if (static_payment_output < 0 || static_payment_output > 4096) { static_payment_output_hu_conv = new StaticPaymentOutputDescriptor(null, static_payment_output); }
static_payment_output_hu_conv.ptrs_to.add(this);
this.static_payment_output = static_payment_output_hu_conv;
}
*/
public SpendableOutputDescriptor clone() {
long ret = bindings.SpendableOutputDescriptor_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
SpendableOutputDescriptor ret_hu_conv = SpendableOutputDescriptor.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
public static SpendableOutputDescriptor static_output(OutPoint outpoint, TxOut output) {
long ret = bindings.SpendableOutputDescriptor_static_output(outpoint == null ? 0 : outpoint.ptr & ~1, output.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public static SpendableOutputDescriptor delayed_payment_output(DelayedPaymentOutputDescriptor a) {
long ret = bindings.SpendableOutputDescriptor_delayed_payment_output(a == null ? 0 : a.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public static SpendableOutputDescriptor static_payment_output(StaticPaymentOutputDescriptor a) {
long ret = bindings.SpendableOutputDescriptor_static_payment_output(a == null ? 0 : a.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public static Result_SpendableOutputDescriptorDecodeErrorZ read(byte[] ser) {
long ret = bindings.SpendableOutputDescriptor_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_SpendableOutputDescriptorDecodeErrorZ ret_hu_conv = Result_SpendableOutputDescriptorDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public OutPoint get_outpoint() {
long ret = bindings.StaticPaymentOutputDescriptor_get_outpoint(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- OutPoint ret_hu_conv = new OutPoint(null, ret);
+ 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;
}
*/
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, channel_keys_id_arg, channel_value_satoshis_arg);
- if (ret >= 0 && ret < 1024) { return null; }
- StaticPaymentOutputDescriptor ret_hu_conv = new StaticPaymentOutputDescriptor(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public StaticPaymentOutputDescriptor clone() {
long ret = bindings.StaticPaymentOutputDescriptor_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- StaticPaymentOutputDescriptor ret_hu_conv = new StaticPaymentOutputDescriptor(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_StaticPaymentOutputDescriptorDecodeErrorZ read(byte[] ser) {
long ret = bindings.StaticPaymentOutputDescriptor_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_StaticPaymentOutputDescriptorDecodeErrorZ ret_hu_conv = Result_StaticPaymentOutputDescriptorDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public BuiltCommitmentTransaction built_transaction() {
long ret = bindings.TrustedCommitmentTransaction_built_transaction(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- BuiltCommitmentTransaction ret_hu_conv = new BuiltCommitmentTransaction(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public TxCreationKeys keys() {
long ret = bindings.TrustedCommitmentTransaction_keys(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- TxCreationKeys ret_hu_conv = new TxCreationKeys(null, ret);
+ 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;
}
*/
public Result_CVec_SignatureZNoneZ get_htlc_sigs(byte[] htlc_base_key, DirectedChannelTransactionParameters channel_parameters) {
long ret = bindings.TrustedCommitmentTransaction_get_htlc_sigs(this.ptr, htlc_base_key, channel_parameters == null ? 0 : channel_parameters.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public ChannelManager get_b() {
long ret = bindings.C2Tuple_BlockHashChannelManagerZ_get_b(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- ChannelManager ret_hu_conv = new ChannelManager(null, ret);
+ 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);
return ret_hu_conv;
}
*/
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(a, 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));
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
ret_hu_conv.ptrs_to.add(b_fee_est);
*/
public ChannelMonitor get_b() {
long ret = bindings.C2Tuple_BlockHashChannelMonitorZ_get_b(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- ChannelMonitor ret_hu_conv = new ChannelMonitor(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public TwoTuple_BlockHashChannelMonitorZ clone() {
long ret = bindings.C2Tuple_BlockHashChannelMonitorZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
TwoTuple_BlockHashChannelMonitorZ ret_hu_conv = new TwoTuple_BlockHashChannelMonitorZ(null, ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
public static TwoTuple_BlockHashChannelMonitorZ of(byte[] a, ChannelMonitor b) {
long ret = bindings.C2Tuple_BlockHashChannelMonitorZ_new(a, b == null ? 0 : b.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public OutPoint get_a() {
long ret = bindings.C2Tuple_OutPointScriptZ_get_a(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- OutPoint ret_hu_conv = new OutPoint(null, ret);
+ 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;
}
*/
public TwoTuple_OutPointScriptZ clone() {
long ret = bindings.C2Tuple_OutPointScriptZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
TwoTuple_OutPointScriptZ ret_hu_conv = new TwoTuple_OutPointScriptZ(null, ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
public static TwoTuple_OutPointScriptZ of(OutPoint a, byte[] b) {
long ret = bindings.C2Tuple_OutPointScriptZ_new(a == null ? 0 : a.ptr & ~1, b);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
/**
*
*/
- public PaymentId get_b() {
- long ret = bindings.C2Tuple_PaymentHashPaymentIdZ_get_b(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- PaymentId ret_hu_conv = new PaymentId(null, ret);
- ret_hu_conv.ptrs_to.add(this);
- return ret_hu_conv;
+ public byte[] get_b() {
+ byte[] ret = bindings.C2Tuple_PaymentHashPaymentIdZ_get_b(this.ptr);
+ return ret;
}
/**
*/
public TwoTuple_PaymentHashPaymentIdZ clone() {
long ret = bindings.C2Tuple_PaymentHashPaymentIdZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
TwoTuple_PaymentHashPaymentIdZ ret_hu_conv = new TwoTuple_PaymentHashPaymentIdZ(null, ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
/**
* Creates a new C2Tuple_PaymentHashPaymentIdZ from the contained elements.
*/
- public static TwoTuple_PaymentHashPaymentIdZ of(byte[] a, PaymentId b) {
- long ret = bindings.C2Tuple_PaymentHashPaymentIdZ_new(a, b == null ? 0 : b.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ public static TwoTuple_PaymentHashPaymentIdZ of(byte[] a, byte[] b) {
+ long ret = bindings.C2Tuple_PaymentHashPaymentIdZ_new(a, 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);
return ret_hu_conv;
*/
public TwoTuple_PaymentHashPaymentSecretZ clone() {
long ret = bindings.C2Tuple_PaymentHashPaymentSecretZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
TwoTuple_PaymentHashPaymentSecretZ ret_hu_conv = new TwoTuple_PaymentHashPaymentSecretZ(null, ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
public static TwoTuple_PaymentHashPaymentSecretZ of(byte[] a, byte[] b) {
long ret = bindings.C2Tuple_PaymentHashPaymentSecretZ_new(a, b);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public Type get_b() {
long ret = bindings.C2Tuple_PublicKeyTypeZ_get_b(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Type ret_hu_conv = new Type(null, ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
public TwoTuple_PublicKeyTypeZ clone() {
long ret = bindings.C2Tuple_PublicKeyTypeZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
TwoTuple_PublicKeyTypeZ ret_hu_conv = new TwoTuple_PublicKeyTypeZ(null, ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
public static TwoTuple_PublicKeyTypeZ of(byte[] a, Type b) {
long ret = bindings.C2Tuple_PublicKeyTypeZ_new(a, b == null ? 0 : b.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
ret_hu_conv.ptrs_to.add(b);
*/
public TwoTuple_SignatureCVec_SignatureZZ clone() {
long ret = bindings.C2Tuple_SignatureCVec_SignatureZZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public static TwoTuple_SignatureCVec_SignatureZZ of(byte[] a, byte[][] b) {
long ret = bindings.C2Tuple_SignatureCVec_SignatureZZ_new(a, b);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ clone() {
long ret = bindings.C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public static TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ of(byte[] a, TwoTuple_u32ScriptZ[] b) {
long ret = bindings.C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(a, b != null ? Arrays.stream(b).mapToLong(b_conv_21 -> b_conv_21 != null ? b_conv_21.ptr : 0).toArray() : null);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ clone() {
long ret = bindings.C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public static TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ of(byte[] a, TwoTuple_u32TxOutZ[] b) {
long ret = bindings.C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(a, b != null ? Arrays.stream(b).mapToLong(b_conv_20 -> b_conv_20 != null ? b_conv_20.ptr : 0).toArray() : null);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public TwoTuple_u32ScriptZ clone() {
long ret = bindings.C2Tuple_u32ScriptZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
TwoTuple_u32ScriptZ ret_hu_conv = new TwoTuple_u32ScriptZ(null, ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
public static TwoTuple_u32ScriptZ of(int a, byte[] b) {
long ret = bindings.C2Tuple_u32ScriptZ_new(a, b);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public TxOut get_b() {
long ret = bindings.C2Tuple_u32TxOutZ_get_b(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
TxOut ret_conv = new TxOut(null, ret);
return ret_conv;
}
*/
public TwoTuple_u32TxOutZ clone() {
long ret = bindings.C2Tuple_u32TxOutZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
TwoTuple_u32TxOutZ ret_hu_conv = new TwoTuple_u32TxOutZ(null, ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
public static TwoTuple_u32TxOutZ of(int a, TxOut b) {
long ret = bindings.C2Tuple_u32TxOutZ_new(a, b.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
public TwoTuple_usizeTransactionZ clone() {
long ret = bindings.C2Tuple_usizeTransactionZ_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
TwoTuple_usizeTransactionZ ret_hu_conv = new TwoTuple_usizeTransactionZ(null, ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
public static TwoTuple_usizeTransactionZ of(long a, byte[] b) {
long ret = bindings.C2Tuple_usizeTransactionZ_new(a, b);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
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(per_commitment_point_arg, revocation_key_arg, broadcaster_htlc_key_arg, countersignatory_htlc_key_arg, broadcaster_delayed_payment_key_arg);
- if (ret >= 0 && ret < 1024) { return null; }
- TxCreationKeys ret_hu_conv = new TxCreationKeys(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public TxCreationKeys clone() {
long ret = bindings.TxCreationKeys_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- TxCreationKeys ret_hu_conv = new TxCreationKeys(null, ret);
+ 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;
}
*/
public static Result_TxCreationKeysDecodeErrorZ read(byte[] ser) {
long ret = bindings.TxCreationKeys_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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(per_commitment_point, broadcaster_delayed_payment_base, broadcaster_htlc_base, countersignatory_revocation_base, countersignatory_htlc_base);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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(per_commitment_point, broadcaster_keys == null ? 0 : broadcaster_keys.ptr & ~1, countersignatory_keys == null ? 0 : countersignatory_keys.ptr & ~1);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
ret_hu_conv.ptrs_to.add(countersignatory_keys);
*/
public Type clone() {
long ret = bindings.Type_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Type ret_hu_conv = new Type(null, ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
*/
public ChannelFeatures get_features() {
long ret = bindings.UnsignedChannelAnnouncement_get_features(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- ChannelFeatures ret_hu_conv = new ChannelFeatures(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public UnsignedChannelAnnouncement clone() {
long ret = bindings.UnsignedChannelAnnouncement_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- UnsignedChannelAnnouncement ret_hu_conv = new UnsignedChannelAnnouncement(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_UnsignedChannelAnnouncementDecodeErrorZ read(byte[] ser) {
long ret = bindings.UnsignedChannelAnnouncement_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_UnsignedChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public UnsignedChannelUpdate clone() {
long ret = bindings.UnsignedChannelUpdate_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- UnsignedChannelUpdate ret_hu_conv = new UnsignedChannelUpdate(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_UnsignedChannelUpdateDecodeErrorZ read(byte[] ser) {
long ret = bindings.UnsignedChannelUpdate_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_UnsignedChannelUpdateDecodeErrorZ ret_hu_conv = Result_UnsignedChannelUpdateDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public NodeFeatures get_features() {
long ret = bindings.UnsignedNodeAnnouncement_get_features(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- NodeFeatures ret_hu_conv = new NodeFeatures(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public UnsignedNodeAnnouncement clone() {
long ret = bindings.UnsignedNodeAnnouncement_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- UnsignedNodeAnnouncement ret_hu_conv = new UnsignedNodeAnnouncement(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_UnsignedNodeAnnouncementDecodeErrorZ read(byte[] ser) {
long ret = bindings.UnsignedNodeAnnouncement_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_UnsignedNodeAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedNodeAnnouncementDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public UpdateAddHTLC clone() {
long ret = bindings.UpdateAddHTLC_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- UpdateAddHTLC ret_hu_conv = new UpdateAddHTLC(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_UpdateAddHTLCDecodeErrorZ read(byte[] ser) {
long ret = bindings.UpdateAddHTLC_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_UpdateAddHTLCDecodeErrorZ ret_hu_conv = Result_UpdateAddHTLCDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public UpdateFailHTLC clone() {
long ret = bindings.UpdateFailHTLC_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- UpdateFailHTLC ret_hu_conv = new UpdateFailHTLC(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_UpdateFailHTLCDecodeErrorZ read(byte[] ser) {
long ret = bindings.UpdateFailHTLC_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_UpdateFailHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailHTLCDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public UpdateFailMalformedHTLC clone() {
long ret = bindings.UpdateFailMalformedHTLC_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- UpdateFailMalformedHTLC ret_hu_conv = new UpdateFailMalformedHTLC(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_UpdateFailMalformedHTLCDecodeErrorZ read(byte[] ser) {
long ret = bindings.UpdateFailMalformedHTLC_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_UpdateFailMalformedHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailMalformedHTLCDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public static UpdateFee of(byte[] channel_id_arg, int feerate_per_kw_arg) {
long ret = bindings.UpdateFee_new(channel_id_arg, feerate_per_kw_arg);
- if (ret >= 0 && ret < 1024) { return null; }
- UpdateFee ret_hu_conv = new UpdateFee(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public UpdateFee clone() {
long ret = bindings.UpdateFee_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- UpdateFee ret_hu_conv = new UpdateFee(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_UpdateFeeDecodeErrorZ read(byte[] ser) {
long ret = bindings.UpdateFee_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_UpdateFeeDecodeErrorZ ret_hu_conv = Result_UpdateFeeDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public static UpdateFulfillHTLC of(byte[] channel_id_arg, long htlc_id_arg, byte[] payment_preimage_arg) {
long ret = bindings.UpdateFulfillHTLC_new(channel_id_arg, htlc_id_arg, payment_preimage_arg);
- if (ret >= 0 && ret < 1024) { return null; }
- UpdateFulfillHTLC ret_hu_conv = new UpdateFulfillHTLC(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public UpdateFulfillHTLC clone() {
long ret = bindings.UpdateFulfillHTLC_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- UpdateFulfillHTLC ret_hu_conv = new UpdateFulfillHTLC(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_UpdateFulfillHTLCDecodeErrorZ read(byte[] ser) {
long ret = bindings.UpdateFulfillHTLC_read(ser);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_UpdateFulfillHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFulfillHTLCDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
*/
public ChannelHandshakeConfig get_own_channel_config() {
long ret = bindings.UserConfig_get_own_channel_config(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- ChannelHandshakeConfig ret_hu_conv = new ChannelHandshakeConfig(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public ChannelHandshakeLimits get_peer_channel_config_limits() {
long ret = bindings.UserConfig_get_peer_channel_config_limits(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- ChannelHandshakeLimits ret_hu_conv = new ChannelHandshakeLimits(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public ChannelConfig get_channel_options() {
long ret = bindings.UserConfig_get_channel_options(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- ChannelConfig ret_hu_conv = new ChannelConfig(null, ret);
+ 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);
return ret_hu_conv;
}
*/
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);
- if (ret >= 0 && ret < 1024) { return null; }
- UserConfig ret_hu_conv = new UserConfig(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public UserConfig clone() {
long ret = bindings.UserConfig_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- UserConfig ret_hu_conv = new UserConfig(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static UserConfig with_default() {
long ret = bindings.UserConfig_default();
- if (ret >= 0 && ret < 1024) { return null; }
- UserConfig ret_hu_conv = new UserConfig(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public static Result_StringErrorZ sign(byte[] msg, byte[] sk) {
long ret = bindings.sign(msg, sk);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ C2Tuple_BlockHashChannelMonitorZ_read(byte[] ser, KeysInterface arg) {
long ret = bindings.C2Tuple_BlockHashChannelMonitorZ_read(ser, arg == null ? 0 : arg.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
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));
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
ret_hu_conv.ptrs_to.add(arg_fee_estimator);
*/
public static Result_SecretKeyErrorZ derive_private_key(byte[] per_commitment_point, byte[] base_secret) {
long ret = bindings.derive_private_key(per_commitment_point, base_secret);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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(per_commitment_point, base_point);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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(per_commitment_secret, countersignatory_revocation_base_secret);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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(per_commitment_point, countersignatory_revocation_base_point);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_PublicKeyErrorZ ret_hu_conv = Result_PublicKeyErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
}
/**
- * Gets a keysend route from us (payer) to the given target node (payee). This is needed because
- * keysend payments do not have an invoice from which to pull the payee's supported features, which
- * makes it tricky to otherwise supply the `payee_features` parameter of `get_route`.
+ * Finds a route from us (payer) to the given target node (payee).
*
- * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
- */
- public static Result_RouteLightningErrorZ get_keysend_route(byte[] our_node_pubkey, NetworkGraph network, byte[] payee, @Nullable ChannelDetails[] first_hops, RouteHint[] last_hops, long final_value_msat, int final_cltv, Logger logger, Score scorer) {
- long ret = bindings.get_keysend_route(our_node_pubkey, network == null ? 0 : network.ptr & ~1, payee, 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, last_hops != null ? Arrays.stream(last_hops).mapToLong(last_hops_conv_11 -> last_hops_conv_11 == null ? 0 : last_hops_conv_11.ptr & ~1).toArray() : null, final_value_msat, final_cltv, logger == null ? 0 : logger.ptr, scorer == null ? 0 : scorer.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- Result_RouteLightningErrorZ ret_hu_conv = Result_RouteLightningErrorZ.constr_from_ptr(ret);
- ret_hu_conv.ptrs_to.add(network);
- for (ChannelDetails first_hops_conv_16: first_hops) { ret_hu_conv.ptrs_to.add(first_hops_conv_16); };
- ret_hu_conv.ptrs_to.add(logger);
- ret_hu_conv.ptrs_to.add(scorer);
- return ret_hu_conv;
- }
-
- /**
- * Gets a route from us (payer) to the given target node (payee).
- *
- * If the payee provided features in their invoice, they should be provided via payee_features.
+ * If the payee provided features in their invoice, they should be provided via `params.payee`.
* Without this, MPP will only be used if the payee's features are available in the network graph.
*
- * Private routing paths between a public node and the target may be included in `last_hops`.
- * Currently, only the last hop in each path is considered.
+ * Private routing paths between a public node and the target may be included in `params.payee`.
+ *
+ * If some channels aren't announced, it may be useful to fill in `first_hops` with the results
+ * from [`ChannelManager::list_usable_channels`]. If it is filled in, the view of our local
+ * channels from [`NetworkGraph`] will be ignored, and only those in `first_hops` will be used.
+ *
+ * The fees on channels from us to the next hop are ignored as they are assumed to all be equal.
+ * However, the enabled/disabled bit on such channels as well as the `htlc_minimum_msat` /
+ * `htlc_maximum_msat` *are* checked as they may change based on the receiving node.
+ *
+ * # Note
+ *
+ * May be used to re-compute a [`Route`] when handling a [`Event::PaymentPathFailed`]. Any
+ * adjustments to the [`NetworkGraph`] and channel scores should be made prior to calling this
+ * function.
*
- * If some channels aren't announced, it may be useful to fill in a first_hops with the
- * results from a local ChannelManager::list_usable_channels() call. If it is filled in, our
- * view of our local channels (from net_graph_msg_handler) will be ignored, and only those
- * in first_hops will be used.
+ * # Panics
*
- * Panics if first_hops contains channels without short_channel_ids
- * (ChannelManager::list_usable_channels will never include such channels).
+ * Panics if first_hops contains channels without short_channel_ids;
+ * [`ChannelManager::list_usable_channels`] will never include such channels.
*
- * The fees on channels from us to next-hops are ignored (as they are assumed to all be
- * equal), however the enabled/disabled bit on such channels as well as the
- * htlc_minimum_msat/htlc_maximum_msat *are* checked as they may change based on the receiving node.
+ * [`ChannelManager::list_usable_channels`]: crate::ln::channelmanager::ChannelManager::list_usable_channels
+ * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
*
- * Note that payee_features (or a relevant inner pointer) may be NULL or all-0s to represent None
* Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
*/
- public static Result_RouteLightningErrorZ get_route(byte[] our_node_pubkey, NetworkGraph network, byte[] payee, @Nullable InvoiceFeatures payee_features, @Nullable ChannelDetails[] first_hops, RouteHint[] last_hops, long final_value_msat, int final_cltv, Logger logger, Score scorer) {
- long ret = bindings.get_route(our_node_pubkey, network == null ? 0 : network.ptr & ~1, payee, payee_features == null ? 0 : payee_features.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, last_hops != null ? Arrays.stream(last_hops).mapToLong(last_hops_conv_11 -> last_hops_conv_11 == null ? 0 : last_hops_conv_11.ptr & ~1).toArray() : null, final_value_msat, final_cltv, logger == null ? 0 : logger.ptr, scorer == null ? 0 : scorer.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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(our_node_pubkey, 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);
+ 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);
ret_hu_conv.ptrs_to.add(network);
for (ChannelDetails first_hops_conv_16: first_hops) { ret_hu_conv.ptrs_to.add(first_hops_conv_16); };
ret_hu_conv.ptrs_to.add(logger);
*/
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);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
return ret_hu_conv;
*/
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);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
ret_hu_conv.ptrs_to.add(keys_manager);
/**
* Returns any monitor events since the last call. Subsequent calls must only return new
* events.
+ *
+ * Note that after any block- or transaction-connection calls to a [`ChannelMonitor`], no
+ * further events may be returned here until the [`ChannelMonitor`] has been fully persisted
+ * to disk.
+ *
+ * For details on asynchronous [`ChannelMonitor`] updating and returning
+ * [`MonitorEvent::UpdateCompleted`] here, see [`ChannelMonitorUpdateErr::TemporaryFailure`].
*/
MonitorEvent[] release_pending_monitor_events();
}
final LDKWatchHolder impl_holder = new LDKWatchHolder();
impl_holder.held = new Watch(new bindings.LDKWatch() {
@Override public long watch_channel(long funding_txo, long monitor) {
- OutPoint funding_txo_hu_conv = new OutPoint(null, funding_txo);
+ OutPoint funding_txo_hu_conv = null; if (funding_txo < 0 || funding_txo > 4096) { funding_txo_hu_conv = new OutPoint(null, funding_txo); }
funding_txo_hu_conv.ptrs_to.add(this);
- ChannelMonitor monitor_hu_conv = new ChannelMonitor(null, monitor);
+ ChannelMonitor monitor_hu_conv = null; if (monitor < 0 || monitor > 4096) { monitor_hu_conv = new ChannelMonitor(null, monitor); }
monitor_hu_conv.ptrs_to.add(this);
Result_NoneChannelMonitorUpdateErrZ ret = arg.watch_channel(funding_txo_hu_conv, monitor_hu_conv);
long result = ret != null ? ret.ptr : 0;
return result;
}
@Override public long update_channel(long funding_txo, long update) {
- OutPoint funding_txo_hu_conv = new OutPoint(null, funding_txo);
+ OutPoint funding_txo_hu_conv = null; if (funding_txo < 0 || funding_txo > 4096) { funding_txo_hu_conv = new OutPoint(null, funding_txo); }
funding_txo_hu_conv.ptrs_to.add(this);
- ChannelMonitorUpdate update_hu_conv = new ChannelMonitorUpdate(null, update);
+ ChannelMonitorUpdate update_hu_conv = null; if (update < 0 || update > 4096) { update_hu_conv = new ChannelMonitorUpdate(null, update); }
update_hu_conv.ptrs_to.add(this);
Result_NoneChannelMonitorUpdateErrZ ret = arg.update_channel(funding_txo_hu_conv, update_hu_conv);
long result = ret != null ? ret.ptr : 0;
*/
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);
- if (ret >= 0 && ret < 1024) { return null; }
+ 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);
- if (ret >= 0 && ret < 1024) { return null; }
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneChannelMonitorUpdateErrZ ret_hu_conv = Result_NoneChannelMonitorUpdateErrZ.constr_from_ptr(ret);
return ret_hu_conv;
}
/**
* Returns any monitor events since the last call. Subsequent calls must only return new
* events.
+ *
+ * Note that after any block- or transaction-connection calls to a [`ChannelMonitor`], no
+ * further events may be returned here until the [`ChannelMonitor`] has been fully persisted
+ * to disk.
+ *
+ * For details on asynchronous [`ChannelMonitor`] updating and returning
+ * [`MonitorEvent::UpdateCompleted`] here, see [`ChannelMonitorUpdateErr::TemporaryFailure`].
*/
public MonitorEvent[] release_pending_monitor_events() {
long[] ret = bindings.Watch_release_pending_monitor_events(this.ptr);
*/
public OutPoint get_outpoint() {
long ret = bindings.WatchedOutput_get_outpoint(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- OutPoint ret_hu_conv = new OutPoint(null, ret);
+ 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;
}
*/
public static WatchedOutput of(byte[] block_hash_arg, OutPoint outpoint_arg, byte[] script_pubkey_arg) {
long ret = bindings.WatchedOutput_new(block_hash_arg, outpoint_arg == null ? 0 : outpoint_arg.ptr & ~1, script_pubkey_arg);
- if (ret >= 0 && ret < 1024) { return null; }
- WatchedOutput ret_hu_conv = new WatchedOutput(null, ret);
+ 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);
return ret_hu_conv;
}
*/
public WatchedOutput clone() {
long ret = bindings.WatchedOutput_clone(this.ptr);
- if (ret >= 0 && ret < 1024) { return null; }
- WatchedOutput ret_hu_conv = new WatchedOutput(null, ret);
+ 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);
return ret_hu_conv;
}
#define DEBUG_PRINT(...) fprintf(stderr, __VA_ARGS__)
#define MALLOC(a, _) malloc(a)
-#define FREE(p) if ((uint64_t)(p) > 1024) { free(p); }
+#define FREE(p) if ((uint64_t)(p) > 4096) { free(p); }
#define CHECK_ACCESS(p)
#define DO_ASSERT(a) (void)(a)
#define CHECK(a)
LDKCResult_TxCreationKeysDecodeErrorZ *val = (LDKCResult_TxCreationKeysDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKTxCreationKeys 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_TxCreationKeysDecodeErrorZ *val = (LDKCResult_TxCreationKeysDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelPublicKeysDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ChannelPublicKeysDecodeErrorZ *val = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKChannelPublicKeys 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelPublicKeysDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ChannelPublicKeysDecodeErrorZ *val = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_TxCreationKeysErrorZ *val = (LDKCResult_TxCreationKeysErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKTxCreationKeys 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *val = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKHTLCOutputInCommitment 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HTLCOutputInCommitmentDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *val = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *val = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKCounterpartyChannelTransactionParameters 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *val = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelTransactionParametersDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ChannelTransactionParametersDecodeErrorZ *val = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKChannelTransactionParameters 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelTransactionParametersDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ChannelTransactionParametersDecodeErrorZ *val = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HolderCommitmentTransactionDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_HolderCommitmentTransactionDecodeErrorZ *val = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKHolderCommitmentTransaction 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HolderCommitmentTransactionDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_HolderCommitmentTransactionDecodeErrorZ *val = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1BuiltCommitmentTransactionDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *val = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKBuiltCommitmentTransaction 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1BuiltCommitmentTransactionDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *val = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TrustedClosingTransactionNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_TrustedClosingTransactionNoneZ *val = (LDKCResult_TrustedClosingTransactionNoneZ*)(arg & ~1);
CHECK(val->result_ok);
LDKTrustedClosingTransaction 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TrustedClosingTransactionNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_CommitmentTransactionDecodeErrorZ *val = (LDKCResult_CommitmentTransactionDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKCommitmentTransaction 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CommitmentTransactionDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_CommitmentTransactionDecodeErrorZ *val = (LDKCResult_CommitmentTransactionDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TrustedCommitmentTransactionNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_TrustedCommitmentTransactionNoneZ *val = (LDKCResult_TrustedCommitmentTransactionNoneZ*)(arg & ~1);
CHECK(val->result_ok);
LDKTrustedCommitmentTransaction 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TrustedCommitmentTransactionNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_CVec_SignatureZNoneZ *val = (LDKCResult_CVec_SignatureZNoneZ*)(arg & ~1);
CHECK(val->result_ok);
LDKCVec_SignatureZ res_var = (*val->contents.result);
- jobjectArray res_arr = (*env)->NewObjectArray(env, res_var.datalen, arr_of_B_clz, NULL);
+ jobjectArray res_arr = NULL;
+ res_arr = (*env)->NewObjectArray(env, res_var.datalen, arr_of_B_clz, NULL);
;
for (size_t i = 0; i < res_var.datalen; i++) {
int8_tArray res_conv_8_arr = (*env)->NewByteArray(env, 64);
(*env)->SetByteArrayRegion(env, res_conv_8_arr, 0, 64, res_var.data[i].compact_form);
(*env)->SetObjectArrayElement(env, res_arr, i, res_conv_8_arr);
}
+
return res_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1SignatureZNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ShutdownScriptDecodeErrorZ *val = (LDKCResult_ShutdownScriptDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKShutdownScript 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownScriptDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ShutdownScriptDecodeErrorZ *val = (LDKCResult_ShutdownScriptDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownScriptInvalidShutdownScriptZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ShutdownScriptInvalidShutdownScriptZ *val = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(arg & ~1);
CHECK(val->result_ok);
LDKShutdownScript 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownScriptInvalidShutdownScriptZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ShutdownScriptInvalidShutdownScriptZ *val = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(arg & ~1);
CHECK(!val->result_ok);
LDKInvalidShutdownScript 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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_RouteHopDecodeErrorZ *val = (LDKCResult_RouteHopDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKRouteHop 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHopDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_RouteHopDecodeErrorZ *val = (LDKCResult_RouteHopDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1RouteHopZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
LDKCResult_RouteDecodeErrorZ *val = (LDKCResult_RouteDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKRoute 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_RouteDecodeErrorZ *val = (LDKCResult_RouteDecodeErrorZ*)(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.
+ err_ref = (uint64_t)err_var.inner & ~1;
+ return err_ref;
+}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteParametersDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ return ((LDKCResult_RouteParametersDecodeErrorZ*)arg)->result_ok;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteParametersDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_RouteParametersDecodeErrorZ *val = (LDKCResult_RouteParametersDecodeErrorZ*)(arg & ~1);
+ CHECK(val->result_ok);
+ LDKRouteParameters 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_1RouteParametersDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_RouteParametersDecodeErrorZ *val = (LDKCResult_RouteParametersDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1RouteHintZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
+ LDKCVec_RouteHintZ *ret = MALLOC(sizeof(LDKCVec_RouteHintZ), "LDKCVec_RouteHintZ");
+ ret->datalen = (*env)->GetArrayLength(env, elems);
+ if (ret->datalen == 0) {
+ ret->data = NULL;
+ } else {
+ ret->data = MALLOC(sizeof(LDKRouteHint) * ret->datalen, "LDKCVec_RouteHintZ Data");
+ int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
+ for (size_t i = 0; i < ret->datalen; i++) {
+ int64_t arr_elem = java_elems[i];
+ LDKRouteHint arr_elem_conv;
+ arr_elem_conv.inner = (void*)(arr_elem & (~1));
+ arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0);
+ arr_elem_conv = RouteHint_clone(&arr_elem_conv);
+ ret->data[i] = arr_elem_conv;
+ }
+ (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
+ }
+ return (uint64_t)ret;
+}
+static inline LDKCVec_RouteHintZ CVec_RouteHintZ_clone(const LDKCVec_RouteHintZ *orig) {
+ LDKCVec_RouteHintZ ret = { .data = MALLOC(sizeof(LDKRouteHint) * orig->datalen, "LDKCVec_RouteHintZ clone bytes"), .datalen = orig->datalen };
+ for (size_t i = 0; i < ret.datalen; i++) {
+ ret.data[i] = RouteHint_clone(&orig->data[i]);
+ }
+ return ret;
+}
static jclass LDKCOption_u64Z_Some_class = NULL;
static jmethodID LDKCOption_u64Z_Some_meth = NULL;
static jclass LDKCOption_u64Z_None_class = NULL;
default: abort();
}
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1ChannelDetailsZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
- LDKCVec_ChannelDetailsZ *ret = MALLOC(sizeof(LDKCVec_ChannelDetailsZ), "LDKCVec_ChannelDetailsZ");
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PayeeDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ return ((LDKCResult_PayeeDecodeErrorZ*)arg)->result_ok;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PayeeDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_PayeeDecodeErrorZ *val = (LDKCResult_PayeeDecodeErrorZ*)(arg & ~1);
+ CHECK(val->result_ok);
+ LDKPayee 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_1PayeeDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_PayeeDecodeErrorZ *val = (LDKCResult_PayeeDecodeErrorZ*)(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.
+ err_ref = (uint64_t)err_var.inner & ~1;
+ return err_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1RouteHintHopZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
+ LDKCVec_RouteHintHopZ *ret = MALLOC(sizeof(LDKCVec_RouteHintHopZ), "LDKCVec_RouteHintHopZ");
ret->datalen = (*env)->GetArrayLength(env, elems);
if (ret->datalen == 0) {
ret->data = NULL;
} else {
- ret->data = MALLOC(sizeof(LDKChannelDetails) * ret->datalen, "LDKCVec_ChannelDetailsZ Data");
+ ret->data = MALLOC(sizeof(LDKRouteHintHop) * ret->datalen, "LDKCVec_RouteHintHopZ Data");
int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
for (size_t i = 0; i < ret->datalen; i++) {
int64_t arr_elem = java_elems[i];
- LDKChannelDetails arr_elem_conv;
+ LDKRouteHintHop arr_elem_conv;
arr_elem_conv.inner = (void*)(arr_elem & (~1));
arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0);
- arr_elem_conv = ChannelDetails_clone(&arr_elem_conv);
+ arr_elem_conv = RouteHintHop_clone(&arr_elem_conv);
ret->data[i] = arr_elem_conv;
}
(*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
}
return (uint64_t)ret;
}
-static inline LDKCVec_ChannelDetailsZ CVec_ChannelDetailsZ_clone(const LDKCVec_ChannelDetailsZ *orig) {
- LDKCVec_ChannelDetailsZ ret = { .data = MALLOC(sizeof(LDKChannelDetails) * orig->datalen, "LDKCVec_ChannelDetailsZ clone bytes"), .datalen = orig->datalen };
+static inline LDKCVec_RouteHintHopZ CVec_RouteHintHopZ_clone(const LDKCVec_RouteHintHopZ *orig) {
+ LDKCVec_RouteHintHopZ ret = { .data = MALLOC(sizeof(LDKRouteHintHop) * orig->datalen, "LDKCVec_RouteHintHopZ clone bytes"), .datalen = orig->datalen };
for (size_t i = 0; i < ret.datalen; i++) {
- ret.data[i] = ChannelDetails_clone(&orig->data[i]);
+ ret.data[i] = RouteHintHop_clone(&orig->data[i]);
}
return ret;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1RouteHintZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
- LDKCVec_RouteHintZ *ret = MALLOC(sizeof(LDKCVec_RouteHintZ), "LDKCVec_RouteHintZ");
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHintDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ return ((LDKCResult_RouteHintDecodeErrorZ*)arg)->result_ok;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHintDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_RouteHintDecodeErrorZ *val = (LDKCResult_RouteHintDecodeErrorZ*)(arg & ~1);
+ CHECK(val->result_ok);
+ LDKRouteHint 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_1RouteHintDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_RouteHintDecodeErrorZ *val = (LDKCResult_RouteHintDecodeErrorZ*)(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.
+ err_ref = (uint64_t)err_var.inner & ~1;
+ return err_ref;
+}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHintHopDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ return ((LDKCResult_RouteHintHopDecodeErrorZ*)arg)->result_ok;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHintHopDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_RouteHintHopDecodeErrorZ *val = (LDKCResult_RouteHintHopDecodeErrorZ*)(arg & ~1);
+ CHECK(val->result_ok);
+ LDKRouteHintHop 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_1RouteHintHopDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_RouteHintHopDecodeErrorZ *val = (LDKCResult_RouteHintHopDecodeErrorZ*)(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.
+ err_ref = (uint64_t)err_var.inner & ~1;
+ return err_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1ChannelDetailsZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
+ LDKCVec_ChannelDetailsZ *ret = MALLOC(sizeof(LDKCVec_ChannelDetailsZ), "LDKCVec_ChannelDetailsZ");
ret->datalen = (*env)->GetArrayLength(env, elems);
if (ret->datalen == 0) {
ret->data = NULL;
} else {
- ret->data = MALLOC(sizeof(LDKRouteHint) * ret->datalen, "LDKCVec_RouteHintZ Data");
+ ret->data = MALLOC(sizeof(LDKChannelDetails) * ret->datalen, "LDKCVec_ChannelDetailsZ Data");
int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
for (size_t i = 0; i < ret->datalen; i++) {
int64_t arr_elem = java_elems[i];
- LDKRouteHint arr_elem_conv;
+ LDKChannelDetails arr_elem_conv;
arr_elem_conv.inner = (void*)(arr_elem & (~1));
arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0);
- arr_elem_conv = RouteHint_clone(&arr_elem_conv);
+ arr_elem_conv = ChannelDetails_clone(&arr_elem_conv);
ret->data[i] = arr_elem_conv;
}
(*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
}
return (uint64_t)ret;
}
-static inline LDKCVec_RouteHintZ CVec_RouteHintZ_clone(const LDKCVec_RouteHintZ *orig) {
- LDKCVec_RouteHintZ ret = { .data = MALLOC(sizeof(LDKRouteHint) * orig->datalen, "LDKCVec_RouteHintZ clone bytes"), .datalen = orig->datalen };
+static inline LDKCVec_ChannelDetailsZ CVec_ChannelDetailsZ_clone(const LDKCVec_ChannelDetailsZ *orig) {
+ LDKCVec_ChannelDetailsZ ret = { .data = MALLOC(sizeof(LDKChannelDetails) * orig->datalen, "LDKCVec_ChannelDetailsZ clone bytes"), .datalen = orig->datalen };
for (size_t i = 0; i < ret.datalen; i++) {
- ret.data[i] = RouteHint_clone(&orig->data[i]);
+ ret.data[i] = ChannelDetails_clone(&orig->data[i]);
}
return ret;
}
LDKCResult_RouteLightningErrorZ *val = (LDKCResult_RouteLightningErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKRoute 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteLightningErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_RouteLightningErrorZ *val = (LDKCResult_RouteLightningErrorZ*)(arg & ~1);
CHECK(!val->result_ok);
LDKLightningError 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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxOutAccessErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
static jmethodID LDKMonitorEvent_HTLCEvent_meth = NULL;
static jclass LDKMonitorEvent_CommitmentTxConfirmed_class = NULL;
static jmethodID LDKMonitorEvent_CommitmentTxConfirmed_meth = NULL;
+static jclass LDKMonitorEvent_UpdateCompleted_class = NULL;
+static jmethodID LDKMonitorEvent_UpdateCompleted_meth = NULL;
+static jclass LDKMonitorEvent_UpdateFailed_class = 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;"));
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;"));
+ 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;"));
+ CHECK(LDKMonitorEvent_UpdateFailed_class != NULL);
+ LDKMonitorEvent_UpdateFailed_meth = (*env)->GetMethodID(env, LDKMonitorEvent_UpdateFailed_class, "<init>", "(J)V");
+ CHECK(LDKMonitorEvent_UpdateFailed_meth != NULL);
}
JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMonitorEvent_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
LDKMonitorEvent *obj = (LDKMonitorEvent*)(ptr & ~1);
switch(obj->tag) {
case LDKMonitorEvent_HTLCEvent: {
LDKHTLCUpdate htlc_event_var = obj->htlc_event;
+ uint64_t htlc_event_ref = 0;
CHECK((((uint64_t)htlc_event_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&htlc_event_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t htlc_event_ref = (uint64_t)htlc_event_var.inner & ~1;
+ htlc_event_ref = (uint64_t)htlc_event_var.inner & ~1;
return (*env)->NewObject(env, LDKMonitorEvent_HTLCEvent_class, LDKMonitorEvent_HTLCEvent_meth, htlc_event_ref);
}
case LDKMonitorEvent_CommitmentTxConfirmed: {
LDKOutPoint commitment_tx_confirmed_var = obj->commitment_tx_confirmed;
+ uint64_t commitment_tx_confirmed_ref = 0;
CHECK((((uint64_t)commitment_tx_confirmed_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&commitment_tx_confirmed_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t commitment_tx_confirmed_ref = (uint64_t)commitment_tx_confirmed_var.inner & ~1;
+ commitment_tx_confirmed_ref = (uint64_t)commitment_tx_confirmed_var.inner & ~1;
return (*env)->NewObject(env, LDKMonitorEvent_CommitmentTxConfirmed_class, LDKMonitorEvent_CommitmentTxConfirmed_meth, commitment_tx_confirmed_ref);
}
+ case LDKMonitorEvent_UpdateCompleted: {
+ LDKOutPoint funding_txo_var = obj->update_completed.funding_txo;
+ uint64_t funding_txo_ref = 0;
+ CHECK((((uint64_t)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&funding_txo_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ funding_txo_ref = (uint64_t)funding_txo_var.inner & ~1;
+ return (*env)->NewObject(env, LDKMonitorEvent_UpdateCompleted_class, LDKMonitorEvent_UpdateCompleted_meth, funding_txo_ref, obj->update_completed.monitor_update_id);
+ }
+ case LDKMonitorEvent_UpdateFailed: {
+ LDKOutPoint update_failed_var = obj->update_failed;
+ uint64_t update_failed_ref = 0;
+ CHECK((((uint64_t)update_failed_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&update_failed_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ update_failed_ref = (uint64_t)update_failed_var.inner & ~1;
+ return (*env)->NewObject(env, LDKMonitorEvent_UpdateFailed_class, LDKMonitorEvent_UpdateFailed_meth, update_failed_ref);
+ }
default: abort();
}
}
switch(obj->tag) {
case LDKNetworkUpdate_ChannelUpdateMessage: {
LDKChannelUpdate msg_var = obj->channel_update_message.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return (*env)->NewObject(env, LDKNetworkUpdate_ChannelUpdateMessage_class, LDKNetworkUpdate_ChannelUpdateMessage_meth, msg_ref);
}
case LDKNetworkUpdate_ChannelClosed: {
switch(obj->tag) {
case LDKSpendableOutputDescriptor_StaticOutput: {
LDKOutPoint outpoint_var = obj->static_output.outpoint;
+ uint64_t outpoint_ref = 0;
CHECK((((uint64_t)outpoint_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&outpoint_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t outpoint_ref = (uint64_t)outpoint_var.inner & ~1;
+ outpoint_ref = (uint64_t)outpoint_var.inner & ~1;
uint64_t output_ref = ((uint64_t)&obj->static_output.output) | 1;
return (*env)->NewObject(env, LDKSpendableOutputDescriptor_StaticOutput_class, LDKSpendableOutputDescriptor_StaticOutput_meth, outpoint_ref, (uint64_t)output_ref);
}
case LDKSpendableOutputDescriptor_DelayedPaymentOutput: {
LDKDelayedPaymentOutputDescriptor delayed_payment_output_var = obj->delayed_payment_output;
+ uint64_t delayed_payment_output_ref = 0;
CHECK((((uint64_t)delayed_payment_output_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&delayed_payment_output_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t delayed_payment_output_ref = (uint64_t)delayed_payment_output_var.inner & ~1;
+ delayed_payment_output_ref = (uint64_t)delayed_payment_output_var.inner & ~1;
return (*env)->NewObject(env, LDKSpendableOutputDescriptor_DelayedPaymentOutput_class, LDKSpendableOutputDescriptor_DelayedPaymentOutput_meth, delayed_payment_output_ref);
}
case LDKSpendableOutputDescriptor_StaticPaymentOutput: {
LDKStaticPaymentOutputDescriptor static_payment_output_var = obj->static_payment_output;
+ uint64_t static_payment_output_ref = 0;
CHECK((((uint64_t)static_payment_output_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&static_payment_output_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t static_payment_output_ref = (uint64_t)static_payment_output_var.inner & ~1;
+ static_payment_output_ref = (uint64_t)static_payment_output_var.inner & ~1;
return (*env)->NewObject(env, LDKSpendableOutputDescriptor_StaticPaymentOutput_class, LDKSpendableOutputDescriptor_StaticPaymentOutput_meth, static_payment_output_ref);
}
default: abort();
switch(obj->tag) {
case LDKErrorAction_DisconnectPeer: {
LDKErrorMessage msg_var = obj->disconnect_peer.msg;
- CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
- CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ uint64_t msg_ref = 0;
+ if ((uint64_t)msg_var.inner > 4096) {
+ CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ msg_ref = (uint64_t)msg_var.inner & ~1;
+ }
return (*env)->NewObject(env, LDKErrorAction_DisconnectPeer_class, LDKErrorAction_DisconnectPeer_meth, msg_ref);
}
case LDKErrorAction_IgnoreError: {
}
case LDKErrorAction_SendErrorMessage: {
LDKErrorMessage msg_var = obj->send_error_message.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return (*env)->NewObject(env, LDKErrorAction_SendErrorMessage_class, LDKErrorAction_SendErrorMessage_meth, msg_ref);
}
default: abort();
int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_accept_channel.node_id.compressed_form);
LDKAcceptChannel msg_var = obj->send_accept_channel.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return (*env)->NewObject(env, LDKMessageSendEvent_SendAcceptChannel_class, LDKMessageSendEvent_SendAcceptChannel_meth, node_id_arr, msg_ref);
}
case LDKMessageSendEvent_SendOpenChannel: {
int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_open_channel.node_id.compressed_form);
LDKOpenChannel msg_var = obj->send_open_channel.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return (*env)->NewObject(env, LDKMessageSendEvent_SendOpenChannel_class, LDKMessageSendEvent_SendOpenChannel_meth, node_id_arr, msg_ref);
}
case LDKMessageSendEvent_SendFundingCreated: {
int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_funding_created.node_id.compressed_form);
LDKFundingCreated msg_var = obj->send_funding_created.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return (*env)->NewObject(env, LDKMessageSendEvent_SendFundingCreated_class, LDKMessageSendEvent_SendFundingCreated_meth, node_id_arr, msg_ref);
}
case LDKMessageSendEvent_SendFundingSigned: {
int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_funding_signed.node_id.compressed_form);
LDKFundingSigned msg_var = obj->send_funding_signed.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return (*env)->NewObject(env, LDKMessageSendEvent_SendFundingSigned_class, LDKMessageSendEvent_SendFundingSigned_meth, node_id_arr, msg_ref);
}
case LDKMessageSendEvent_SendFundingLocked: {
int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_funding_locked.node_id.compressed_form);
LDKFundingLocked msg_var = obj->send_funding_locked.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return (*env)->NewObject(env, LDKMessageSendEvent_SendFundingLocked_class, LDKMessageSendEvent_SendFundingLocked_meth, node_id_arr, msg_ref);
}
case LDKMessageSendEvent_SendAnnouncementSignatures: {
int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_announcement_signatures.node_id.compressed_form);
LDKAnnouncementSignatures msg_var = obj->send_announcement_signatures.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return (*env)->NewObject(env, LDKMessageSendEvent_SendAnnouncementSignatures_class, LDKMessageSendEvent_SendAnnouncementSignatures_meth, node_id_arr, msg_ref);
}
case LDKMessageSendEvent_UpdateHTLCs: {
int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->update_htl_cs.node_id.compressed_form);
LDKCommitmentUpdate updates_var = obj->update_htl_cs.updates;
+ uint64_t updates_ref = 0;
CHECK((((uint64_t)updates_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&updates_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t updates_ref = (uint64_t)updates_var.inner & ~1;
+ updates_ref = (uint64_t)updates_var.inner & ~1;
return (*env)->NewObject(env, LDKMessageSendEvent_UpdateHTLCs_class, LDKMessageSendEvent_UpdateHTLCs_meth, node_id_arr, updates_ref);
}
case LDKMessageSendEvent_SendRevokeAndACK: {
int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_revoke_and_ack.node_id.compressed_form);
LDKRevokeAndACK msg_var = obj->send_revoke_and_ack.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return (*env)->NewObject(env, LDKMessageSendEvent_SendRevokeAndACK_class, LDKMessageSendEvent_SendRevokeAndACK_meth, node_id_arr, msg_ref);
}
case LDKMessageSendEvent_SendClosingSigned: {
int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_closing_signed.node_id.compressed_form);
LDKClosingSigned msg_var = obj->send_closing_signed.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return (*env)->NewObject(env, LDKMessageSendEvent_SendClosingSigned_class, LDKMessageSendEvent_SendClosingSigned_meth, node_id_arr, msg_ref);
}
case LDKMessageSendEvent_SendShutdown: {
int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_shutdown.node_id.compressed_form);
LDKShutdown msg_var = obj->send_shutdown.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return (*env)->NewObject(env, LDKMessageSendEvent_SendShutdown_class, LDKMessageSendEvent_SendShutdown_meth, node_id_arr, msg_ref);
}
case LDKMessageSendEvent_SendChannelReestablish: {
int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_channel_reestablish.node_id.compressed_form);
LDKChannelReestablish msg_var = obj->send_channel_reestablish.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return (*env)->NewObject(env, LDKMessageSendEvent_SendChannelReestablish_class, LDKMessageSendEvent_SendChannelReestablish_meth, node_id_arr, msg_ref);
}
case LDKMessageSendEvent_BroadcastChannelAnnouncement: {
LDKChannelAnnouncement msg_var = obj->broadcast_channel_announcement.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
LDKChannelUpdate update_msg_var = obj->broadcast_channel_announcement.update_msg;
+ uint64_t update_msg_ref = 0;
CHECK((((uint64_t)update_msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&update_msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t update_msg_ref = (uint64_t)update_msg_var.inner & ~1;
+ update_msg_ref = (uint64_t)update_msg_var.inner & ~1;
return (*env)->NewObject(env, LDKMessageSendEvent_BroadcastChannelAnnouncement_class, LDKMessageSendEvent_BroadcastChannelAnnouncement_meth, msg_ref, update_msg_ref);
}
case LDKMessageSendEvent_BroadcastNodeAnnouncement: {
LDKNodeAnnouncement msg_var = obj->broadcast_node_announcement.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return (*env)->NewObject(env, LDKMessageSendEvent_BroadcastNodeAnnouncement_class, LDKMessageSendEvent_BroadcastNodeAnnouncement_meth, msg_ref);
}
case LDKMessageSendEvent_BroadcastChannelUpdate: {
LDKChannelUpdate msg_var = obj->broadcast_channel_update.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return (*env)->NewObject(env, LDKMessageSendEvent_BroadcastChannelUpdate_class, LDKMessageSendEvent_BroadcastChannelUpdate_meth, msg_ref);
}
case LDKMessageSendEvent_SendChannelUpdate: {
int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_channel_update.node_id.compressed_form);
LDKChannelUpdate msg_var = obj->send_channel_update.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return (*env)->NewObject(env, LDKMessageSendEvent_SendChannelUpdate_class, LDKMessageSendEvent_SendChannelUpdate_meth, node_id_arr, msg_ref);
}
case LDKMessageSendEvent_HandleError: {
int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_channel_range_query.node_id.compressed_form);
LDKQueryChannelRange msg_var = obj->send_channel_range_query.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return (*env)->NewObject(env, LDKMessageSendEvent_SendChannelRangeQuery_class, LDKMessageSendEvent_SendChannelRangeQuery_meth, node_id_arr, msg_ref);
}
case LDKMessageSendEvent_SendShortIdsQuery: {
int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_short_ids_query.node_id.compressed_form);
LDKQueryShortChannelIds msg_var = obj->send_short_ids_query.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return (*env)->NewObject(env, LDKMessageSendEvent_SendShortIdsQuery_class, LDKMessageSendEvent_SendShortIdsQuery_meth, node_id_arr, msg_ref);
}
case LDKMessageSendEvent_SendReplyChannelRange: {
int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_reply_channel_range.node_id.compressed_form);
LDKReplyChannelRange msg_var = obj->send_reply_channel_range.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return (*env)->NewObject(env, LDKMessageSendEvent_SendReplyChannelRange_class, LDKMessageSendEvent_SendReplyChannelRange_meth, node_id_arr, msg_ref);
}
default: abort();
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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ 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;
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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeFeaturesDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_NodeFeaturesDecodeErrorZ *val = (LDKCResult_NodeFeaturesDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ 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);
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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelFeaturesDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ChannelFeaturesDecodeErrorZ *val = (LDKCResult_ChannelFeaturesDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKChannelFeatures 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ChannelFeaturesDecodeErrorZ *val = (LDKCResult_ChannelFeaturesDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceFeaturesDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_InvoiceFeaturesDecodeErrorZ *val = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ 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);
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.
+ err_ref = (uint64_t)err_var.inner & ~1;
+ return err_ref;
+}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScoringParametersDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ return ((LDKCResult_ScoringParametersDecodeErrorZ*)arg)->result_ok;
+}
+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);
+ 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_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;
+ 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.
+ err_ref = (uint64_t)err_var.inner & ~1;
+ return err_ref;
+}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScorerDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ return ((LDKCResult_ScorerDecodeErrorZ*)arg)->result_ok;
+}
+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);
+ 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_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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *val = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKDelayedPaymentOutputDescriptor 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *val = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *val = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKStaticPaymentOutputDescriptor 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *val = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SpendableOutputDescriptorDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_SpendableOutputDescriptorDecodeErrorZ *val = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1get_1b(JNIEnv *env, jclass clz, int64_t tuple) {
LDKC2Tuple_SignatureCVec_SignatureZZ* tuple_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)(tuple & ~1);
LDKCVec_SignatureZ ret_var = C2Tuple_SignatureCVec_SignatureZZ_get_b(tuple_conv);
- jobjectArray ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
+ jobjectArray ret_arr = NULL;
+ ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
;
for (size_t i = 0; i < ret_var.datalen; i++) {
int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 64);
(*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 64, ret_var.data[i].compact_form);
(*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr);
}
+
FREE(ret_var.data);
return ret_arr;
}
DO_ASSERT(get_jenv_res == JNI_OK);
}
LDKHolderCommitmentTransaction holder_tx_var = *holder_tx;
+ uint64_t holder_tx_ref = 0;
holder_tx_var = HolderCommitmentTransaction_clone(holder_tx);
CHECK((((uint64_t)holder_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&holder_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t holder_tx_ref = (uint64_t)holder_tx_var.inner;
+ holder_tx_ref = (uint64_t)holder_tx_var.inner;
if (holder_tx_var.is_owned) {
holder_tx_ref |= 1;
}
DO_ASSERT(get_jenv_res == JNI_OK);
}
LDKCommitmentTransaction commitment_tx_var = *commitment_tx;
+ uint64_t commitment_tx_ref = 0;
commitment_tx_var = CommitmentTransaction_clone(commitment_tx);
CHECK((((uint64_t)commitment_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&commitment_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t commitment_tx_ref = (uint64_t)commitment_tx_var.inner;
+ commitment_tx_ref = (uint64_t)commitment_tx_var.inner;
if (commitment_tx_var.is_owned) {
commitment_tx_ref |= 1;
}
DO_ASSERT(get_jenv_res == JNI_OK);
}
LDKHolderCommitmentTransaction commitment_tx_var = *commitment_tx;
+ uint64_t commitment_tx_ref = 0;
commitment_tx_var = HolderCommitmentTransaction_clone(commitment_tx);
CHECK((((uint64_t)commitment_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&commitment_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t commitment_tx_ref = (uint64_t)commitment_tx_var.inner;
+ commitment_tx_ref = (uint64_t)commitment_tx_var.inner;
if (commitment_tx_var.is_owned) {
commitment_tx_ref |= 1;
}
int8_tArray per_commitment_key_arr = (*env)->NewByteArray(env, 32);
(*env)->SetByteArrayRegion(env, per_commitment_key_arr, 0, 32, *per_commitment_key);
LDKHTLCOutputInCommitment htlc_var = *htlc;
+ uint64_t htlc_ref = 0;
htlc_var = HTLCOutputInCommitment_clone(htlc);
CHECK((((uint64_t)htlc_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&htlc_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t htlc_ref = (uint64_t)htlc_var.inner;
+ htlc_ref = (uint64_t)htlc_var.inner;
if (htlc_var.is_owned) {
htlc_ref |= 1;
}
int8_tArray per_commitment_point_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, per_commitment_point_arr, 0, 33, per_commitment_point.compressed_form);
LDKHTLCOutputInCommitment htlc_var = *htlc;
+ uint64_t htlc_ref = 0;
htlc_var = HTLCOutputInCommitment_clone(htlc);
CHECK((((uint64_t)htlc_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&htlc_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t htlc_ref = (uint64_t)htlc_var.inner;
+ htlc_ref = (uint64_t)htlc_var.inner;
if (htlc_var.is_owned) {
htlc_ref |= 1;
}
DO_ASSERT(get_jenv_res == JNI_OK);
}
LDKClosingTransaction closing_tx_var = *closing_tx;
+ uint64_t closing_tx_ref = 0;
closing_tx_var = ClosingTransaction_clone(closing_tx);
CHECK((((uint64_t)closing_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&closing_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t closing_tx_ref = (uint64_t)closing_tx_var.inner;
+ closing_tx_ref = (uint64_t)closing_tx_var.inner;
if (closing_tx_var.is_owned) {
closing_tx_ref |= 1;
}
DO_ASSERT(get_jenv_res == JNI_OK);
}
LDKUnsignedChannelAnnouncement msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = UnsignedChannelAnnouncement_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
DO_ASSERT(get_jenv_res == JNI_OK);
}
LDKChannelTransactionParameters channel_parameters_var = *channel_parameters;
+ uint64_t channel_parameters_ref = 0;
channel_parameters_var = ChannelTransactionParameters_clone(channel_parameters);
CHECK((((uint64_t)channel_parameters_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&channel_parameters_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t channel_parameters_ref = (uint64_t)channel_parameters_var.inner;
+ channel_parameters_ref = (uint64_t)channel_parameters_var.inner;
if (channel_parameters_var.is_owned) {
channel_parameters_ref |= 1;
}
if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
LDKChannelPublicKeys ret_var = LDKBaseSign_set_get_pubkeys(this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_SignDecodeErrorZ *val = (LDKCResult_SignDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
- LDKSign* res_ret =MALLOC(sizeof(LDKSign), "LDKSign");
+ LDKSign* res_ret = MALLOC(sizeof(LDKSign), "LDKSign");
*res_ret = Sign_clone(&(*val->contents.result));
return (uint64_t)res_ret;
}
LDKCResult_SignDecodeErrorZ *val = (LDKCResult_SignDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RecoverableSignatureNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_CVec_CVec_u8ZZNoneZ *val = (LDKCResult_CVec_CVec_u8ZZNoneZ*)(arg & ~1);
CHECK(val->result_ok);
LDKCVec_CVec_u8ZZ res_var = (*val->contents.result);
- jobjectArray res_arr = (*env)->NewObjectArray(env, res_var.datalen, arr_of_B_clz, NULL);
+ jobjectArray res_arr = NULL;
+ res_arr = (*env)->NewObjectArray(env, res_var.datalen, arr_of_B_clz, NULL);
;
for (size_t i = 0; i < res_var.datalen; i++) {
LDKCVec_u8Z res_conv_8_var = res_var.data[i];
(*env)->SetByteArrayRegion(env, res_conv_8_arr, 0, res_conv_8_var.datalen, res_conv_8_var.data);
(*env)->SetObjectArrayElement(env, res_arr, i, res_conv_8_arr);
}
+
return res_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1CVec_1u8ZZNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_InMemorySignerDecodeErrorZ *val = (LDKCResult_InMemorySignerDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKInMemorySigner 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InMemorySignerDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_InMemorySignerDecodeErrorZ *val = (LDKCResult_InMemorySignerDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1TxOutZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1get_1b(JNIEnv *env, jclass clz, int64_t tuple) {
LDKC2Tuple_BlockHashChannelMonitorZ* tuple_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)(tuple & ~1);
LDKChannelMonitor ret_var = C2Tuple_BlockHashChannelMonitorZ_get_b(tuple_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *val = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKCVec_C2Tuple_BlockHashChannelMonitorZZ res_var = (*val->contents.result);
- int64_tArray res_arr = (*env)->NewLongArray(env, res_var.datalen);
+ int64_tArray res_arr = NULL;
+ res_arr = (*env)->NewLongArray(env, res_var.datalen);
int64_t *res_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, res_arr, NULL);
for (size_t j = 0; j < res_var.datalen; j++) {
LDKC2Tuple_BlockHashChannelMonitorZ* res_conv_35_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ");
jclass err_conv = LDKIOError_to_java(env, (*val->contents.err));
return err_conv;
}
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
- return ((LDKCResult_PaymentIdDecodeErrorZ*)arg)->result_ok;
-}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
- LDKCResult_PaymentIdDecodeErrorZ *val = (LDKCResult_PaymentIdDecodeErrorZ*)(arg & ~1);
- CHECK(val->result_ok);
- LDKPaymentId res_var = (*val->contents.result);
- 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
- return res_ref;
-}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
- LDKCResult_PaymentIdDecodeErrorZ *val = (LDKCResult_PaymentIdDecodeErrorZ*)(arg & ~1);
- CHECK(!val->result_ok);
- LDKDecodeError err_var = (*val->contents.err);
- 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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
- return err_ref;
-}
static jclass LDKCOption_u16Z_Some_class = NULL;
static jmethodID LDKCOption_u16Z_Some_meth = NULL;
static jclass LDKCOption_u16Z_None_class = NULL;
}
case LDKAPIError_IncompatibleShutdownScript: {
LDKShutdownScript script_var = obj->incompatible_shutdown_script.script;
+ uint64_t script_ref = 0;
CHECK((((uint64_t)script_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&script_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t script_ref = (uint64_t)script_var.inner & ~1;
+ script_ref = (uint64_t)script_var.inner & ~1;
return (*env)->NewObject(env, LDKAPIError_IncompatibleShutdownScript_class, LDKAPIError_IncompatibleShutdownScript_meth, script_ref);
}
default: abort();
LDKPaymentSendFailure_PartialFailure_class =
(*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKPaymentSendFailure$PartialFailure;"));
CHECK(LDKPaymentSendFailure_PartialFailure_class != NULL);
- LDKPaymentSendFailure_PartialFailure_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_PartialFailure_class, "<init>", "([J)V");
+ LDKPaymentSendFailure_PartialFailure_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_PartialFailure_class, "<init>", "([JJ[B)V");
CHECK(LDKPaymentSendFailure_PartialFailure_meth != NULL);
}
JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentSendFailure_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
}
case LDKPaymentSendFailure_PathParameterError: {
LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error_var = obj->path_parameter_error;
- int64_tArray path_parameter_error_arr = (*env)->NewLongArray(env, path_parameter_error_var.datalen);
+ int64_tArray path_parameter_error_arr = NULL;
+ path_parameter_error_arr = (*env)->NewLongArray(env, path_parameter_error_var.datalen);
int64_t *path_parameter_error_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_parameter_error_arr, NULL);
for (size_t w = 0; w < path_parameter_error_var.datalen; w++) {
LDKCResult_NoneAPIErrorZ* path_parameter_error_conv_22_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
}
case LDKPaymentSendFailure_AllFailedRetrySafe: {
LDKCVec_APIErrorZ all_failed_retry_safe_var = obj->all_failed_retry_safe;
- int64_tArray all_failed_retry_safe_arr = (*env)->NewLongArray(env, all_failed_retry_safe_var.datalen);
+ int64_tArray all_failed_retry_safe_arr = NULL;
+ all_failed_retry_safe_arr = (*env)->NewLongArray(env, all_failed_retry_safe_var.datalen);
int64_t *all_failed_retry_safe_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, all_failed_retry_safe_arr, NULL);
for (size_t k = 0; k < all_failed_retry_safe_var.datalen; k++) {
uint64_t all_failed_retry_safe_conv_10_ref = ((uint64_t)&all_failed_retry_safe_var.data[k]) | 1;
return (*env)->NewObject(env, LDKPaymentSendFailure_AllFailedRetrySafe_class, LDKPaymentSendFailure_AllFailedRetrySafe_meth, all_failed_retry_safe_arr);
}
case LDKPaymentSendFailure_PartialFailure: {
- LDKCVec_CResult_NoneAPIErrorZZ partial_failure_var = obj->partial_failure;
- int64_tArray partial_failure_arr = (*env)->NewLongArray(env, partial_failure_var.datalen);
- int64_t *partial_failure_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, partial_failure_arr, NULL);
- for (size_t w = 0; w < partial_failure_var.datalen; w++) {
- LDKCResult_NoneAPIErrorZ* partial_failure_conv_22_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
- *partial_failure_conv_22_conv = partial_failure_var.data[w];
- *partial_failure_conv_22_conv = CResult_NoneAPIErrorZ_clone(partial_failure_conv_22_conv);
- partial_failure_arr_ptr[w] = (uint64_t)partial_failure_conv_22_conv;
+ LDKCVec_CResult_NoneAPIErrorZZ results_var = obj->partial_failure.results;
+ int64_tArray results_arr = NULL;
+ results_arr = (*env)->NewLongArray(env, results_var.datalen);
+ int64_t *results_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, results_arr, NULL);
+ for (size_t w = 0; w < results_var.datalen; w++) {
+ LDKCResult_NoneAPIErrorZ* results_conv_22_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
+ *results_conv_22_conv = results_var.data[w];
+ *results_conv_22_conv = CResult_NoneAPIErrorZ_clone(results_conv_22_conv);
+ results_arr_ptr[w] = (uint64_t)results_conv_22_conv;
+ }
+ (*env)->ReleasePrimitiveArrayCritical(env, results_arr, results_arr_ptr, 0);
+ LDKRouteParameters failed_paths_retry_var = obj->partial_failure.failed_paths_retry;
+ uint64_t failed_paths_retry_ref = 0;
+ if ((uint64_t)failed_paths_retry_var.inner > 4096) {
+ CHECK((((uint64_t)failed_paths_retry_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&failed_paths_retry_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ failed_paths_retry_ref = (uint64_t)failed_paths_retry_var.inner & ~1;
}
- (*env)->ReleasePrimitiveArrayCritical(env, partial_failure_arr, partial_failure_arr_ptr, 0);
- return (*env)->NewObject(env, LDKPaymentSendFailure_PartialFailure_class, LDKPaymentSendFailure_PartialFailure_meth, partial_failure_arr);
+ int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32);
+ (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->partial_failure.payment_id.data);
+ return (*env)->NewObject(env, LDKPaymentSendFailure_PartialFailure_class, LDKPaymentSendFailure_PartialFailure_meth, results_arr, failed_paths_retry_ref, payment_id_arr);
}
default: abort();
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdPaymentSendFailureZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
return ((LDKCResult_PaymentIdPaymentSendFailureZ*)arg)->result_ok;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdPaymentSendFailureZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdPaymentSendFailureZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_PaymentIdPaymentSendFailureZ *val = (LDKCResult_PaymentIdPaymentSendFailureZ*)(arg & ~1);
CHECK(val->result_ok);
- LDKPaymentId res_var = (*val->contents.result);
- 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
- return res_ref;
+ 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_1PaymentIdPaymentSendFailureZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_PaymentIdPaymentSendFailureZ *val = (LDKCResult_PaymentIdPaymentSendFailureZ*)(arg & ~1);
return ret_arr;
}
-static inline struct LDKPaymentId C2Tuple_PaymentHashPaymentIdZ_get_b(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR tuple){
- return PaymentId_clone(&tuple->b);
+static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentIdZ_get_b(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR tuple){
+ return ThirtyTwoBytes_clone(&tuple->b);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1get_1b(JNIEnv *env, jclass clz, int64_t tuple) {
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1get_1b(JNIEnv *env, jclass clz, int64_t tuple) {
LDKC2Tuple_PaymentHashPaymentIdZ* tuple_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)(tuple & ~1);
- LDKPaymentId ret_var = C2Tuple_PaymentHashPaymentIdZ_get_b(tuple_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
- }
- return ret_ref;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C2Tuple_PaymentHashPaymentIdZ_get_b(tuple_conv).data);
+ return ret_arr;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
DO_ASSERT(get_jenv_res == JNI_OK);
}
LDKOutPoint funding_txo_var = funding_txo;
+ uint64_t funding_txo_ref = 0;
CHECK((((uint64_t)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&funding_txo_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t funding_txo_ref = (uint64_t)funding_txo_var.inner;
+ funding_txo_ref = (uint64_t)funding_txo_var.inner;
if (funding_txo_var.is_owned) {
funding_txo_ref |= 1;
}
LDKChannelMonitor monitor_var = monitor;
+ uint64_t monitor_ref = 0;
CHECK((((uint64_t)monitor_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&monitor_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t monitor_ref = (uint64_t)monitor_var.inner;
+ monitor_ref = (uint64_t)monitor_var.inner;
if (monitor_var.is_owned) {
monitor_ref |= 1;
}
DO_ASSERT(get_jenv_res == JNI_OK);
}
LDKOutPoint funding_txo_var = funding_txo;
+ uint64_t funding_txo_ref = 0;
CHECK((((uint64_t)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&funding_txo_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t funding_txo_ref = (uint64_t)funding_txo_var.inner;
+ funding_txo_ref = (uint64_t)funding_txo_var.inner;
if (funding_txo_var.is_owned) {
funding_txo_ref |= 1;
}
LDKChannelMonitorUpdate update_var = update;
+ uint64_t update_ref = 0;
CHECK((((uint64_t)update_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&update_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t update_ref = (uint64_t)update_var.inner;
+ update_ref = (uint64_t)update_var.inner;
if (update_var.is_owned) {
update_ref |= 1;
}
if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr;
LDKCVec_MonitorEventZ ret_var = (this_arg_conv->release_pending_monitor_events)(this_arg_conv->this_arg);
- int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t o = 0; o < ret_var.datalen; o++) {
LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
LDKShutdownScript ret_var = (this_arg_conv->get_shutdown_scriptpubkey)(this_arg_conv->this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
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;
- LDKSign* ret_ret =MALLOC(sizeof(LDKSign), "LDKSign");
+ LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
*ret_ret = (this_arg_conv->get_channel_signer)(this_arg_conv->this_arg, inbound, channel_value_satoshis);
return (uint64_t)ret_ret;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelManagerZ_1get_1b(JNIEnv *env, jclass clz, int64_t tuple) {
LDKC2Tuple_BlockHashChannelManagerZ* tuple_conv = (LDKC2Tuple_BlockHashChannelManagerZ*)(tuple & ~1);
LDKChannelManager ret_var = *C2Tuple_BlockHashChannelManagerZ_get_b(tuple_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner & ~1;
+ ret_ref = (uint64_t)ret_var.inner & ~1;
return ret_ref;
}
LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *val = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelConfigDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ChannelConfigDecodeErrorZ *val = (LDKCResult_ChannelConfigDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKChannelConfig 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelConfigDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ChannelConfigDecodeErrorZ *val = (LDKCResult_ChannelConfigDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1OutPointDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_OutPointDecodeErrorZ *val = (LDKCResult_OutPointDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKOutPoint 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1OutPointDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_OutPointDecodeErrorZ *val = (LDKCResult_OutPointDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
typedef struct LDKType_JCalls {
LDKCOption_TypeZ *obj = (LDKCOption_TypeZ*)(ptr & ~1);
switch(obj->tag) {
case LDKCOption_TypeZ_Some: {
- LDKType* some_ret =MALLOC(sizeof(LDKType), "LDKType");
+ LDKType* some_ret = MALLOC(sizeof(LDKType), "LDKType");
*some_ret = Type_clone(&obj->some);
return (*env)->NewObject(env, LDKCOption_TypeZ_Some_class, LDKCOption_TypeZ_Some_meth, (uint64_t)some_ret);
}
LDKCResult_COption_TypeZDecodeErrorZ *val = (LDKCResult_COption_TypeZDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
+ return err_ref;
+}
+static jclass LDKPaymentError_Invoice_class = NULL;
+static jmethodID LDKPaymentError_Invoice_meth = NULL;
+static jclass LDKPaymentError_Routing_class = NULL;
+static jmethodID LDKPaymentError_Routing_meth = NULL;
+static jclass LDKPaymentError_Sending_class = 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;"));
+ 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;"));
+ 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;"));
+ CHECK(LDKPaymentError_Sending_class != NULL);
+ LDKPaymentError_Sending_meth = (*env)->GetMethodID(env, LDKPaymentError_Sending_class, "<init>", "(J)V");
+ CHECK(LDKPaymentError_Sending_meth != NULL);
+}
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
+ LDKPaymentError *obj = (LDKPaymentError*)(ptr & ~1);
+ switch(obj->tag) {
+ case LDKPaymentError_Invoice: {
+ LDKStr invoice_str = obj->invoice;
+ jstring invoice_conv = str_ref_to_java(env, invoice_str.chars, invoice_str.len);
+ return (*env)->NewObject(env, LDKPaymentError_Invoice_class, LDKPaymentError_Invoice_meth, invoice_conv);
+ }
+ case LDKPaymentError_Routing: {
+ LDKLightningError routing_var = obj->routing;
+ uint64_t routing_ref = 0;
+ CHECK((((uint64_t)routing_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&routing_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ routing_ref = (uint64_t)routing_var.inner & ~1;
+ return (*env)->NewObject(env, LDKPaymentError_Routing_class, LDKPaymentError_Routing_meth, routing_ref);
+ }
+ case LDKPaymentError_Sending: {
+ uint64_t sending_ref = ((uint64_t)&obj->sending) | 1;
+ return (*env)->NewObject(env, LDKPaymentError_Sending_class, LDKPaymentError_Sending_meth, sending_ref);
+ }
+ default: abort();
+ }
+}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdPaymentErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ return ((LDKCResult_PaymentIdPaymentErrorZ*)arg)->result_ok;
+}
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdPaymentErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_PaymentIdPaymentErrorZ *val = (LDKCResult_PaymentIdPaymentErrorZ*)(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_1PaymentIdPaymentErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_PaymentIdPaymentErrorZ *val = (LDKCResult_PaymentIdPaymentErrorZ*)(arg & ~1);
+ CHECK(!val->result_ok);
+ uint64_t err_ref = ((uint64_t)&(*val->contents.err)) | 1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SiPrefixNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_InvoiceNoneZ *val = (LDKCResult_InvoiceNoneZ*)(arg & ~1);
CHECK(val->result_ok);
LDKInvoice 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_SignedRawInvoiceNoneZ *val = (LDKCResult_SignedRawInvoiceNoneZ*)(arg & ~1);
CHECK(val->result_ok);
LDKSignedRawInvoice 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignedRawInvoiceNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1get_1a(JNIEnv *env, jclass clz, int64_t tuple) {
LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* tuple_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(tuple & ~1);
LDKRawInvoice ret_var = C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(tuple_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1get_1c(JNIEnv *env, jclass clz, int64_t tuple) {
LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* tuple_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(tuple & ~1);
LDKInvoiceSignature ret_var = C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(tuple_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKCResult_PayeePubKeyErrorZ *val = (LDKCResult_PayeePubKeyErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKPayeePubKey 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PayeePubKeyErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_PositiveTimestampCreationErrorZ *val = (LDKCResult_PositiveTimestampCreationErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKPositiveTimestamp 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PositiveTimestampCreationErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_InvoiceSemanticErrorZ *val = (LDKCResult_InvoiceSemanticErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKInvoice 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceSemanticErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_DescriptionCreationErrorZ *val = (LDKCResult_DescriptionCreationErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKDescription 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DescriptionCreationErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ExpiryTimeCreationErrorZ *val = (LDKCResult_ExpiryTimeCreationErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKExpiryTime 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ExpiryTimeCreationErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_PrivateRouteCreationErrorZ *val = (LDKCResult_PrivateRouteCreationErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKPrivateRoute 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PrivateRouteCreationErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ChannelMonitorUpdateDecodeErrorZ *val = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKChannelMonitorUpdate 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelMonitorUpdateDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ChannelMonitorUpdateDecodeErrorZ *val = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HTLCUpdateDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_HTLCUpdateDecodeErrorZ *val = (LDKCResult_HTLCUpdateDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKHTLCUpdate 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HTLCUpdateDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_HTLCUpdateDecodeErrorZ *val = (LDKCResult_HTLCUpdateDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneMonitorUpdateErrorZ_1result_1ok(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
static inline struct LDKOutPoint C2Tuple_OutPointScriptZ_get_a(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR tuple){
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1get_1a(JNIEnv *env, jclass clz, int64_t tuple) {
LDKC2Tuple_OutPointScriptZ* tuple_conv = (LDKC2Tuple_OutPointScriptZ*)(tuple & ~1);
LDKOutPoint ret_var = C2Tuple_OutPointScriptZ_get_a(tuple_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1get_1b(JNIEnv *env, jclass clz, int64_t tuple) {
LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* tuple_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(tuple & ~1);
LDKCVec_C2Tuple_u32ScriptZZ ret_var = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(tuple_conv);
- int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t v = 0; v < ret_var.datalen; v++) {
LDKC2Tuple_u32ScriptZ* ret_conv_21_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ");
LDKEvent_PaymentSent_class =
(*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentSent;"));
CHECK(LDKEvent_PaymentSent_class != NULL);
- LDKEvent_PaymentSent_meth = (*env)->GetMethodID(env, LDKEvent_PaymentSent_class, "<init>", "([B[B)V");
+ 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;"));
CHECK(LDKEvent_PaymentPathFailed_class != NULL);
- LDKEvent_PaymentPathFailed_meth = (*env)->GetMethodID(env, LDKEvent_PaymentPathFailed_class, "<init>", "([BZJZ[JJ)V");
+ LDKEvent_PaymentPathFailed_meth = (*env)->GetMethodID(env, LDKEvent_PaymentPathFailed_class, "<init>", "([B[BZJZ[JJJ)V");
CHECK(LDKEvent_PaymentPathFailed_meth != NULL);
LDKEvent_PendingHTLCsForwardable_class =
(*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PendingHTLCsForwardable;"));
return (*env)->NewObject(env, LDKEvent_PaymentReceived_class, LDKEvent_PaymentReceived_meth, payment_hash_arr, obj->payment_received.amt, purpose_ref);
}
case LDKEvent_PaymentSent: {
+ int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32);
+ (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->payment_sent.payment_id.data);
int8_tArray payment_preimage_arr = (*env)->NewByteArray(env, 32);
(*env)->SetByteArrayRegion(env, payment_preimage_arr, 0, 32, obj->payment_sent.payment_preimage.data);
int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
(*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_sent.payment_hash.data);
- return (*env)->NewObject(env, LDKEvent_PaymentSent_class, LDKEvent_PaymentSent_meth, payment_preimage_arr, payment_hash_arr);
+ uint64_t fee_paid_msat_ref = ((uint64_t)&obj->payment_sent.fee_paid_msat) | 1;
+ return (*env)->NewObject(env, LDKEvent_PaymentSent_class, LDKEvent_PaymentSent_meth, payment_id_arr, payment_preimage_arr, payment_hash_arr, fee_paid_msat_ref);
}
case LDKEvent_PaymentPathFailed: {
+ int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32);
+ (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->payment_path_failed.payment_id.data);
int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
(*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_path_failed.payment_hash.data);
uint64_t network_update_ref = ((uint64_t)&obj->payment_path_failed.network_update) | 1;
LDKCVec_RouteHopZ path_var = obj->payment_path_failed.path;
- int64_tArray path_arr = (*env)->NewLongArray(env, path_var.datalen);
+ 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.
- uint64_t path_conv_10_ref = (uint64_t)path_conv_10_var.inner & ~1;
+ 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);
uint64_t short_channel_id_ref = ((uint64_t)&obj->payment_path_failed.short_channel_id) | 1;
- return (*env)->NewObject(env, LDKEvent_PaymentPathFailed_class, LDKEvent_PaymentPathFailed_meth, 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);
+ LDKRouteParameters retry_var = obj->payment_path_failed.retry;
+ uint64_t retry_ref = 0;
+ if ((uint64_t)retry_var.inner > 4096) {
+ CHECK((((uint64_t)retry_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&retry_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ retry_ref = (uint64_t)retry_var.inner & ~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_PendingHTLCsForwardable: {
return (*env)->NewObject(env, LDKEvent_PendingHTLCsForwardable_class, LDKEvent_PendingHTLCsForwardable_meth, obj->pending_htl_cs_forwardable.time_forwardable);
}
case LDKEvent_SpendableOutputs: {
LDKCVec_SpendableOutputDescriptorZ outputs_var = obj->spendable_outputs.outputs;
- int64_tArray outputs_arr = (*env)->NewLongArray(env, outputs_var.datalen);
+ int64_tArray outputs_arr = NULL;
+ outputs_arr = (*env)->NewLongArray(env, outputs_var.datalen);
int64_t *outputs_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, outputs_arr, NULL);
for (size_t b = 0; b < outputs_var.datalen; b++) {
uint64_t outputs_conv_27_ref = ((uint64_t)&outputs_var.data[b]) | 1;
JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1get_1b(JNIEnv *env, jclass clz, int64_t tuple) {
LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* tuple_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(tuple & ~1);
LDKCVec_C2Tuple_u32TxOutZZ ret_var = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(tuple_conv);
- int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t u = 0; u < ret_var.datalen; u++) {
LDKC2Tuple_u32TxOutZ* ret_conv_20_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ");
LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *val = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneLightningErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_NoneLightningErrorZ *val = (LDKCResult_NoneLightningErrorZ*)(arg & ~1);
CHECK(!val->result_ok);
LDKLightningError 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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
static inline struct LDKPublicKey C2Tuple_PublicKeyTypeZ_get_a(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR tuple){
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1get_1b(JNIEnv *env, jclass clz, int64_t tuple) {
LDKC2Tuple_PublicKeyTypeZ* tuple_conv = (LDKC2Tuple_PublicKeyTypeZ*)(tuple & ~1);
- LDKType* ret_ret =MALLOC(sizeof(LDKType), "LDKType");
+ LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType");
*ret_ret = C2Tuple_PublicKeyTypeZ_get_b(tuple_conv);
return (uint64_t)ret_ret;
}
LDKCResult_boolLightningErrorZ *val = (LDKCResult_boolLightningErrorZ*)(arg & ~1);
CHECK(!val->result_ok);
LDKLightningError 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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
static inline struct LDKChannelAnnouncement C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR tuple){
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1get_1a(JNIEnv *env, jclass clz, int64_t tuple) {
LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* tuple_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(tuple & ~1);
LDKChannelAnnouncement ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(tuple_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1get_1b(JNIEnv *env, jclass clz, int64_t tuple) {
LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* tuple_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(tuple & ~1);
LDKChannelUpdate ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(tuple_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1get_1c(JNIEnv *env, jclass clz, int64_t tuple) {
LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* tuple_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(tuple & ~1);
LDKChannelUpdate ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(tuple_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKCResult_CVec_u8ZPeerHandleErrorZ *val = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)(arg & ~1);
CHECK(!val->result_ok);
LDKPeerHandleError 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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePeerHandleErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_NonePeerHandleErrorZ *val = (LDKCResult_NonePeerHandleErrorZ*)(arg & ~1);
CHECK(!val->result_ok);
LDKPeerHandleError 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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolPeerHandleErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_boolPeerHandleErrorZ *val = (LDKCResult_boolPeerHandleErrorZ*)(arg & ~1);
CHECK(!val->result_ok);
LDKPeerHandleError 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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeIdDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_NodeIdDecodeErrorZ *val = (LDKCResult_NodeIdDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKNodeId 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeIdDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_NodeIdDecodeErrorZ *val = (LDKCResult_NodeIdDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
typedef struct LDKAccess_JCalls {
LDKCOption_AccessZ *obj = (LDKCOption_AccessZ*)(ptr & ~1);
switch(obj->tag) {
case LDKCOption_AccessZ_Some: {
- LDKAccess* some_ret =MALLOC(sizeof(LDKAccess), "LDKAccess");
+ LDKAccess* some_ret = MALLOC(sizeof(LDKAccess), "LDKAccess");
*some_ret = obj->some;
// Warning: We likely need to clone here, but no clone is available, so we just do it for Java instances
if ((*some_ret).free == LDKAccess_JCalls_free) {
LDKCResult_DirectionalChannelInfoDecodeErrorZ *val = (LDKCResult_DirectionalChannelInfoDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKDirectionalChannelInfo 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DirectionalChannelInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_DirectionalChannelInfoDecodeErrorZ *val = (LDKCResult_DirectionalChannelInfoDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelInfoDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ChannelInfoDecodeErrorZ *val = (LDKCResult_ChannelInfoDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKChannelInfo 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ChannelInfoDecodeErrorZ *val = (LDKCResult_ChannelInfoDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RoutingFeesDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_RoutingFeesDecodeErrorZ *val = (LDKCResult_RoutingFeesDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKRoutingFees 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RoutingFeesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_RoutingFeesDecodeErrorZ *val = (LDKCResult_RoutingFeesDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeAnnouncementInfoDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_NodeAnnouncementInfoDecodeErrorZ *val = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKNodeAnnouncementInfo 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeAnnouncementInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_NodeAnnouncementInfoDecodeErrorZ *val = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1u64Z_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
LDKCResult_NodeInfoDecodeErrorZ *val = (LDKCResult_NodeInfoDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKNodeInfo 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_NodeInfoDecodeErrorZ *val = (LDKCResult_NodeInfoDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetworkGraphDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_NetworkGraphDecodeErrorZ *val = (LDKCResult_NetworkGraphDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKNetworkGraph 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetworkGraphDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_NetworkGraphDecodeErrorZ *val = (LDKCResult_NetworkGraphDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
static jclass LDKCOption_CVec_NetAddressZZ_Some_class = NULL;
switch(obj->tag) {
case LDKCOption_CVec_NetAddressZZ_Some: {
LDKCVec_NetAddressZ some_var = obj->some;
- int64_tArray some_arr = (*env)->NewLongArray(env, some_var.datalen);
+ int64_tArray some_arr = NULL;
+ some_arr = (*env)->NewLongArray(env, some_var.datalen);
int64_t *some_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, some_arr, NULL);
for (size_t m = 0; m < some_var.datalen; m++) {
uint64_t some_conv_12_ref = ((uint64_t)&some_var.data[m]) | 1;
default: abort();
}
}
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetAddressu8Z_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
- return ((LDKCResult_NetAddressu8Z*)arg)->result_ok;
-}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetAddressu8Z_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
- LDKCResult_NetAddressu8Z *val = (LDKCResult_NetAddressu8Z*)(arg & ~1);
- CHECK(val->result_ok);
- uint64_t res_ref = ((uint64_t)&(*val->contents.result)) | 1;
- return res_ref;
-}
-JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetAddressu8Z_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
- LDKCResult_NetAddressu8Z *val = (LDKCResult_NetAddressu8Z*)(arg & ~1);
- CHECK(!val->result_ok);
- return *val->contents.err;
-}
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CResult_1NetAddressu8ZDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
- return ((LDKCResult_CResult_NetAddressu8ZDecodeErrorZ*)arg)->result_ok;
-}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CResult_1NetAddressu8ZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
- LDKCResult_CResult_NetAddressu8ZDecodeErrorZ *val = (LDKCResult_CResult_NetAddressu8ZDecodeErrorZ*)(arg & ~1);
- CHECK(val->result_ok);
- LDKCResult_NetAddressu8Z* res_conv = MALLOC(sizeof(LDKCResult_NetAddressu8Z), "LDKCResult_NetAddressu8Z");
- *res_conv = (*val->contents.result);
- *res_conv = CResult_NetAddressu8Z_clone(res_conv);
- return (uint64_t)res_conv;
-}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CResult_1NetAddressu8ZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
- LDKCResult_CResult_NetAddressu8ZDecodeErrorZ *val = (LDKCResult_CResult_NetAddressu8ZDecodeErrorZ*)(arg & ~1);
- CHECK(!val->result_ok);
- LDKDecodeError err_var = (*val->contents.err);
- 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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
- return err_ref;
-}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetAddressDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
return ((LDKCResult_NetAddressDecodeErrorZ*)arg)->result_ok;
}
LDKCResult_NetAddressDecodeErrorZ *val = (LDKCResult_NetAddressDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1UpdateAddHTLCZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
LDKCResult_AcceptChannelDecodeErrorZ *val = (LDKCResult_AcceptChannelDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKAcceptChannel 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1AcceptChannelDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_AcceptChannelDecodeErrorZ *val = (LDKCResult_AcceptChannelDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1AnnouncementSignaturesDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_AnnouncementSignaturesDecodeErrorZ *val = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKAnnouncementSignatures 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1AnnouncementSignaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_AnnouncementSignaturesDecodeErrorZ *val = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelReestablishDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ChannelReestablishDecodeErrorZ *val = (LDKCResult_ChannelReestablishDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKChannelReestablish 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelReestablishDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ChannelReestablishDecodeErrorZ *val = (LDKCResult_ChannelReestablishDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ClosingSignedDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ClosingSignedDecodeErrorZ *val = (LDKCResult_ClosingSignedDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKClosingSigned 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ClosingSignedDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ClosingSignedDecodeErrorZ *val = (LDKCResult_ClosingSignedDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ClosingSignedFeeRangeDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *val = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKClosingSignedFeeRange 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ClosingSignedFeeRangeDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *val = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CommitmentSignedDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_CommitmentSignedDecodeErrorZ *val = (LDKCResult_CommitmentSignedDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKCommitmentSigned 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CommitmentSignedDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_CommitmentSignedDecodeErrorZ *val = (LDKCResult_CommitmentSignedDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingCreatedDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_FundingCreatedDecodeErrorZ *val = (LDKCResult_FundingCreatedDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKFundingCreated 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingCreatedDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_FundingCreatedDecodeErrorZ *val = (LDKCResult_FundingCreatedDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingSignedDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_FundingSignedDecodeErrorZ *val = (LDKCResult_FundingSignedDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKFundingSigned 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingSignedDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_FundingSignedDecodeErrorZ *val = (LDKCResult_FundingSignedDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingLockedDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_FundingLockedDecodeErrorZ *val = (LDKCResult_FundingLockedDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKFundingLocked 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingLockedDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_FundingLockedDecodeErrorZ *val = (LDKCResult_FundingLockedDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_InitDecodeErrorZ *val = (LDKCResult_InitDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKInit 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_InitDecodeErrorZ *val = (LDKCResult_InitDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1OpenChannelDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_OpenChannelDecodeErrorZ *val = (LDKCResult_OpenChannelDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKOpenChannel 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1OpenChannelDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_OpenChannelDecodeErrorZ *val = (LDKCResult_OpenChannelDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RevokeAndACKDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_RevokeAndACKDecodeErrorZ *val = (LDKCResult_RevokeAndACKDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKRevokeAndACK 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RevokeAndACKDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_RevokeAndACKDecodeErrorZ *val = (LDKCResult_RevokeAndACKDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ShutdownDecodeErrorZ *val = (LDKCResult_ShutdownDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKShutdown 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ShutdownDecodeErrorZ *val = (LDKCResult_ShutdownDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFailHTLCDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_UpdateFailHTLCDecodeErrorZ *val = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKUpdateFailHTLC 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFailHTLCDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_UpdateFailHTLCDecodeErrorZ *val = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFailMalformedHTLCDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *val = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKUpdateFailMalformedHTLC 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFailMalformedHTLCDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *val = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFeeDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_UpdateFeeDecodeErrorZ *val = (LDKCResult_UpdateFeeDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKUpdateFee 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFeeDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_UpdateFeeDecodeErrorZ *val = (LDKCResult_UpdateFeeDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFulfillHTLCDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_UpdateFulfillHTLCDecodeErrorZ *val = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKUpdateFulfillHTLC 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFulfillHTLCDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_UpdateFulfillHTLCDecodeErrorZ *val = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateAddHTLCDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_UpdateAddHTLCDecodeErrorZ *val = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKUpdateAddHTLC 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateAddHTLCDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_UpdateAddHTLCDecodeErrorZ *val = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PingDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_PingDecodeErrorZ *val = (LDKCResult_PingDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKPing 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PingDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_PingDecodeErrorZ *val = (LDKCResult_PingDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PongDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_PongDecodeErrorZ *val = (LDKCResult_PongDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKPong 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PongDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_PongDecodeErrorZ *val = (LDKCResult_PongDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannelAnnouncementDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *val = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKUnsignedChannelAnnouncement 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannelAnnouncementDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *val = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelAnnouncementDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ChannelAnnouncementDecodeErrorZ *val = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKChannelAnnouncement 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelAnnouncementDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ChannelAnnouncementDecodeErrorZ *val = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannelUpdateDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_UnsignedChannelUpdateDecodeErrorZ *val = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKUnsignedChannelUpdate 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannelUpdateDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_UnsignedChannelUpdateDecodeErrorZ *val = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelUpdateDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ChannelUpdateDecodeErrorZ *val = (LDKCResult_ChannelUpdateDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKChannelUpdate 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelUpdateDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ChannelUpdateDecodeErrorZ *val = (LDKCResult_ChannelUpdateDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ErrorMessageDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ErrorMessageDecodeErrorZ *val = (LDKCResult_ErrorMessageDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKErrorMessage 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ErrorMessageDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ErrorMessageDecodeErrorZ *val = (LDKCResult_ErrorMessageDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedNodeAnnouncementDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *val = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKUnsignedNodeAnnouncement 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedNodeAnnouncementDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *val = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeAnnouncementDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_NodeAnnouncementDecodeErrorZ *val = (LDKCResult_NodeAnnouncementDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKNodeAnnouncement 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeAnnouncementDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_NodeAnnouncementDecodeErrorZ *val = (LDKCResult_NodeAnnouncementDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryShortChannelIdsDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_QueryShortChannelIdsDecodeErrorZ *val = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKQueryShortChannelIds 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryShortChannelIdsDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_QueryShortChannelIdsDecodeErrorZ *val = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyShortChannelIdsEndDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *val = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKReplyShortChannelIdsEnd 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyShortChannelIdsEndDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *val = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryChannelRangeDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_QueryChannelRangeDecodeErrorZ *val = (LDKCResult_QueryChannelRangeDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKQueryChannelRange 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryChannelRangeDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_QueryChannelRangeDecodeErrorZ *val = (LDKCResult_QueryChannelRangeDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyChannelRangeDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ReplyChannelRangeDecodeErrorZ *val = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKReplyChannelRange 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyChannelRangeDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ReplyChannelRangeDecodeErrorZ *val = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1GossipTimestampFilterDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_GossipTimestampFilterDecodeErrorZ *val = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKGossipTimestampFilter 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1GossipTimestampFilterDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_GossipTimestampFilterDecodeErrorZ *val = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
static jclass LDKSignOrCreationError_SignError_class = NULL;
LDKCResult_InvoiceSignOrCreationErrorZ *val = (LDKCResult_InvoiceSignOrCreationErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKInvoice 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceSignOrCreationErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
DO_ASSERT(get_jenv_res == JNI_OK);
}
LDKWatchedOutput output_var = output;
+ uint64_t output_ref = 0;
CHECK((((uint64_t)output_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&output_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t output_ref = (uint64_t)output_var.inner;
+ output_ref = (uint64_t)output_var.inner;
if (output_var.is_owned) {
output_ref |= 1;
}
LDKCOption_FilterZ *obj = (LDKCOption_FilterZ*)(ptr & ~1);
switch(obj->tag) {
case LDKCOption_FilterZ_Some: {
- LDKFilter* some_ret =MALLOC(sizeof(LDKFilter), "LDKFilter");
+ LDKFilter* some_ret = MALLOC(sizeof(LDKFilter), "LDKFilter");
*some_ret = obj->some;
// Warning: We likely need to clone here, but no clone is available, so we just do it for Java instances
if ((*some_ret).free == LDKFilter_JCalls_free) {
LDKCResult_LockedChannelMonitorNoneZ *val = (LDKCResult_LockedChannelMonitorNoneZ*)(arg & ~1);
CHECK(val->result_ok);
LDKLockedChannelMonitor 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1LockedChannelMonitorNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
LDKMessageSendEventsProvider* this_arg_conv = (LDKMessageSendEventsProvider*)this_arg_ptr;
LDKCVec_MessageSendEventZ ret_var = (this_arg_conv->get_and_clear_pending_msg_events)(this_arg_conv->this_arg);
- int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t s = 0; s < ret_var.datalen; s++) {
LDKMessageSendEvent *ret_conv_18_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
} else {
DO_ASSERT(get_jenv_res == JNI_OK);
}
- LDKEventHandler* handler_ret =MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
+ LDKEventHandler* handler_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
*handler_ret = handler;
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
int8_tArray header_arr = (*env)->NewByteArray(env, 80);
(*env)->SetByteArrayRegion(env, header_arr, 0, 80, *header);
LDKCVec_C2Tuple_usizeTransactionZZ txdata_var = txdata;
- int64_tArray txdata_arr = (*env)->NewLongArray(env, txdata_var.datalen);
+ int64_tArray txdata_arr = NULL;
+ txdata_arr = (*env)->NewLongArray(env, txdata_var.datalen);
int64_t *txdata_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, txdata_arr, NULL);
for (size_t c = 0; c < txdata_var.datalen; c++) {
LDKC2Tuple_usizeTransactionZ* txdata_conv_28_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
LDKCVec_TxidZ ret_var = (this_arg_conv->get_relevant_txids)(this_arg_conv->this_arg);
- jobjectArray ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
+ jobjectArray ret_arr = NULL;
+ ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
;
for (size_t i = 0; i < ret_var.datalen; i++) {
int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 32);
(*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 32, ret_var.data[i].data);
(*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr);
}
+
FREE(ret_var.data);
return ret_arr;
}
FREE(j_calls);
}
}
-LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint id, const LDKChannelMonitor * data) {
+LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) {
LDKPersist_JCalls *j_calls = (LDKPersist_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);
}
- LDKOutPoint id_var = id;
- CHECK((((uint64_t)id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
- CHECK((((uint64_t)&id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t id_ref = (uint64_t)id_var.inner;
- if (id_var.is_owned) {
- id_ref |= 1;
+ LDKOutPoint channel_id_var = channel_id;
+ uint64_t channel_id_ref = 0;
+ CHECK((((uint64_t)channel_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&channel_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ channel_id_ref = (uint64_t)channel_id_var.inner;
+ if (channel_id_var.is_owned) {
+ channel_id_ref |= 1;
}
LDKChannelMonitor data_var = *data;
+ uint64_t data_ref = 0;
data_var = ChannelMonitor_clone(data);
CHECK((((uint64_t)data_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&data_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t data_ref = (uint64_t)data_var.inner;
+ data_ref = (uint64_t)data_var.inner;
if (data_var.is_owned) {
data_ref |= 1;
}
+ LDKMonitorUpdateId update_id_var = update_id;
+ uint64_t update_id_ref = 0;
+ CHECK((((uint64_t)update_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&update_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ update_id_ref = (uint64_t)update_id_var.inner;
+ if (update_id_var.is_owned) {
+ update_id_ref |= 1;
+ }
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
- uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->persist_new_channel_meth, id_ref, data_ref);
+ 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)) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to persist_new_channel in LDKPersist from rust threw an exception.");
}
return ret_conv;
}
-LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint id, const LDKChannelMonitorUpdate * update, const LDKChannelMonitor * data) {
+LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, const LDKChannelMonitorUpdate * update, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) {
LDKPersist_JCalls *j_calls = (LDKPersist_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);
}
- LDKOutPoint id_var = id;
- CHECK((((uint64_t)id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
- CHECK((((uint64_t)&id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t id_ref = (uint64_t)id_var.inner;
- if (id_var.is_owned) {
- id_ref |= 1;
+ LDKOutPoint channel_id_var = channel_id;
+ uint64_t channel_id_ref = 0;
+ CHECK((((uint64_t)channel_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&channel_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ channel_id_ref = (uint64_t)channel_id_var.inner;
+ if (channel_id_var.is_owned) {
+ channel_id_ref |= 1;
}
LDKChannelMonitorUpdate update_var = *update;
- update_var = ChannelMonitorUpdate_clone(update);
- CHECK((((uint64_t)update_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
- CHECK((((uint64_t)&update_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t update_ref = (uint64_t)update_var.inner;
- if (update_var.is_owned) {
- update_ref |= 1;
+ uint64_t update_ref = 0;
+ if ((uint64_t)update_var.inner > 4096) {
+ update_var = ChannelMonitorUpdate_clone(update);
+ CHECK((((uint64_t)update_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&update_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ update_ref = (uint64_t)update_var.inner;
+ if (update_var.is_owned) {
+ update_ref |= 1;
+ }
}
LDKChannelMonitor data_var = *data;
+ uint64_t data_ref = 0;
data_var = ChannelMonitor_clone(data);
CHECK((((uint64_t)data_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&data_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t data_ref = (uint64_t)data_var.inner;
+ data_ref = (uint64_t)data_var.inner;
if (data_var.is_owned) {
data_ref |= 1;
}
+ LDKMonitorUpdateId update_id_var = update_id;
+ uint64_t update_id_ref = 0;
+ CHECK((((uint64_t)update_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&update_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ update_id_ref = (uint64_t)update_id_var.inner;
+ if (update_id_var.is_owned) {
+ update_id_ref |= 1;
+ }
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
- uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->update_persisted_channel_meth, id_ref, update_ref, data_ref);
+ 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)) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to update_persisted_channel in LDKPersist 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->persist_new_channel_meth = (*env)->GetMethodID(env, c, "persist_new_channel", "(JJ)J");
+ calls->persist_new_channel_meth = (*env)->GetMethodID(env, c, "persist_new_channel", "(JJJ)J");
CHECK(calls->persist_new_channel_meth != NULL);
- calls->update_persisted_channel_meth = (*env)->GetMethodID(env, c, "update_persisted_channel", "(JJJ)J");
+ calls->update_persisted_channel_meth = (*env)->GetMethodID(env, c, "update_persisted_channel", "(JJJJ)J");
CHECK(calls->update_persisted_channel_meth != NULL);
LDKPersist ret = {
*res_ptr = LDKPersist_init(env, clz, o);
return (uint64_t)res_ptr;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Persist_1persist_1new_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t id, int64_t data) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Persist_1persist_1new_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_id, int64_t data, int64_t update_id) {
void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr;
- LDKOutPoint id_conv;
- id_conv.inner = (void*)(id & (~1));
- id_conv.is_owned = (id & 1) || (id == 0);
- id_conv = OutPoint_clone(&id_conv);
+ LDKOutPoint channel_id_conv;
+ channel_id_conv.inner = (void*)(channel_id & (~1));
+ channel_id_conv.is_owned = (channel_id & 1) || (channel_id == 0);
+ channel_id_conv = OutPoint_clone(&channel_id_conv);
LDKChannelMonitor data_conv;
data_conv.inner = (void*)(data & (~1));
data_conv.is_owned = false;
+ LDKMonitorUpdateId update_id_conv;
+ update_id_conv.inner = (void*)(update_id & (~1));
+ update_id_conv.is_owned = (update_id & 1) || (update_id == 0);
+ update_id_conv = MonitorUpdateId_clone(&update_id_conv);
LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
- *ret_conv = (this_arg_conv->persist_new_channel)(this_arg_conv->this_arg, id_conv, &data_conv);
+ *ret_conv = (this_arg_conv->persist_new_channel)(this_arg_conv->this_arg, channel_id_conv, &data_conv, update_id_conv);
return (uint64_t)ret_conv;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Persist_1update_1persisted_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t id, int64_t update, int64_t data) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Persist_1update_1persisted_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_id, int64_t update, int64_t data, int64_t update_id) {
void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr;
- LDKOutPoint id_conv;
- id_conv.inner = (void*)(id & (~1));
- id_conv.is_owned = (id & 1) || (id == 0);
- id_conv = OutPoint_clone(&id_conv);
+ LDKOutPoint channel_id_conv;
+ channel_id_conv.inner = (void*)(channel_id & (~1));
+ channel_id_conv.is_owned = (channel_id & 1) || (channel_id == 0);
+ channel_id_conv = OutPoint_clone(&channel_id_conv);
LDKChannelMonitorUpdate update_conv;
update_conv.inner = (void*)(update & (~1));
update_conv.is_owned = false;
LDKChannelMonitor data_conv;
data_conv.inner = (void*)(data & (~1));
data_conv.is_owned = false;
+ LDKMonitorUpdateId update_id_conv;
+ update_id_conv.inner = (void*)(update_id & (~1));
+ update_id_conv.is_owned = (update_id & 1) || (update_id == 0);
+ update_id_conv = MonitorUpdateId_clone(&update_id_conv);
LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
- *ret_conv = (this_arg_conv->update_persisted_channel)(this_arg_conv->this_arg, id_conv, &update_conv, &data_conv);
+ *ret_conv = (this_arg_conv->update_persisted_channel)(this_arg_conv->this_arg, channel_id_conv, &update_conv, &data_conv, update_id_conv);
return (uint64_t)ret_conv;
}
int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
LDKInitFeatures their_features_var = their_features;
+ uint64_t their_features_ref = 0;
CHECK((((uint64_t)their_features_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&their_features_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t their_features_ref = (uint64_t)their_features_var.inner;
+ their_features_ref = (uint64_t)their_features_var.inner;
if (their_features_var.is_owned) {
their_features_ref |= 1;
}
LDKOpenChannel msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = OpenChannel_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
LDKInitFeatures their_features_var = their_features;
+ uint64_t their_features_ref = 0;
CHECK((((uint64_t)their_features_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&their_features_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t their_features_ref = (uint64_t)their_features_var.inner;
+ their_features_ref = (uint64_t)their_features_var.inner;
if (their_features_var.is_owned) {
their_features_ref |= 1;
}
LDKAcceptChannel msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = AcceptChannel_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
LDKFundingCreated msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = FundingCreated_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
LDKFundingSigned msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = FundingSigned_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
LDKFundingLocked msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = FundingLocked_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
LDKInitFeatures their_features_var = *their_features;
+ uint64_t their_features_ref = 0;
their_features_var = InitFeatures_clone(their_features);
CHECK((((uint64_t)their_features_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&their_features_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t their_features_ref = (uint64_t)their_features_var.inner;
+ their_features_ref = (uint64_t)their_features_var.inner;
if (their_features_var.is_owned) {
their_features_ref |= 1;
}
LDKShutdown msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = Shutdown_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
LDKClosingSigned msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = ClosingSigned_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
LDKUpdateAddHTLC msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = UpdateAddHTLC_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
LDKUpdateFulfillHTLC msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = UpdateFulfillHTLC_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
LDKUpdateFailHTLC msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = UpdateFailHTLC_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
LDKUpdateFailMalformedHTLC msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = UpdateFailMalformedHTLC_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
LDKCommitmentSigned msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = CommitmentSigned_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
LDKRevokeAndACK msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = RevokeAndACK_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
LDKUpdateFee msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = UpdateFee_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
LDKAnnouncementSignatures msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = AnnouncementSignatures_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
LDKInit msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = Init_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
LDKChannelReestablish msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = ChannelReestablish_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
LDKChannelUpdate msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = ChannelUpdate_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
LDKErrorMessage msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = ErrorMessage_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
DO_ASSERT(get_jenv_res == JNI_OK);
}
LDKNodeAnnouncement msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = NodeAnnouncement_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
DO_ASSERT(get_jenv_res == JNI_OK);
}
LDKChannelAnnouncement msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = ChannelAnnouncement_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
DO_ASSERT(get_jenv_res == JNI_OK);
}
LDKChannelUpdate msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = ChannelUpdate_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
LDKInit init_var = *init;
+ uint64_t init_ref = 0;
init_var = Init_clone(init);
CHECK((((uint64_t)init_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&init_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t init_ref = (uint64_t)init_var.inner;
+ init_ref = (uint64_t)init_var.inner;
if (init_var.is_owned) {
init_ref |= 1;
}
int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
LDKReplyChannelRange msg_var = msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
LDKReplyShortChannelIdsEnd msg_var = msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
LDKQueryChannelRange msg_var = msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
LDKQueryShortChannelIds msg_var = msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret_var = (this_arg_conv->get_next_channel_announcements)(this_arg_conv->this_arg, starting_point, batch_amount);
- int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t h = 0; h < ret_var.datalen; h++) {
LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv_59_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
CHECK((*env)->GetArrayLength(env, starting_point) == 33);
(*env)->GetByteArrayRegion(env, starting_point, 0, 33, starting_point_ref.compressed_form);
LDKCVec_NodeAnnouncementZ ret_var = (this_arg_conv->get_next_node_announcements)(this_arg_conv->this_arg, starting_point_ref, batch_amount);
- int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t s = 0; s < ret_var.datalen; s++) {
LDKNodeAnnouncement ret_conv_18_var = ret_var.data[s];
+ uint64_t ret_conv_18_ref = 0;
CHECK((((uint64_t)ret_conv_18_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_conv_18_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t ret_conv_18_ref = (uint64_t)ret_conv_18_var.inner;
+ ret_conv_18_ref = (uint64_t)ret_conv_18_var.inner;
if (ret_conv_18_var.is_owned) {
ret_conv_18_ref |= 1;
}
} else {
DO_ASSERT(get_jenv_res == JNI_OK);
}
- LDKType* msg_ret =MALLOC(sizeof(LDKType), "LDKType");
+ LDKType* msg_ret = MALLOC(sizeof(LDKType), "LDKType");
*msg_ret = msg;
int8_tArray sender_node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, sender_node_id_arr, 0, 33, sender_node_id.compressed_form);
if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
LDKCustomMessageHandler* this_arg_conv = (LDKCustomMessageHandler*)this_arg_ptr;
LDKCVec_C2Tuple_PublicKeyTypeZZ ret_var = (this_arg_conv->get_and_clear_pending_msg)(this_arg_conv->this_arg);
- int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t z = 0; z < ret_var.datalen; z++) {
LDKC2Tuple_PublicKeyTypeZ* ret_conv_25_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ");
JavaVM *vm;
jweak o;
jmethodID channel_penalty_msat_meth;
+ jmethodID payment_path_failed_meth;
+ jmethodID write_meth;
} LDKScore_JCalls;
static void LDKScore_JCalls_free(void* this_arg) {
LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
FREE(j_calls);
}
}
-uint64_t channel_penalty_msat_LDKScore_jcall(const void* this_arg, uint64_t short_channel_id) {
+uint64_t channel_penalty_msat_LDKScore_jcall(const void* this_arg, uint64_t short_channel_id, 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);
}
+ LDKNodeId source_var = *source;
+ uint64_t source_ref = 0;
+ source_var = NodeId_clone(source);
+ CHECK((((uint64_t)source_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&source_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ source_ref = (uint64_t)source_var.inner;
+ if (source_var.is_owned) {
+ source_ref |= 1;
+ }
+ LDKNodeId target_var = *target;
+ uint64_t target_ref = 0;
+ target_var = NodeId_clone(target);
+ CHECK((((uint64_t)target_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&target_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ target_ref = (uint64_t)target_var.inner;
+ if (target_var.is_owned) {
+ target_ref |= 1;
+ }
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);
+ int64_t ret = (*env)->CallLongMethod(env, obj, j_calls->channel_penalty_msat_meth, short_channel_id, source_ref, target_ref);
if ((*env)->ExceptionCheck(env)) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to channel_penalty_msat in LDKScore from rust threw an exception.");
}
return ret;
}
+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;
+ 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.
+ 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_failed_meth, path_arr, short_channel_id);
+ if ((*env)->ExceptionCheck(env)) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to payment_path_failed 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;
+ 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->write_meth);
+ if ((*env)->ExceptionCheck(env)) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to write in LDKScore from rust threw an exception.");
+ }
+ LDKCVec_u8Z ret_ref;
+ ret_ref.datalen = (*env)->GetArrayLength(env, ret);
+ ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
+ (*env)->GetByteArrayRegion(env, ret, 0, ret_ref.datalen, 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 LDKScore_JCalls_cloned(LDKScore* new_obj) {
LDKScore_JCalls *j_calls = (LDKScore_JCalls*) new_obj->this_arg;
atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
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", "(J)J");
+ calls->channel_penalty_msat_meth = (*env)->GetMethodID(env, c, "channel_penalty_msat", "(JJJ)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->write_meth = (*env)->GetMethodID(env, c, "write", "()[B");
+ CHECK(calls->write_meth != NULL);
LDKScore ret = {
.this_arg = (void*) calls,
.channel_penalty_msat = channel_penalty_msat_LDKScore_jcall,
+ .payment_path_failed = payment_path_failed_LDKScore_jcall,
+ .write = write_LDKScore_jcall,
.free = LDKScore_JCalls_free,
};
return ret;
*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) {
+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) {
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;
- int64_t ret_val = (this_arg_conv->channel_penalty_msat)(this_arg_conv->this_arg, short_channel_id);
+ LDKNodeId source_conv;
+ source_conv.inner = (void*)(source & (~1));
+ source_conv.is_owned = false;
+ LDKNodeId target_conv;
+ target_conv.inner = (void*)(target & (~1));
+ target_conv.is_owned = false;
+ int64_t ret_val = (this_arg_conv->channel_penalty_msat)(this_arg_conv->this_arg, short_channel_id, &source_conv, &target_conv);
return ret_val;
}
-typedef struct LDKChannelManagerPersister_JCalls {
- atomic_size_t refcnt;
- JavaVM *vm;
- jweak o;
- jmethodID persist_manager_meth;
-} LDKChannelManagerPersister_JCalls;
-static void LDKChannelManagerPersister_JCalls_free(void* this_arg) {
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1payment_1path_1failed(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray path, int64_t short_channel_id) {
+ 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);
+ 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_failed)(this_arg_conv->this_arg, path_constr, short_channel_id);
+}
+
+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); }
+ LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
+ LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
+ 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;
+}
+
+typedef struct LDKChannelManagerPersister_JCalls {
+ atomic_size_t refcnt;
+ JavaVM *vm;
+ jweak o;
+ jmethodID persist_manager_meth;
+} LDKChannelManagerPersister_JCalls;
+static void LDKChannelManagerPersister_JCalls_free(void* this_arg) {
LDKChannelManagerPersister_JCalls *j_calls = (LDKChannelManagerPersister_JCalls*) this_arg;
if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
JNIEnv *env;
DO_ASSERT(get_jenv_res == JNI_OK);
}
LDKChannelManager channel_manager_var = *channel_manager;
+ uint64_t channel_manager_ref = 0;
// Warning: we may need a move here but no clone is available for LDKChannelManager
CHECK((((uint64_t)channel_manager_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&channel_manager_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t channel_manager_ref = (uint64_t)channel_manager_var.inner;
+ channel_manager_ref = (uint64_t)channel_manager_var.inner;
if (channel_manager_var.is_owned) {
channel_manager_ref |= 1;
}
default: abort();
}
}
-JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings__1ldk_1get_1compiled_1version(JNIEnv *env, jclass clz) {
- LDKStr ret_str = _ldk_get_compiled_version();
- jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
- Str_free(ret_str);
- return ret_conv;
+typedef struct LDKPayer_JCalls {
+ atomic_size_t refcnt;
+ JavaVM *vm;
+ jweak o;
+ jmethodID node_id_meth;
+ jmethodID first_hops_meth;
+ jmethodID send_payment_meth;
+ jmethodID retry_payment_meth;
+} LDKPayer_JCalls;
+static void LDKPayer_JCalls_free(void* this_arg) {
+ LDKPayer_JCalls *j_calls = (LDKPayer_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);
+ }
}
-
-JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings__1ldk_1c_1bindings_1get_1compiled_1version(JNIEnv *env, jclass clz) {
- LDKStr ret_str = _ldk_c_bindings_get_compiled_version();
- jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
- Str_free(ret_str);
+LDKPublicKey node_id_LDKPayer_jcall(const void* this_arg) {
+ 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);
+ }
+ 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)) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to node_id in LDKPayer from rust threw an exception.");
+ }
+ LDKPublicKey ret_ref;
+ CHECK((*env)->GetArrayLength(env, ret) == 33);
+ (*env)->GetByteArrayRegion(env, ret, 0, 33, ret_ref.compressed_form);
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
+ }
+ return ret_ref;
+}
+LDKCVec_ChannelDetailsZ first_hops_LDKPayer_jcall(const void* this_arg) {
+ 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);
+ }
+ 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)) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to first_hops in LDKPayer from rust threw an exception.");
+ }
+ LDKCVec_ChannelDetailsZ ret_constr;
+ ret_constr.datalen = (*env)->GetArrayLength(env, ret);
+ if (ret_constr.datalen > 0)
+ ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
+ else
+ ret_constr.data = NULL;
+ int64_t* ret_vals = (*env)->GetLongArrayElements (env, ret, NULL);
+ for (size_t q = 0; q < ret_constr.datalen; q++) {
+ int64_t ret_conv_16 = ret_vals[q];
+ LDKChannelDetails ret_conv_16_conv;
+ ret_conv_16_conv.inner = (void*)(ret_conv_16 & (~1));
+ ret_conv_16_conv.is_owned = (ret_conv_16 & 1) || (ret_conv_16 == 0);
+ ret_conv_16_conv = ChannelDetails_clone(&ret_conv_16_conv);
+ ret_constr.data[q] = ret_conv_16_conv;
+ }
+ (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0);
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
+ }
+ return ret_constr;
+}
+LDKCResult_PaymentIdPaymentSendFailureZ send_payment_LDKPayer_jcall(const void* this_arg, const LDKRoute * route, LDKThirtyTwoBytes payment_hash, LDKThirtyTwoBytes payment_secret) {
+ 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.
+ route_ref = (uint64_t)route_var.inner;
+ if (route_var.is_owned) {
+ route_ref |= 1;
+ }
+ int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
+ (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, payment_hash.data);
+ int8_tArray payment_secret_arr = (*env)->NewByteArray(env, 32);
+ (*env)->SetByteArrayRegion(env, payment_secret_arr, 0, 32, payment_secret.data);
+ 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)) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to send_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);
+ ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone((LDKCResult_PaymentIdPaymentSendFailureZ*)(((uint64_t)ret) & ~1));
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
+ }
return ret_conv;
}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Transaction_1free(JNIEnv *env, jclass clz, int8_tArray _res) {
- LDKTransaction _res_ref;
- _res_ref.datalen = (*env)->GetArrayLength(env, _res);
- _res_ref.data = MALLOC(_res_ref.datalen, "LDKTransaction Bytes");
- (*env)->GetByteArrayRegion(env, _res, 0, _res_ref.datalen, _res_ref.data);
- _res_ref.data_is_owned = true;
- Transaction_free(_res_ref);
+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;
+ 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.
+ route_ref = (uint64_t)route_var.inner;
+ if (route_var.is_owned) {
+ route_ref |= 1;
+ }
+ 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);
+ uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->retry_payment_meth, route_ref, payment_id_arr);
+ if ((*env)->ExceptionCheck(env)) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to retry_payment in LDKPayer from rust threw an exception.");
+ }
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NonePaymentSendFailureZ ret_conv = *(LDKCResult_NonePaymentSendFailureZ*)(ret_ptr);
+ ret_conv = CResult_NonePaymentSendFailureZ_clone((LDKCResult_NonePaymentSendFailureZ*)(((uint64_t)ret) & ~1));
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
+ }
+ return ret_conv;
}
-
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxOut_1new(JNIEnv *env, jclass clz, int8_tArray script_pubkey, int64_t value) {
- LDKCVec_u8Z script_pubkey_ref;
- script_pubkey_ref.datalen = (*env)->GetArrayLength(env, script_pubkey);
- script_pubkey_ref.data = MALLOC(script_pubkey_ref.datalen, "LDKCVec_u8Z Bytes");
- (*env)->GetByteArrayRegion(env, script_pubkey, 0, script_pubkey_ref.datalen, script_pubkey_ref.data);
- LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
- *ret_ref = TxOut_new(script_pubkey_ref, value);
- return (uint64_t)ret_ref;
+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);
}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxOut_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);
- LDKTxOut _res_conv = *(LDKTxOut*)(_res_ptr);
- FREE((void*)_res);
- TxOut_free(_res_conv);
+static inline LDKPayer LDKPayer_init (JNIEnv *env, jclass clz, jobject o) {
+ jclass c = (*env)->GetObjectClass(env, o);
+ CHECK(c != NULL);
+ LDKPayer_JCalls *calls = MALLOC(sizeof(LDKPayer_JCalls), "LDKPayer_JCalls");
+ atomic_init(&calls->refcnt, 1);
+ DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
+ calls->o = (*env)->NewWeakGlobalRef(env, o);
+ calls->node_id_meth = (*env)->GetMethodID(env, c, "node_id", "()[B");
+ CHECK(calls->node_id_meth != NULL);
+ calls->first_hops_meth = (*env)->GetMethodID(env, c, "first_hops", "()[J");
+ 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->retry_payment_meth = (*env)->GetMethodID(env, c, "retry_payment", "(J[B)J");
+ CHECK(calls->retry_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,
+ .retry_payment = retry_payment_LDKPayer_jcall,
+ .free = LDKPayer_JCalls_free,
+ };
+ return ret;
}
-
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxOut_1clone(JNIEnv *env, jclass clz, int64_t orig) {
- LDKTxOut* orig_conv = (LDKTxOut*)(orig & ~1);
- LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
- *ret_ref = TxOut_clone(orig_conv);
- return (uint64_t)ret_ref;
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKPayer_1new(JNIEnv *env, jclass clz, jobject o) {
+ LDKPayer *res_ptr = MALLOC(sizeof(LDKPayer), "LDKPayer");
+ *res_ptr = LDKPayer_init(env, clz, o);
+ return (uint64_t)res_ptr;
}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Str_1free(JNIEnv *env, jclass clz, jstring _res) {
- LDKStr dummy = { .chars = NULL, .len = 0, .chars_is_owned = false };
- Str_free(dummy);
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Payer_1node_1id(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); }
+ LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, (this_arg_conv->node_id)(this_arg_conv->this_arg).compressed_form);
+ return ret_arr;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
- LDKSecretKey o_ref;
- CHECK((*env)->GetArrayLength(env, o) == 32);
- (*env)->GetByteArrayRegion(env, o, 0, 32, o_ref.bytes);
- LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
- *ret_conv = CResult_SecretKeyErrorZ_ok(o_ref);
- return (uint64_t)ret_conv;
+JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Payer_1first_1hops(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); }
+ LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
+ LDKCVec_ChannelDetailsZ ret_var = (this_arg_conv->first_hops)(this_arg_conv->this_arg);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
+ for (size_t q = 0; q < ret_var.datalen; q++) {
+ LDKChannelDetails ret_conv_16_var = ret_var.data[q];
+ uint64_t ret_conv_16_ref = 0;
+ CHECK((((uint64_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner;
+ if (ret_conv_16_var.is_owned) {
+ ret_conv_16_ref |= 1;
+ }
+ ret_arr_ptr[q] = ret_conv_16_ref;
+ }
+ (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
+ FREE(ret_var.data);
+ return ret_arr;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
- LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_java(env, e);
- LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
- *ret_conv = CResult_SecretKeyErrorZ_err(e_conv);
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payer_1send_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t route, int8_tArray payment_hash, int8_tArray payment_secret) {
+ 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;
+ 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_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
+ *ret_conv = (this_arg_conv->send_payment)(this_arg_conv->this_arg, &route_conv, payment_hash_ref, payment_secret_ref);
return (uint64_t)ret_conv;
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_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_SecretKeyErrorZ _res_conv = *(LDKCResult_SecretKeyErrorZ*)(_res_ptr);
- FREE((void*)_res);
- CResult_SecretKeyErrorZ_free(_res_conv);
-}
-
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
- LDKPublicKey o_ref;
- CHECK((*env)->GetArrayLength(env, o) == 33);
- (*env)->GetByteArrayRegion(env, o, 0, 33, o_ref.compressed_form);
- LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
- *ret_conv = CResult_PublicKeyErrorZ_ok(o_ref);
+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); }
+ LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
+ LDKRoute route_conv;
+ route_conv.inner = (void*)(route & (~1));
+ route_conv.is_owned = false;
+ LDKThirtyTwoBytes payment_id_ref;
+ CHECK((*env)->GetArrayLength(env, payment_id) == 32);
+ (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
+ LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
+ *ret_conv = (this_arg_conv->retry_payment)(this_arg_conv->this_arg, &route_conv, payment_id_ref);
return (uint64_t)ret_conv;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
- LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_java(env, e);
- LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
- *ret_conv = CResult_PublicKeyErrorZ_err(e_conv);
+typedef struct LDKRouter_JCalls {
+ atomic_size_t refcnt;
+ JavaVM *vm;
+ jweak o;
+ jmethodID find_route_meth;
+} LDKRouter_JCalls;
+static void LDKRouter_JCalls_free(void* this_arg) {
+ LDKRouter_JCalls *j_calls = (LDKRouter_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);
+ }
+}
+LDKCResult_RouteLightningErrorZ find_route_LDKRouter_jcall(const void* this_arg, LDKPublicKey payer, const LDKRouteParameters * params, 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 (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 payer_arr = (*env)->NewByteArray(env, 33);
+ (*env)->SetByteArrayRegion(env, payer_arr, 0, 33, payer.compressed_form);
+ LDKRouteParameters params_var = *params;
+ uint64_t params_ref = 0;
+ params_var = RouteParameters_clone(params);
+ CHECK((((uint64_t)params_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)¶ms_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ params_ref = (uint64_t)params_var.inner;
+ if (params_var.is_owned) {
+ params_ref |= 1;
+ }
+ LDKCVec_ChannelDetailsZ *first_hops_var_ptr = first_hops;
+ int64_tArray first_hops_arr = NULL;
+ if (first_hops != NULL) {
+ LDKCVec_ChannelDetailsZ first_hops_var = *first_hops_var_ptr;
+ first_hops_arr = (*env)->NewLongArray(env, first_hops_var.datalen);
+ int64_t *first_hops_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, first_hops_arr, NULL);
+ for (size_t q = 0; q < first_hops_var.datalen; q++) {
+ LDKChannelDetails first_hops_conv_16_var = first_hops_var.data[q];
+ uint64_t first_hops_conv_16_ref = 0;
+ CHECK((((uint64_t)first_hops_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&first_hops_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ first_hops_conv_16_ref = (uint64_t)first_hops_conv_16_var.inner;
+ if (first_hops_conv_16_var.is_owned) {
+ first_hops_conv_16_ref |= 1;
+ }
+ first_hops_arr_ptr[q] = first_hops_conv_16_ref;
+ }
+ (*env)->ReleasePrimitiveArrayCritical(env, first_hops_arr, first_hops_arr_ptr, 0);
+ }
+ // WARNING: This object doesn't live past this scope, needs clone!
+ 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)) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to find_route in LDKRouter from rust threw an exception.");
+ }
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_RouteLightningErrorZ ret_conv = *(LDKCResult_RouteLightningErrorZ*)(ret_ptr);
+ ret_conv = CResult_RouteLightningErrorZ_clone((LDKCResult_RouteLightningErrorZ*)(((uint64_t)ret) & ~1));
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
+ }
+ return ret_conv;
+}
+static void LDKRouter_JCalls_cloned(LDKRouter* new_obj) {
+ LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) new_obj->this_arg;
+ atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
+}
+static inline LDKRouter LDKRouter_init (JNIEnv *env, jclass clz, jobject o) {
+ jclass c = (*env)->GetObjectClass(env, o);
+ CHECK(c != NULL);
+ LDKRouter_JCalls *calls = MALLOC(sizeof(LDKRouter_JCalls), "LDKRouter_JCalls");
+ 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");
+ CHECK(calls->find_route_meth != NULL);
+
+ LDKRouter ret = {
+ .this_arg = (void*) calls,
+ .find_route = find_route_LDKRouter_jcall,
+ .free = LDKRouter_JCalls_free,
+ };
+ return ret;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKRouter_1new(JNIEnv *env, jclass clz, jobject o) {
+ LDKRouter *res_ptr = MALLOC(sizeof(LDKRouter), "LDKRouter");
+ *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) {
+ 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;
+ LDKPublicKey payer_ref;
+ CHECK((*env)->GetArrayLength(env, payer) == 33);
+ (*env)->GetByteArrayRegion(env, payer, 0, 33, payer_ref.compressed_form);
+ LDKRouteParameters params_conv;
+ params_conv.inner = (void*)(params & (~1));
+ params_conv.is_owned = false;
+ LDKCVec_ChannelDetailsZ first_hops_constr;
+ LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL;
+ if (first_hops != NULL) {
+ first_hops_constr.datalen = (*env)->GetArrayLength(env, first_hops);
+ if (first_hops_constr.datalen > 0)
+ first_hops_constr.data = MALLOC(first_hops_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
+ else
+ first_hops_constr.data = NULL;
+ int64_t* first_hops_vals = (*env)->GetLongArrayElements (env, first_hops, NULL);
+ for (size_t q = 0; q < first_hops_constr.datalen; q++) {
+ int64_t first_hops_conv_16 = first_hops_vals[q];
+ LDKChannelDetails first_hops_conv_16_conv;
+ first_hops_conv_16_conv.inner = (void*)(first_hops_conv_16 & (~1));
+ first_hops_conv_16_conv.is_owned = (first_hops_conv_16 & 1) || (first_hops_conv_16 == 0);
+ first_hops_constr.data[q] = first_hops_conv_16_conv;
+ }
+ (*env)->ReleaseLongArrayElements(env, first_hops, first_hops_vals, 0);
+ first_hops_ptr = &first_hops_constr;
+ }
+ void* scorer_ptr = (void*)(((uint64_t)scorer) & ~1);
+ 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);
+ if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings__1ldk_1get_1compiled_1version(JNIEnv *env, jclass clz) {
+ LDKStr ret_str = _ldk_get_compiled_version();
+ jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
+ Str_free(ret_str);
+ return ret_conv;
+}
+
+JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings__1ldk_1c_1bindings_1get_1compiled_1version(JNIEnv *env, jclass clz) {
+ LDKStr ret_str = _ldk_c_bindings_get_compiled_version();
+ 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_Transaction_1free(JNIEnv *env, jclass clz, int8_tArray _res) {
+ LDKTransaction _res_ref;
+ _res_ref.datalen = (*env)->GetArrayLength(env, _res);
+ _res_ref.data = MALLOC(_res_ref.datalen, "LDKTransaction Bytes");
+ (*env)->GetByteArrayRegion(env, _res, 0, _res_ref.datalen, _res_ref.data);
+ _res_ref.data_is_owned = true;
+ Transaction_free(_res_ref);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxOut_1new(JNIEnv *env, jclass clz, int8_tArray script_pubkey, int64_t value) {
+ LDKCVec_u8Z script_pubkey_ref;
+ script_pubkey_ref.datalen = (*env)->GetArrayLength(env, script_pubkey);
+ script_pubkey_ref.data = MALLOC(script_pubkey_ref.datalen, "LDKCVec_u8Z Bytes");
+ (*env)->GetByteArrayRegion(env, script_pubkey, 0, script_pubkey_ref.datalen, script_pubkey_ref.data);
+ LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
+ *ret_ref = TxOut_new(script_pubkey_ref, value);
+ return (uint64_t)ret_ref;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxOut_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);
+ LDKTxOut _res_conv = *(LDKTxOut*)(_res_ptr);
+ FREE((void*)_res);
+ TxOut_free(_res_conv);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxOut_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKTxOut* orig_conv = (LDKTxOut*)(orig & ~1);
+ LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
+ *ret_ref = TxOut_clone(orig_conv);
+ return (uint64_t)ret_ref;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Str_1free(JNIEnv *env, jclass clz, jstring _res) {
+ LDKStr dummy = { .chars = NULL, .len = 0, .chars_is_owned = false };
+ Str_free(dummy);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
+ LDKSecretKey o_ref;
+ CHECK((*env)->GetArrayLength(env, o) == 32);
+ (*env)->GetByteArrayRegion(env, o, 0, 32, o_ref.bytes);
+ LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
+ *ret_conv = CResult_SecretKeyErrorZ_ok(o_ref);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
+ LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_java(env, e);
+ LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
+ *ret_conv = CResult_SecretKeyErrorZ_err(e_conv);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_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_SecretKeyErrorZ _res_conv = *(LDKCResult_SecretKeyErrorZ*)(_res_ptr);
+ FREE((void*)_res);
+ CResult_SecretKeyErrorZ_free(_res_conv);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
+ LDKPublicKey o_ref;
+ CHECK((*env)->GetArrayLength(env, o) == 33);
+ (*env)->GetByteArrayRegion(env, o, 0, 33, o_ref.compressed_form);
+ LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
+ *ret_conv = CResult_PublicKeyErrorZ_ok(o_ref);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
+ LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_java(env, e);
+ LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
+ *ret_conv = CResult_PublicKeyErrorZ_err(e_conv);
return (uint64_t)ret_conv;
}
return (uint64_t)ret_conv;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1some(JNIEnv *env, jclass clz, int64_t o) {
- LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
- *ret_copy = COption_u64Z_some(o);
- uint64_t ret_ref = (uint64_t)ret_copy;
- return ret_ref;
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ LDKRouteParameters o_conv;
+ o_conv.inner = (void*)(o & (~1));
+ o_conv.is_owned = (o & 1) || (o == 0);
+ o_conv = RouteParameters_clone(&o_conv);
+ LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
+ *ret_conv = CResult_RouteParametersDecodeErrorZ_ok(o_conv);
+ return (uint64_t)ret_conv;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1none(JNIEnv *env, jclass clz) {
- LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
- *ret_copy = COption_u64Z_none();
- uint64_t ret_ref = (uint64_t)ret_copy;
- return ret_ref;
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_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);
+ e_conv = DecodeError_clone(&e_conv);
+ LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
+ *ret_conv = CResult_RouteParametersDecodeErrorZ_err(e_conv);
+ return (uint64_t)ret_conv;
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1free(JNIEnv *env, jclass clz, int64_t _res) {
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_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);
- LDKCOption_u64Z _res_conv = *(LDKCOption_u64Z*)(_res_ptr);
+ LDKCResult_RouteParametersDecodeErrorZ _res_conv = *(LDKCResult_RouteParametersDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
- COption_u64Z_free(_res_conv);
-}
-
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1clone(JNIEnv *env, jclass clz, int64_t orig) {
- LDKCOption_u64Z* orig_conv = (LDKCOption_u64Z*)orig;
- LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
- *ret_copy = COption_u64Z_clone(orig_conv);
- uint64_t ret_ref = (uint64_t)ret_copy;
- return ret_ref;
+ CResult_RouteParametersDecodeErrorZ_free(_res_conv);
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelDetailsZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
- LDKCVec_ChannelDetailsZ _res_constr;
- _res_constr.datalen = (*env)->GetArrayLength(env, _res);
- if (_res_constr.datalen > 0)
- _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
- else
- _res_constr.data = NULL;
- int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
- for (size_t q = 0; q < _res_constr.datalen; q++) {
- int64_t _res_conv_16 = _res_vals[q];
- LDKChannelDetails _res_conv_16_conv;
- _res_conv_16_conv.inner = (void*)(_res_conv_16 & (~1));
- _res_conv_16_conv.is_owned = (_res_conv_16 & 1) || (_res_conv_16 == 0);
- _res_constr.data[q] = _res_conv_16_conv;
- }
- (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
- CVec_ChannelDetailsZ_free(_res_constr);
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKCResult_RouteParametersDecodeErrorZ* orig_conv = (LDKCResult_RouteParametersDecodeErrorZ*)(orig & ~1);
+ LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
+ *ret_conv = CResult_RouteParametersDecodeErrorZ_clone(orig_conv);
+ return (uint64_t)ret_conv;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHintZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
CVec_RouteHintZ_free(_res_constr);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKRoute o_conv;
- o_conv.inner = (void*)(o & (~1));
- o_conv.is_owned = (o & 1) || (o == 0);
- o_conv = Route_clone(&o_conv);
- LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
- *ret_conv = CResult_RouteLightningErrorZ_ok(o_conv);
- return (uint64_t)ret_conv;
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1some(JNIEnv *env, jclass clz, int64_t o) {
+ LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
+ *ret_copy = COption_u64Z_some(o);
+ uint64_t ret_ref = (uint64_t)ret_copy;
+ return ret_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKLightningError e_conv;
- e_conv.inner = (void*)(e & (~1));
- e_conv.is_owned = (e & 1) || (e == 0);
- e_conv = LightningError_clone(&e_conv);
- LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
- *ret_conv = CResult_RouteLightningErrorZ_err(e_conv);
- return (uint64_t)ret_conv;
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1none(JNIEnv *env, jclass clz) {
+ LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
+ *ret_copy = COption_u64Z_none();
+ uint64_t ret_ref = (uint64_t)ret_copy;
+ return ret_ref;
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_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_RouteLightningErrorZ _res_conv = *(LDKCResult_RouteLightningErrorZ*)(_res_ptr);
+ LDKCOption_u64Z _res_conv = *(LDKCOption_u64Z*)(_res_ptr);
FREE((void*)_res);
- CResult_RouteLightningErrorZ_free(_res_conv);
+ COption_u64Z_free(_res_conv);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKCOption_u64Z* orig_conv = (LDKCOption_u64Z*)orig;
+ LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
+ *ret_copy = COption_u64Z_clone(orig_conv);
+ uint64_t ret_ref = (uint64_t)ret_copy;
+ return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeeDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ LDKPayee o_conv;
+ o_conv.inner = (void*)(o & (~1));
+ o_conv.is_owned = (o & 1) || (o == 0);
+ o_conv = Payee_clone(&o_conv);
+ LDKCResult_PayeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeeDecodeErrorZ), "LDKCResult_PayeeDecodeErrorZ");
+ *ret_conv = CResult_PayeeDecodeErrorZ_ok(o_conv);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeeDecodeErrorZ_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);
+ e_conv = DecodeError_clone(&e_conv);
+ LDKCResult_PayeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeeDecodeErrorZ), "LDKCResult_PayeeDecodeErrorZ");
+ *ret_conv = CResult_PayeeDecodeErrorZ_err(e_conv);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PayeeDecodeErrorZ_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_PayeeDecodeErrorZ _res_conv = *(LDKCResult_PayeeDecodeErrorZ*)(_res_ptr);
+ FREE((void*)_res);
+ CResult_PayeeDecodeErrorZ_free(_res_conv);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeeDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKCResult_PayeeDecodeErrorZ* orig_conv = (LDKCResult_PayeeDecodeErrorZ*)(orig & ~1);
+ LDKCResult_PayeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeeDecodeErrorZ), "LDKCResult_PayeeDecodeErrorZ");
+ *ret_conv = CResult_PayeeDecodeErrorZ_clone(orig_conv);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHintHopZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
+ LDKCVec_RouteHintHopZ _res_constr;
+ _res_constr.datalen = (*env)->GetArrayLength(env, _res);
+ if (_res_constr.datalen > 0)
+ _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements");
+ else
+ _res_constr.data = NULL;
+ int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
+ for (size_t o = 0; o < _res_constr.datalen; o++) {
+ int64_t _res_conv_14 = _res_vals[o];
+ LDKRouteHintHop _res_conv_14_conv;
+ _res_conv_14_conv.inner = (void*)(_res_conv_14 & (~1));
+ _res_conv_14_conv.is_owned = (_res_conv_14 & 1) || (_res_conv_14 == 0);
+ _res_constr.data[o] = _res_conv_14_conv;
+ }
+ (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
+ CVec_RouteHintHopZ_free(_res_constr);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ LDKRouteHint o_conv;
+ o_conv.inner = (void*)(o & (~1));
+ o_conv.is_owned = (o & 1) || (o == 0);
+ o_conv = RouteHint_clone(&o_conv);
+ LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
+ *ret_conv = CResult_RouteHintDecodeErrorZ_ok(o_conv);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_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);
+ e_conv = DecodeError_clone(&e_conv);
+ LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
+ *ret_conv = CResult_RouteHintDecodeErrorZ_err(e_conv);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_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_RouteHintDecodeErrorZ _res_conv = *(LDKCResult_RouteHintDecodeErrorZ*)(_res_ptr);
+ FREE((void*)_res);
+ CResult_RouteHintDecodeErrorZ_free(_res_conv);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKCResult_RouteHintDecodeErrorZ* orig_conv = (LDKCResult_RouteHintDecodeErrorZ*)(orig & ~1);
+ LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
+ *ret_conv = CResult_RouteHintDecodeErrorZ_clone(orig_conv);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ LDKRouteHintHop o_conv;
+ o_conv.inner = (void*)(o & (~1));
+ o_conv.is_owned = (o & 1) || (o == 0);
+ o_conv = RouteHintHop_clone(&o_conv);
+ LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
+ *ret_conv = CResult_RouteHintHopDecodeErrorZ_ok(o_conv);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_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);
+ e_conv = DecodeError_clone(&e_conv);
+ LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
+ *ret_conv = CResult_RouteHintHopDecodeErrorZ_err(e_conv);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_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_RouteHintHopDecodeErrorZ _res_conv = *(LDKCResult_RouteHintHopDecodeErrorZ*)(_res_ptr);
+ FREE((void*)_res);
+ CResult_RouteHintHopDecodeErrorZ_free(_res_conv);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKCResult_RouteHintHopDecodeErrorZ* orig_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)(orig & ~1);
+ LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
+ *ret_conv = CResult_RouteHintHopDecodeErrorZ_clone(orig_conv);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelDetailsZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
+ LDKCVec_ChannelDetailsZ _res_constr;
+ _res_constr.datalen = (*env)->GetArrayLength(env, _res);
+ if (_res_constr.datalen > 0)
+ _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
+ else
+ _res_constr.data = NULL;
+ int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
+ for (size_t q = 0; q < _res_constr.datalen; q++) {
+ int64_t _res_conv_16 = _res_vals[q];
+ LDKChannelDetails _res_conv_16_conv;
+ _res_conv_16_conv.inner = (void*)(_res_conv_16 & (~1));
+ _res_conv_16_conv.is_owned = (_res_conv_16 & 1) || (_res_conv_16 == 0);
+ _res_constr.data[q] = _res_conv_16_conv;
+ }
+ (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
+ CVec_ChannelDetailsZ_free(_res_constr);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ LDKRoute o_conv;
+ o_conv.inner = (void*)(o & (~1));
+ o_conv.is_owned = (o & 1) || (o == 0);
+ o_conv = Route_clone(&o_conv);
+ LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
+ *ret_conv = CResult_RouteLightningErrorZ_ok(o_conv);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
+ LDKLightningError e_conv;
+ e_conv.inner = (void*)(e & (~1));
+ e_conv.is_owned = (e & 1) || (e == 0);
+ e_conv = LightningError_clone(&e_conv);
+ LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
+ *ret_conv = CResult_RouteLightningErrorZ_err(e_conv);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_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_RouteLightningErrorZ _res_conv = *(LDKCResult_RouteLightningErrorZ*)(_res_ptr);
+ FREE((void*)_res);
+ CResult_RouteLightningErrorZ_free(_res_conv);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
CResult_InvoiceFeaturesDecodeErrorZ_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;
+ o_conv.inner = (void*)(o & (~1));
+ o_conv.is_owned = (o & 1) || (o == 0);
+ // 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_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);
+ e_conv = DecodeError_clone(&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 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_ScoringParametersDecodeErrorZ _res_conv = *(LDKCResult_ScoringParametersDecodeErrorZ*)(_res_ptr);
+ FREE((void*)_res);
+ CResult_ScoringParametersDecodeErrorZ_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;
+ o_conv.inner = (void*)(o & (~1));
+ o_conv.is_owned = (o & 1) || (o == 0);
+ // 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_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);
+ e_conv = DecodeError_clone(&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 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_ScorerDecodeErrorZ _res_conv = *(LDKCResult_ScorerDecodeErrorZ*)(_res_ptr);
+ FREE((void*)_res);
+ CResult_ScorerDecodeErrorZ_free(_res_conv);
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
LDKDelayedPaymentOutputDescriptor o_conv;
o_conv.inner = (void*)(o & (~1));
return (uint64_t)ret_conv;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKPaymentId o_conv;
- o_conv.inner = (void*)(o & (~1));
- o_conv.is_owned = (o & 1) || (o == 0);
- o_conv = PaymentId_clone(&o_conv);
- LDKCResult_PaymentIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdDecodeErrorZ), "LDKCResult_PaymentIdDecodeErrorZ");
- *ret_conv = CResult_PaymentIdDecodeErrorZ_ok(o_conv);
- return (uint64_t)ret_conv;
-}
-
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdDecodeErrorZ_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);
- e_conv = DecodeError_clone(&e_conv);
- LDKCResult_PaymentIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdDecodeErrorZ), "LDKCResult_PaymentIdDecodeErrorZ");
- *ret_conv = CResult_PaymentIdDecodeErrorZ_err(e_conv);
- return (uint64_t)ret_conv;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdDecodeErrorZ_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_PaymentIdDecodeErrorZ _res_conv = *(LDKCResult_PaymentIdDecodeErrorZ*)(_res_ptr);
- FREE((void*)_res);
- CResult_PaymentIdDecodeErrorZ_free(_res_conv);
-}
-
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
- LDKCResult_PaymentIdDecodeErrorZ* orig_conv = (LDKCResult_PaymentIdDecodeErrorZ*)(orig & ~1);
- LDKCResult_PaymentIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdDecodeErrorZ), "LDKCResult_PaymentIdDecodeErrorZ");
- *ret_conv = CResult_PaymentIdDecodeErrorZ_clone(orig_conv);
- return (uint64_t)ret_conv;
-}
-
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1some(JNIEnv *env, jclass clz, int16_t o) {
LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z");
*ret_copy = COption_u16Z_some(o);
return (uint64_t)ret_conv;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKPaymentId o_conv;
- o_conv.inner = (void*)(o & (~1));
- o_conv.is_owned = (o & 1) || (o == 0);
- o_conv = PaymentId_clone(&o_conv);
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_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_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
- *ret_conv = CResult_PaymentIdPaymentSendFailureZ_ok(o_conv);
+ *ret_conv = CResult_PaymentIdPaymentSendFailureZ_ok(o_ref);
return (uint64_t)ret_conv;
}
return ((uint64_t)ret_conv);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_t b) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int8_tArray b) {
LDKThirtyTwoBytes a_ref;
CHECK((*env)->GetArrayLength(env, a) == 32);
(*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data);
- LDKPaymentId b_conv;
- b_conv.inner = (void*)(b & (~1));
- b_conv.is_owned = (b & 1) || (b == 0);
- b_conv = PaymentId_clone(&b_conv);
+ LDKThirtyTwoBytes b_ref;
+ CHECK((*env)->GetArrayLength(env, b) == 32);
+ (*env)->GetByteArrayRegion(env, b, 0, 32, b_ref.data);
LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ");
- *ret_conv = C2Tuple_PaymentHashPaymentIdZ_new(a_ref, b_conv);
+ *ret_conv = C2Tuple_PaymentHashPaymentIdZ_new(a_ref, b_ref);
return ((uint64_t)ret_conv);
}
return (uint64_t)ret_conv;
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_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_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
+ *ret_conv = CResult_PaymentIdPaymentErrorZ_ok(o_ref);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
+ void* e_ptr = (void*)(((uint64_t)e) & ~1);
+ CHECK_ACCESS(e_ptr);
+ LDKPaymentError e_conv = *(LDKPaymentError*)(e_ptr);
+ e_conv = PaymentError_clone((LDKPaymentError*)(((uint64_t)e) & ~1));
+ LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
+ *ret_conv = CResult_PaymentIdPaymentErrorZ_err(e_conv);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_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_PaymentIdPaymentErrorZ _res_conv = *(LDKCResult_PaymentIdPaymentErrorZ*)(_res_ptr);
+ FREE((void*)_res);
+ CResult_PaymentIdPaymentErrorZ_free(_res_conv);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKCResult_PaymentIdPaymentErrorZ* orig_conv = (LDKCResult_PaymentIdPaymentErrorZ*)(orig & ~1);
+ LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
+ *ret_conv = CResult_PaymentIdPaymentErrorZ_clone(orig_conv);
+ return (uint64_t)ret_conv;
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixNoneZ_1ok(JNIEnv *env, jclass clz, jclass o) {
LDKSiPrefix o_conv = LDKSiPrefix_from_java(env, o);
LDKCResult_SiPrefixNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixNoneZ), "LDKCResult_SiPrefixNoneZ");
return ret_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressu8Z_1ok(JNIEnv *env, jclass clz, int64_t o) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
void* o_ptr = (void*)(((uint64_t)o) & ~1);
CHECK_ACCESS(o_ptr);
LDKNetAddress o_conv = *(LDKNetAddress*)(o_ptr);
o_conv = NetAddress_clone((LDKNetAddress*)(((uint64_t)o) & ~1));
- LDKCResult_NetAddressu8Z* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressu8Z), "LDKCResult_NetAddressu8Z");
- *ret_conv = CResult_NetAddressu8Z_ok(o_conv);
- return (uint64_t)ret_conv;
-}
-
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressu8Z_1err(JNIEnv *env, jclass clz, int8_t e) {
- LDKCResult_NetAddressu8Z* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressu8Z), "LDKCResult_NetAddressu8Z");
- *ret_conv = CResult_NetAddressu8Z_err(e);
- return (uint64_t)ret_conv;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressu8Z_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_NetAddressu8Z _res_conv = *(LDKCResult_NetAddressu8Z*)(_res_ptr);
- FREE((void*)_res);
- CResult_NetAddressu8Z_free(_res_conv);
-}
-
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressu8Z_1clone(JNIEnv *env, jclass clz, int64_t orig) {
- LDKCResult_NetAddressu8Z* orig_conv = (LDKCResult_NetAddressu8Z*)(orig & ~1);
- LDKCResult_NetAddressu8Z* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressu8Z), "LDKCResult_NetAddressu8Z");
- *ret_conv = CResult_NetAddressu8Z_clone(orig_conv);
- return (uint64_t)ret_conv;
-}
-
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CResult_1NetAddressu8ZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
- void* o_ptr = (void*)(((uint64_t)o) & ~1);
- CHECK_ACCESS(o_ptr);
- LDKCResult_NetAddressu8Z o_conv = *(LDKCResult_NetAddressu8Z*)(o_ptr);
- o_conv = CResult_NetAddressu8Z_clone((LDKCResult_NetAddressu8Z*)(((uint64_t)o) & ~1));
- LDKCResult_CResult_NetAddressu8ZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CResult_NetAddressu8ZDecodeErrorZ), "LDKCResult_CResult_NetAddressu8ZDecodeErrorZ");
- *ret_conv = CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(o_conv);
+ LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
+ *ret_conv = CResult_NetAddressDecodeErrorZ_ok(o_conv);
return (uint64_t)ret_conv;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CResult_1NetAddressu8ZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_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);
e_conv = DecodeError_clone(&e_conv);
- LDKCResult_CResult_NetAddressu8ZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CResult_NetAddressu8ZDecodeErrorZ), "LDKCResult_CResult_NetAddressu8ZDecodeErrorZ");
- *ret_conv = CResult_CResult_NetAddressu8ZDecodeErrorZ_err(e_conv);
+ LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
+ *ret_conv = CResult_NetAddressDecodeErrorZ_err(e_conv);
return (uint64_t)ret_conv;
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CResult_1NetAddressu8ZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_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_CResult_NetAddressu8ZDecodeErrorZ _res_conv = *(LDKCResult_CResult_NetAddressu8ZDecodeErrorZ*)(_res_ptr);
+ LDKCResult_NetAddressDecodeErrorZ _res_conv = *(LDKCResult_NetAddressDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
- CResult_CResult_NetAddressu8ZDecodeErrorZ_free(_res_conv);
+ CResult_NetAddressDecodeErrorZ_free(_res_conv);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CResult_1NetAddressu8ZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
- LDKCResult_CResult_NetAddressu8ZDecodeErrorZ* orig_conv = (LDKCResult_CResult_NetAddressu8ZDecodeErrorZ*)(orig & ~1);
- LDKCResult_CResult_NetAddressu8ZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CResult_NetAddressu8ZDecodeErrorZ), "LDKCResult_CResult_NetAddressu8ZDecodeErrorZ");
- *ret_conv = CResult_CResult_NetAddressu8ZDecodeErrorZ_clone(orig_conv);
- return (uint64_t)ret_conv;
-}
-
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
- void* o_ptr = (void*)(((uint64_t)o) & ~1);
- CHECK_ACCESS(o_ptr);
- LDKNetAddress o_conv = *(LDKNetAddress*)(o_ptr);
- o_conv = NetAddress_clone((LDKNetAddress*)(((uint64_t)o) & ~1));
- LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
- *ret_conv = CResult_NetAddressDecodeErrorZ_ok(o_conv);
- return (uint64_t)ret_conv;
-}
-
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_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);
- e_conv = DecodeError_clone(&e_conv);
- LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
- *ret_conv = CResult_NetAddressDecodeErrorZ_err(e_conv);
- return (uint64_t)ret_conv;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_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_NetAddressDecodeErrorZ _res_conv = *(LDKCResult_NetAddressDecodeErrorZ*)(_res_ptr);
- FREE((void*)_res);
- CResult_NetAddressDecodeErrorZ_free(_res_conv);
-}
-
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
- LDKCResult_NetAddressDecodeErrorZ* orig_conv = (LDKCResult_NetAddressDecodeErrorZ*)(orig & ~1);
- LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
- *ret_conv = CResult_NetAddressDecodeErrorZ_clone(orig_conv);
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKCResult_NetAddressDecodeErrorZ* orig_conv = (LDKCResult_NetAddressDecodeErrorZ*)(orig & ~1);
+ LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
+ *ret_conv = CResult_NetAddressDecodeErrorZ_clone(orig_conv);
return (uint64_t)ret_conv;
}
return ret_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1sent(JNIEnv *env, jclass clz, int8_tArray payment_preimage, int8_tArray payment_hash) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1sent(JNIEnv *env, jclass clz, int8_tArray payment_id, int8_tArray payment_preimage, int8_tArray payment_hash, int64_t fee_paid_msat) {
+ LDKThirtyTwoBytes payment_id_ref;
+ CHECK((*env)->GetArrayLength(env, payment_id) == 32);
+ (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
LDKThirtyTwoBytes payment_preimage_ref;
CHECK((*env)->GetArrayLength(env, payment_preimage) == 32);
(*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data);
LDKThirtyTwoBytes payment_hash_ref;
CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
(*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
+ void* fee_paid_msat_ptr = (void*)(((uint64_t)fee_paid_msat) & ~1);
+ CHECK_ACCESS(fee_paid_msat_ptr);
+ LDKCOption_u64Z fee_paid_msat_conv = *(LDKCOption_u64Z*)(fee_paid_msat_ptr);
+ fee_paid_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)fee_paid_msat) & ~1));
LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
- *ret_copy = Event_payment_sent(payment_preimage_ref, payment_hash_ref);
+ *ret_copy = Event_payment_sent(payment_id_ref, payment_preimage_ref, payment_hash_ref, fee_paid_msat_conv);
uint64_t ret_ref = (uint64_t)ret_copy;
return ret_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1path_1failed(JNIEnv *env, jclass clz, int8_tArray payment_hash, jboolean rejected_by_dest, int64_t network_update, jboolean all_paths_failed, int64_tArray path, int64_t short_channel_id) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1path_1failed(JNIEnv *env, jclass clz, int8_tArray payment_id, int8_tArray payment_hash, jboolean rejected_by_dest, int64_t network_update, jboolean all_paths_failed, int64_tArray path, int64_t short_channel_id, int64_t retry) {
+ 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);
CHECK_ACCESS(short_channel_id_ptr);
LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(short_channel_id_ptr);
short_channel_id_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)short_channel_id) & ~1));
+ LDKRouteParameters retry_conv;
+ retry_conv.inner = (void*)(retry & (~1));
+ retry_conv.is_owned = (retry & 1) || (retry == 0);
+ retry_conv = RouteParameters_clone(&retry_conv);
LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
- *ret_copy = Event_payment_path_failed(payment_hash_ref, rejected_by_dest, network_update_conv, all_paths_failed, path_constr, short_channel_id_conv);
+ *ret_copy = Event_payment_path_failed(payment_id_ref, payment_hash_ref, rejected_by_dest, network_update_conv, all_paths_failed, path_constr, short_channel_id_conv, retry_conv);
uint64_t ret_ref = (uint64_t)ret_copy;
return ret_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1new(JNIEnv *env, jclass clz, int32_t minimum_depth_arg, int16_t our_to_self_delay_arg, int64_t our_htlc_minimum_msat_arg) {
LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1default(JNIEnv *env, jclass clz) {
LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_default();
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1new(JNIEnv *env, jclass clz, int64_t min_funding_satoshis_arg, int64_t max_htlc_minimum_msat_arg, int64_t min_max_htlc_value_in_flight_msat_arg, int64_t max_channel_reserve_satoshis_arg, int16_t min_max_accepted_htlcs_arg, int32_t max_minimum_depth_arg, jboolean force_announced_channel_preference_arg, int16_t their_to_self_delay_arg) {
LDKChannelHandshakeLimits ret_var = 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);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1default(JNIEnv *env, jclass clz) {
LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_default();
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1new(JNIEnv *env, jclass clz, int32_t forwarding_fee_proportional_millionths_arg, int32_t forwarding_fee_base_msat_arg, int16_t cltv_expiry_delta_arg, jboolean announced_channel_arg, jboolean commit_upfront_shutdown_pubkey_arg, int64_t max_dust_htlc_exposure_msat_arg, int64_t force_close_avoidance_max_fee_satoshis_arg) {
LDKChannelConfig ret_var = 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);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelConfig ret_var = ChannelConfig_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1default(JNIEnv *env, jclass clz) {
LDKChannelConfig ret_var = ChannelConfig_default();
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKChannelHandshakeConfig ret_var = UserConfig_get_own_channel_config(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKChannelHandshakeLimits ret_var = UserConfig_get_peer_channel_config_limits(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKChannelConfig ret_var = UserConfig_get_channel_options(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
channel_options_arg_conv.is_owned = (channel_options_arg & 1) || (channel_options_arg == 0);
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);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKUserConfig ret_var = UserConfig_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1default(JNIEnv *env, jclass clz) {
LDKUserConfig ret_var = UserConfig_default();
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKBestBlock ret_var = BestBlock_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1from_1genesis(JNIEnv *env, jclass clz, jclass network) {
LDKNetwork network_conv = LDKNetwork_from_java(env, network);
LDKBestBlock ret_var = BestBlock_from_genesis(network_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK((*env)->GetArrayLength(env, block_hash) == 32);
(*env)->GetByteArrayRegion(env, block_hash, 0, 32, block_hash_ref.data);
LDKBestBlock ret_var = BestBlock_new(block_hash_ref, height);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKOutPoint ret_var = WatchedOutput_get_outpoint(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
script_pubkey_arg_ref.data = MALLOC(script_pubkey_arg_ref.datalen, "LDKCVec_u8Z Bytes");
(*env)->GetByteArrayRegion(env, script_pubkey_arg, 0, script_pubkey_arg_ref.datalen, script_pubkey_arg_ref.data);
LDKWatchedOutput ret_var = WatchedOutput_new(block_hash_arg_ref, outpoint_arg_conv, script_pubkey_arg_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKWatchedOutput ret_var = WatchedOutput_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
FeeEstimator_free(this_ptr_conv);
}
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
+ LDKMonitorUpdateId this_obj_conv;
+ this_obj_conv.inner = (void*)(this_obj & (~1));
+ this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+ MonitorUpdateId_free(this_obj_conv);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKMonitorUpdateId orig_conv;
+ orig_conv.inner = (void*)(orig & (~1));
+ orig_conv.is_owned = false;
+ LDKMonitorUpdateId ret_var = MonitorUpdateId_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.
+ 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_MonitorUpdateId_1hash(JNIEnv *env, jclass clz, int64_t o) {
+ LDKMonitorUpdateId o_conv;
+ o_conv.inner = (void*)(o & (~1));
+ o_conv.is_owned = false;
+ int64_t ret_val = MonitorUpdateId_hash(&o_conv);
+ return ret_val;
+}
+
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKMonitorUpdateId a_conv;
+ a_conv.inner = (void*)(a & (~1));
+ a_conv.is_owned = false;
+ LDKMonitorUpdateId b_conv;
+ b_conv.inner = (void*)(b & (~1));
+ b_conv.is_owned = false;
+ jboolean ret_val = MonitorUpdateId_eq(&a_conv, &b_conv);
+ return ret_val;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Persist_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);
LDKPersist_JCalls_cloned(&persister_conv);
}
LDKChainMonitor ret_var = ChainMonitor_new(chain_source_conv, broadcaster_conv, logger_conv, feeest_conv, persister_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
}
(*env)->ReleaseLongArrayElements(env, ignored_channels, ignored_channels_vals, 0);
LDKCVec_BalanceZ ret_var = ChainMonitor_get_claimable_balances(&this_arg_conv, ignored_channels_constr);
- int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t j = 0; j < ret_var.datalen; j++) {
LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCVec_OutPointZ ret_var = ChainMonitor_list_monitors(&this_arg_conv);
- int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t k = 0; k < ret_var.datalen; k++) {
LDKOutPoint ret_conv_10_var = ret_var.data[k];
+ uint64_t ret_conv_10_ref = 0;
CHECK((((uint64_t)ret_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t ret_conv_10_ref = (uint64_t)ret_conv_10_var.inner;
+ ret_conv_10_ref = (uint64_t)ret_conv_10_var.inner;
if (ret_conv_10_var.is_owned) {
ret_conv_10_ref |= 1;
}
return ret_arr;
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1channel_1monitor_1updated(JNIEnv *env, jclass clz, int64_t this_arg, int64_t funding_txo, int64_t completed_update_id) {
+ LDKChainMonitor this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ LDKOutPoint funding_txo_conv;
+ funding_txo_conv.inner = (void*)(funding_txo & (~1));
+ funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0);
+ funding_txo_conv = OutPoint_clone(&funding_txo_conv);
+ LDKMonitorUpdateId completed_update_id_conv;
+ completed_update_id_conv.inner = (void*)(completed_update_id & (~1));
+ completed_update_id_conv.is_owned = (completed_update_id & 1) || (completed_update_id == 0);
+ completed_update_id_conv = MonitorUpdateId_clone(&completed_update_id_conv);
+ LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
+ *ret_conv = ChainMonitor_channel_monitor_updated(&this_arg_conv, funding_txo_conv, completed_update_id_conv);
+ return (uint64_t)ret_conv;
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1Listen(JNIEnv *env, jclass clz, int64_t this_arg) {
LDKChainMonitor this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKListen* ret_ret =MALLOC(sizeof(LDKListen), "LDKListen");
+ LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen");
*ret_ret = ChainMonitor_as_Listen(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKChainMonitor this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKConfirm* ret_ret =MALLOC(sizeof(LDKConfirm), "LDKConfirm");
+ LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm");
*ret_ret = ChainMonitor_as_Confirm(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKChainMonitor this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKWatch* ret_ret =MALLOC(sizeof(LDKWatch), "LDKWatch");
+ LDKWatch* ret_ret = MALLOC(sizeof(LDKWatch), "LDKWatch");
*ret_ret = ChainMonitor_as_Watch(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKChainMonitor this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKEventsProvider* ret_ret =MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
+ LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
*ret_ret = ChainMonitor_as_EventsProvider(&this_arg_conv);
return (uint64_t)ret_ret;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
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;
+ 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;
+ 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.
+ 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(JNIEnv *env, jclass clz, int64_t orig) {
LDKMonitorUpdateError orig_conv;
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ 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_MonitorEvent_1update_1completed(JNIEnv *env, jclass clz, int64_t funding_txo, int64_t monitor_update_id) {
+ LDKOutPoint funding_txo_conv;
+ funding_txo_conv.inner = (void*)(funding_txo & (~1));
+ funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0);
+ funding_txo_conv = OutPoint_clone(&funding_txo_conv);
+ LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
+ *ret_copy = MonitorEvent_update_completed(funding_txo_conv, monitor_update_id);
+ uint64_t ret_ref = (uint64_t)ret_copy;
+ return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1update_1failed(JNIEnv *env, jclass clz, int64_t a) {
+ LDKOutPoint a_conv;
+ a_conv.inner = (void*)(a & (~1));
+ a_conv.is_owned = (a & 1) || (a == 0);
+ a_conv = OutPoint_clone(&a_conv);
+ LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
+ *ret_copy = MonitorEvent_update_failed(a_conv);
+ uint64_t ret_ref = (uint64_t)ret_copy;
+ return ret_ref;
+}
+
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1write(JNIEnv *env, jclass clz, int64_t obj) {
+ LDKMonitorEvent* obj_conv = (LDKMonitorEvent*)obj;
+ LDKCVec_u8Z ret_var = MonitorEvent_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_HTLCUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKHTLCUpdate this_obj_conv;
this_obj_conv.inner = (void*)(this_obj & (~1));
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKHTLCUpdate ret_var = HTLCUpdate_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelMonitor ret_var = ChannelMonitor_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ret_var = ChannelMonitor_get_outputs_to_watch(&this_arg_conv);
- int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t o = 0; o < ret_var.datalen; o++) {
LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv_40_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ");
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCVec_MonitorEventZ ret_var = ChannelMonitor_get_and_clear_pending_monitor_events(&this_arg_conv);
- int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t o = 0; o < ret_var.datalen; o++) {
LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCVec_EventZ ret_var = ChannelMonitor_get_and_clear_pending_events(&this_arg_conv);
- int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t h = 0; h < ret_var.datalen; h++) {
LDKEvent *ret_conv_7_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
if (!(logger & 1)) { CHECK_ACCESS(logger_ptr); }
LDKLogger* logger_conv = (LDKLogger*)logger_ptr;
LDKCVec_TransactionZ ret_var = ChannelMonitor_get_latest_holder_commitment_txn(&this_arg_conv, logger_conv);
- jobjectArray ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
+ jobjectArray ret_arr = NULL;
+ ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
;
for (size_t i = 0; i < ret_var.datalen; i++) {
LDKTransaction ret_conv_8_var = ret_var.data[i];
Transaction_free(ret_conv_8_var);
(*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr);
}
+
FREE(ret_var.data);
return ret_arr;
}
LDKLogger_JCalls_cloned(&logger_conv);
}
LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_block_connected(&this_arg_conv, header_ref, txdata_constr, height, broadcaster_conv, fee_estimator_conv, logger_conv);
- int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t n = 0; n < ret_var.datalen; n++) {
LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
LDKLogger_JCalls_cloned(&logger_conv);
}
LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_transactions_confirmed(&this_arg_conv, header_ref, txdata_constr, height, broadcaster_conv, fee_estimator_conv, logger_conv);
- int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t n = 0; n < ret_var.datalen; n++) {
LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
LDKLogger_JCalls_cloned(&logger_conv);
}
LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_best_block_updated(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv);
- int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t n = 0; n < ret_var.datalen; n++) {
LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCVec_TxidZ ret_var = ChannelMonitor_get_relevant_txids(&this_arg_conv);
- jobjectArray ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
+ jobjectArray ret_arr = NULL;
+ ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
;
for (size_t i = 0; i < ret_var.datalen; i++) {
int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 32);
(*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 32, ret_var.data[i].data);
(*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr);
}
+
FREE(ret_var.data);
return ret_arr;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKBestBlock ret_var = ChannelMonitor_current_best_block(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCVec_BalanceZ ret_var = ChannelMonitor_get_claimable_balances(&this_arg_conv);
- int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t j = 0; j < ret_var.datalen; j++) {
LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
CHECK((*env)->GetArrayLength(env, txid_arg) == 32);
(*env)->GetByteArrayRegion(env, txid_arg, 0, 32, txid_arg_ref.data);
LDKOutPoint ret_var = OutPoint_new(txid_arg_ref, index_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKOutPoint ret_var = OutPoint_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKOutPoint ret_var = DelayedPaymentOutputDescriptor_get_outpoint(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK((*env)->GetArrayLength(env, channel_keys_id_arg) == 32);
(*env)->GetByteArrayRegion(env, channel_keys_id_arg, 0, 32, channel_keys_id_arg_ref.data);
LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_new(outpoint_arg_conv, per_commitment_point_arg_ref, to_self_delay_arg, output_arg_conv, revocation_pubkey_arg_ref, channel_keys_id_arg_ref, channel_value_satoshis_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKOutPoint ret_var = StaticPaymentOutputDescriptor_get_outpoint(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK((*env)->GetArrayLength(env, channel_keys_id_arg) == 32);
(*env)->GetByteArrayRegion(env, channel_keys_id_arg, 0, 32, channel_keys_id_arg_ref.data);
LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_new(outpoint_arg_conv, output_arg_conv, channel_keys_id_arg_ref, channel_value_satoshis_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
void* orig_ptr = (void*)(((uint64_t)orig) & ~1);
if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); }
LDKSign* orig_conv = (LDKSign*)orig_ptr;
- LDKSign* ret_ret =MALLOC(sizeof(LDKSign), "LDKSign");
+ LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
*ret_ret = Sign_clone(orig_conv);
return (uint64_t)ret_ret;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKInMemorySigner ret_var = InMemorySigner_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK((*env)->GetArrayLength(env, channel_keys_id) == 32);
(*env)->GetByteArrayRegion(env, channel_keys_id, 0, 32, channel_keys_id_ref.data);
LDKInMemorySigner ret_var = InMemorySigner_new(funding_key_ref, revocation_base_key_ref, payment_key_ref, delayed_payment_base_key_ref, htlc_base_key_ref, commitment_seed_ref, channel_value_satoshis, channel_keys_id_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKChannelPublicKeys ret_var = InMemorySigner_counterparty_pubkeys(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKOutPoint ret_var = InMemorySigner_funding_outpoint(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKChannelTransactionParameters ret_var = InMemorySigner_get_channel_parameters(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKInMemorySigner this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKBaseSign* ret_ret =MALLOC(sizeof(LDKBaseSign), "LDKBaseSign");
+ LDKBaseSign* ret_ret = MALLOC(sizeof(LDKBaseSign), "LDKBaseSign");
*ret_ret = InMemorySigner_as_BaseSign(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKInMemorySigner this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKSign* ret_ret =MALLOC(sizeof(LDKSign), "LDKSign");
+ LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
*ret_ret = InMemorySigner_as_Sign(&this_arg_conv);
return (uint64_t)ret_ret;
}
(*env)->GetByteArrayRegion(env, seed, 0, 32, seed_arr);
unsigned char (*seed_ref)[32] = &seed_arr;
LDKKeysManager ret_var = KeysManager_new(seed_ref, starting_time_secs, starting_time_nanos);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
(*env)->GetByteArrayRegion(env, params, 0, 32, params_arr);
unsigned char (*params_ref)[32] = ¶ms_arr;
LDKInMemorySigner ret_var = KeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKKeysManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKKeysInterface* ret_ret =MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface");
+ LDKKeysInterface* ret_ret = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface");
*ret_ret = KeysManager_as_KeysInterface(&this_arg_conv);
return (uint64_t)ret_ret;
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentId_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
- LDKPaymentId this_obj_conv;
- this_obj_conv.inner = (void*)(this_obj & (~1));
- this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
- PaymentId_free(this_obj_conv);
-}
-
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentId_1hash(JNIEnv *env, jclass clz, int64_t o) {
- LDKPaymentId o_conv;
- o_conv.inner = (void*)(o & (~1));
- o_conv.is_owned = false;
- int64_t ret_val = PaymentId_hash(&o_conv);
- return ret_val;
-}
-
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentId_1clone(JNIEnv *env, jclass clz, int64_t orig) {
- LDKPaymentId orig_conv;
- orig_conv.inner = (void*)(orig & (~1));
- orig_conv.is_owned = false;
- LDKPaymentId ret_var = PaymentId_clone(&orig_conv);
- 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.
- uint64_t 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_PaymentId_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
- LDKPaymentId a_conv;
- a_conv.inner = (void*)(a & (~1));
- a_conv.is_owned = false;
- LDKPaymentId b_conv;
- b_conv.inner = (void*)(b & (~1));
- b_conv.is_owned = false;
- jboolean ret_val = PaymentId_eq(&a_conv, &b_conv);
- return ret_val;
-}
-
-JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PaymentId_1write(JNIEnv *env, jclass clz, int64_t obj) {
- LDKPaymentId obj_conv;
- obj_conv.inner = (void*)(obj & (~1));
- obj_conv.is_owned = false;
- LDKCVec_u8Z ret_var = PaymentId_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_PaymentId_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_PaymentIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdDecodeErrorZ), "LDKCResult_PaymentIdDecodeErrorZ");
- *ret_conv = PaymentId_read(ser_ref);
- (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
- return (uint64_t)ret_conv;
-}
-
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKChannelManager this_obj_conv;
this_obj_conv.inner = (void*)(this_obj & (~1));
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKBestBlock ret_var = ChainParameters_get_best_block(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
best_block_arg_conv.is_owned = (best_block_arg & 1) || (best_block_arg == 0);
best_block_arg_conv = BestBlock_clone(&best_block_arg_conv);
LDKChainParameters ret_var = ChainParameters_new(network_arg_conv, best_block_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChainParameters ret_var = ChainParameters_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1new(JNIEnv *env, jclass clz, int32_t fee_base_msat_arg, int32_t fee_proportional_millionths_arg, int16_t cltv_expiry_delta_arg) {
LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_new(fee_base_msat_arg, fee_proportional_millionths_arg, cltv_expiry_delta_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKInitFeatures ret_var = ChannelCounterparty_get_features(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKCounterpartyForwardingInfo ret_var = ChannelCounterparty_get_forwarding_info(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
forwarding_info_arg_conv.is_owned = (forwarding_info_arg & 1) || (forwarding_info_arg == 0);
forwarding_info_arg_conv = CounterpartyForwardingInfo_clone(&forwarding_info_arg_conv);
LDKChannelCounterparty ret_var = ChannelCounterparty_new(node_id_arg_ref, features_arg_conv, unspendable_punishment_reserve_arg, forwarding_info_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelCounterparty ret_var = ChannelCounterparty_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKChannelCounterparty ret_var = ChannelDetails_get_counterparty(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKOutPoint ret_var = ChannelDetails_get_funding_txo(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
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);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelDetails ret_var = ChannelDetails_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ 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_PaymentSendFailure_1partial_1failure(JNIEnv *env, jclass clz, int64_tArray a) {
- LDKCVec_CResult_NoneAPIErrorZZ a_constr;
- a_constr.datalen = (*env)->GetArrayLength(env, a);
- if (a_constr.datalen > 0)
- a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1partial_1failure(JNIEnv *env, jclass clz, int64_tArray results, int64_t failed_paths_retry, int8_tArray payment_id) {
+ LDKCVec_CResult_NoneAPIErrorZZ results_constr;
+ results_constr.datalen = (*env)->GetArrayLength(env, results);
+ if (results_constr.datalen > 0)
+ results_constr.data = MALLOC(results_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
else
- a_constr.data = NULL;
- int64_t* a_vals = (*env)->GetLongArrayElements (env, a, NULL);
- for (size_t w = 0; w < a_constr.datalen; w++) {
- int64_t a_conv_22 = a_vals[w];
- void* a_conv_22_ptr = (void*)(((uint64_t)a_conv_22) & ~1);
- CHECK_ACCESS(a_conv_22_ptr);
- LDKCResult_NoneAPIErrorZ a_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(a_conv_22_ptr);
- a_conv_22_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)(((uint64_t)a_conv_22) & ~1));
- a_constr.data[w] = a_conv_22_conv;
- }
- (*env)->ReleaseLongArrayElements(env, a, a_vals, 0);
+ results_constr.data = NULL;
+ int64_t* results_vals = (*env)->GetLongArrayElements (env, results, NULL);
+ for (size_t w = 0; w < results_constr.datalen; w++) {
+ int64_t results_conv_22 = results_vals[w];
+ void* results_conv_22_ptr = (void*)(((uint64_t)results_conv_22) & ~1);
+ CHECK_ACCESS(results_conv_22_ptr);
+ LDKCResult_NoneAPIErrorZ results_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(results_conv_22_ptr);
+ results_constr.data[w] = results_conv_22_conv;
+ }
+ (*env)->ReleaseLongArrayElements(env, results, results_vals, 0);
+ LDKRouteParameters failed_paths_retry_conv;
+ failed_paths_retry_conv.inner = (void*)(failed_paths_retry & (~1));
+ failed_paths_retry_conv.is_owned = (failed_paths_retry & 1) || (failed_paths_retry == 0);
+ failed_paths_retry_conv = RouteParameters_clone(&failed_paths_retry_conv);
+ LDKThirtyTwoBytes payment_id_ref;
+ CHECK((*env)->GetArrayLength(env, payment_id) == 32);
+ (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
- *ret_copy = PaymentSendFailure_partial_failure(a_constr);
+ *ret_copy = PaymentSendFailure_partial_failure(results_constr, failed_paths_retry_conv, payment_id_ref);
uint64_t ret_ref = (uint64_t)ret_copy;
return ret_ref;
}
params_conv.is_owned = (params & 1) || (params == 0);
params_conv = ChainParameters_clone(¶ms_conv);
LDKChannelManager ret_var = ChannelManager_new(fee_est_conv, chain_monitor_conv, tx_broadcaster_conv, logger_conv, keys_manager_conv, config_conv, params_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKUserConfig ret_var = ChannelManager_get_current_default_configuration(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_channels(&this_arg_conv);
- int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t q = 0; q < ret_var.datalen; q++) {
LDKChannelDetails ret_conv_16_var = ret_var.data[q];
+ uint64_t ret_conv_16_ref = 0;
CHECK((((uint64_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner;
+ ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner;
if (ret_conv_16_var.is_owned) {
ret_conv_16_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_usable_channels(&this_arg_conv);
- int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t q = 0; q < ret_var.datalen; q++) {
LDKChannelDetails ret_conv_16_var = ret_var.data[q];
+ uint64_t ret_conv_16_ref = 0;
CHECK((((uint64_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner;
+ ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner;
if (ret_conv_16_var.is_owned) {
ret_conv_16_ref |= 1;
}
return (uint64_t)ret_conv;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1retry_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t route, int64_t payment_id) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1retry_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t route, int8_tArray payment_id) {
LDKChannelManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKRoute route_conv;
route_conv.inner = (void*)(route & (~1));
route_conv.is_owned = false;
- LDKPaymentId payment_id_conv;
- payment_id_conv.inner = (void*)(payment_id & (~1));
- payment_id_conv.is_owned = (payment_id & 1) || (payment_id == 0);
- payment_id_conv = PaymentId_clone(&payment_id_conv);
+ LDKThirtyTwoBytes payment_id_ref;
+ CHECK((*env)->GetArrayLength(env, payment_id) == 32);
+ (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
- *ret_conv = ChannelManager_retry_payment(&this_arg_conv, &route_conv, payment_id_conv);
+ *ret_conv = ChannelManager_retry_payment(&this_arg_conv, &route_conv, payment_id_ref);
return (uint64_t)ret_conv;
}
return ret_arr;
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1channel_1monitor_1updated(JNIEnv *env, jclass clz, int64_t this_arg, int64_t funding_txo, int64_t highest_applied_update_id) {
- LDKChannelManager this_arg_conv;
- this_arg_conv.inner = (void*)(this_arg & (~1));
- this_arg_conv.is_owned = false;
- LDKOutPoint funding_txo_conv;
- funding_txo_conv.inner = (void*)(funding_txo & (~1));
- funding_txo_conv.is_owned = false;
- ChannelManager_channel_monitor_updated(&this_arg_conv, &funding_txo_conv, highest_applied_update_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, int64_t user_payment_id) {
LDKChannelManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
LDKChannelManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKMessageSendEventsProvider* ret_ret =MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
+ LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
*ret_ret = ChannelManager_as_MessageSendEventsProvider(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKChannelManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKEventsProvider* ret_ret =MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
+ LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
*ret_ret = ChannelManager_as_EventsProvider(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKChannelManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKListen* ret_ret =MALLOC(sizeof(LDKListen), "LDKListen");
+ LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen");
*ret_ret = ChannelManager_as_Listen(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKChannelManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKConfirm* ret_ret =MALLOC(sizeof(LDKConfirm), "LDKConfirm");
+ LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm");
*ret_ret = ChannelManager_as_Confirm(&this_arg_conv);
return (uint64_t)ret_ret;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKBestBlock ret_var = ChannelManager_current_best_block(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKChannelManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKChannelMessageHandler* ret_ret =MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
+ LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
*ret_ret = ChannelManager_as_ChannelMessageHandler(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKChannelManagerReadArgs this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- uint64_t ret_ret = (uint64_t)ChannelManagerReadArgs_get_keys_manager(&this_ptr_conv);
+ // WARNING: This object doesn't live past this scope, needs clone!
+ uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_keys_manager(&this_ptr_conv)) | 1;
return ret_ret;
}
LDKChannelManagerReadArgs this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- uint64_t ret_ret = (uint64_t)ChannelManagerReadArgs_get_fee_estimator(&this_ptr_conv);
+ // WARNING: This object doesn't live past this scope, needs clone!
+ uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_fee_estimator(&this_ptr_conv)) | 1;
return ret_ret;
}
LDKChannelManagerReadArgs this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- uint64_t ret_ret = (uint64_t)ChannelManagerReadArgs_get_chain_monitor(&this_ptr_conv);
+ // WARNING: This object doesn't live past this scope, needs clone!
+ uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_chain_monitor(&this_ptr_conv)) | 1;
return ret_ret;
}
LDKChannelManagerReadArgs this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- uint64_t ret_ret = (uint64_t)ChannelManagerReadArgs_get_tx_broadcaster(&this_ptr_conv);
+ // WARNING: This object doesn't live past this scope, needs clone!
+ uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_tx_broadcaster(&this_ptr_conv)) | 1;
return ret_ret;
}
LDKChannelManagerReadArgs this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- uint64_t ret_ret = (uint64_t)ChannelManagerReadArgs_get_logger(&this_ptr_conv);
+ // WARNING: This object doesn't live past this scope, needs clone!
+ uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_logger(&this_ptr_conv)) | 1;
return ret_ret;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKUserConfig ret_var = ChannelManagerReadArgs_get_default_config(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
}
(*env)->ReleaseLongArrayElements(env, channel_monitors, channel_monitors_vals, 0);
LDKChannelManagerReadArgs ret_var = ChannelManagerReadArgs_new(keys_manager_conv, fee_estimator_conv, chain_monitor_conv, tx_broadcaster_conv, logger_conv, default_config_conv, channel_monitors_constr);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKDecodeError ret_var = DecodeError_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKInitFeatures ret_var = Init_get_features(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0);
features_arg_conv = InitFeatures_clone(&features_arg_conv);
LDKInit ret_var = Init_new(features_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKInit ret_var = Init_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
(*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
LDKStr data_arg_conv = java_to_owned_str(env, data_arg);
LDKErrorMessage ret_var = ErrorMessage_new(channel_id_arg_ref, data_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKErrorMessage ret_var = ErrorMessage_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1new(JNIEnv *env, jclass clz, int16_t ponglen_arg, int16_t byteslen_arg) {
LDKPing ret_var = Ping_new(ponglen_arg, byteslen_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKPing ret_var = Ping_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1new(JNIEnv *env, jclass clz, int16_t byteslen_arg) {
LDKPong ret_var = Pong_new(byteslen_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKPong ret_var = Pong_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKOpenChannel ret_var = OpenChannel_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKAcceptChannel ret_var = AcceptChannel_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK((*env)->GetArrayLength(env, signature_arg) == 64);
(*env)->GetByteArrayRegion(env, signature_arg, 0, 64, signature_arg_ref.compact_form);
LDKFundingCreated ret_var = FundingCreated_new(temporary_channel_id_arg_ref, funding_txid_arg_ref, funding_output_index_arg, signature_arg_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKFundingCreated ret_var = FundingCreated_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK((*env)->GetArrayLength(env, signature_arg) == 64);
(*env)->GetByteArrayRegion(env, signature_arg, 0, 64, signature_arg_ref.compact_form);
LDKFundingSigned ret_var = FundingSigned_new(channel_id_arg_ref, signature_arg_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKFundingSigned ret_var = FundingSigned_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK((*env)->GetArrayLength(env, next_per_commitment_point_arg) == 33);
(*env)->GetByteArrayRegion(env, next_per_commitment_point_arg, 0, 33, next_per_commitment_point_arg_ref.compressed_form);
LDKFundingLocked ret_var = FundingLocked_new(channel_id_arg_ref, next_per_commitment_point_arg_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKFundingLocked ret_var = FundingLocked_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
scriptpubkey_arg_ref.data = MALLOC(scriptpubkey_arg_ref.datalen, "LDKCVec_u8Z Bytes");
(*env)->GetByteArrayRegion(env, scriptpubkey_arg, 0, scriptpubkey_arg_ref.datalen, scriptpubkey_arg_ref.data);
LDKShutdown ret_var = Shutdown_new(channel_id_arg_ref, scriptpubkey_arg_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKShutdown ret_var = Shutdown_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1new(JNIEnv *env, jclass clz, int64_t min_fee_satoshis_arg, int64_t max_fee_satoshis_arg) {
LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_new(min_fee_satoshis_arg, max_fee_satoshis_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKClosingSignedFeeRange ret_var = ClosingSigned_get_fee_range(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
fee_range_arg_conv.is_owned = (fee_range_arg & 1) || (fee_range_arg == 0);
fee_range_arg_conv = ClosingSignedFeeRange_clone(&fee_range_arg_conv);
LDKClosingSigned ret_var = ClosingSigned_new(channel_id_arg_ref, fee_satoshis_arg, signature_arg_ref, fee_range_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKClosingSigned ret_var = ClosingSigned_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKUpdateAddHTLC ret_var = UpdateAddHTLC_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK((*env)->GetArrayLength(env, payment_preimage_arg) == 32);
(*env)->GetByteArrayRegion(env, payment_preimage_arg, 0, 32, payment_preimage_arg_ref.data);
LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_new(channel_id_arg_ref, htlc_id_arg, payment_preimage_arg_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKUpdateFailHTLC ret_var = UpdateFailHTLC_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKUpdateFailMalformedHTLC ret_var = UpdateFailMalformedHTLC_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
htlc_signatures_arg_constr.data[i] = htlc_signatures_arg_conv_8_ref;
}
LDKCommitmentSigned ret_var = CommitmentSigned_new(channel_id_arg_ref, signature_arg_ref, htlc_signatures_arg_constr);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKCommitmentSigned ret_var = CommitmentSigned_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK((*env)->GetArrayLength(env, next_per_commitment_point_arg) == 33);
(*env)->GetByteArrayRegion(env, next_per_commitment_point_arg, 0, 33, next_per_commitment_point_arg_ref.compressed_form);
LDKRevokeAndACK ret_var = RevokeAndACK_new(channel_id_arg_ref, per_commitment_secret_arg_ref, next_per_commitment_point_arg_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKRevokeAndACK ret_var = RevokeAndACK_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32);
(*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
LDKUpdateFee ret_var = UpdateFee_new(channel_id_arg_ref, feerate_per_kw_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKUpdateFee ret_var = UpdateFee_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK((*env)->GetArrayLength(env, my_current_per_commitment_point_arg) == 33);
(*env)->GetByteArrayRegion(env, my_current_per_commitment_point_arg, 0, 33, my_current_per_commitment_point_arg_ref.compressed_form);
LDKDataLossProtect ret_var = DataLossProtect_new(your_last_per_commitment_secret_arg_ref, my_current_per_commitment_point_arg_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKDataLossProtect ret_var = DataLossProtect_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelReestablish ret_var = ChannelReestablish_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK((*env)->GetArrayLength(env, bitcoin_signature_arg) == 64);
(*env)->GetByteArrayRegion(env, bitcoin_signature_arg, 0, 64, bitcoin_signature_arg_ref.compact_form);
LDKAnnouncementSignatures ret_var = AnnouncementSignatures_new(channel_id_arg_ref, short_channel_id_arg, node_signature_arg_ref, bitcoin_signature_arg_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKAnnouncementSignatures ret_var = AnnouncementSignatures_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
return ret_arr;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Result_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_CResult_NetAddressu8ZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CResult_NetAddressu8ZDecodeErrorZ), "LDKCResult_CResult_NetAddressu8ZDecodeErrorZ");
- *ret_conv = Result_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_NetAddress_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = (*env)->GetArrayLength(env, ser);
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKNodeFeatures ret_var = UnsignedNodeAnnouncement_get_features(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKUnsignedNodeAnnouncement ret_var = NodeAnnouncement_get_contents(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
contents_arg_conv.is_owned = (contents_arg & 1) || (contents_arg == 0);
contents_arg_conv = UnsignedNodeAnnouncement_clone(&contents_arg_conv);
LDKNodeAnnouncement ret_var = NodeAnnouncement_new(signature_arg_ref, contents_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKNodeAnnouncement ret_var = NodeAnnouncement_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKChannelFeatures ret_var = UnsignedChannelAnnouncement_get_features(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKUnsignedChannelAnnouncement ret_var = UnsignedChannelAnnouncement_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKUnsignedChannelAnnouncement ret_var = ChannelAnnouncement_get_contents(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
contents_arg_conv.is_owned = (contents_arg & 1) || (contents_arg == 0);
contents_arg_conv = UnsignedChannelAnnouncement_clone(&contents_arg_conv);
LDKChannelAnnouncement ret_var = ChannelAnnouncement_new(node_signature_1_arg_ref, node_signature_2_arg_ref, bitcoin_signature_1_arg_ref, bitcoin_signature_2_arg_ref, contents_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelAnnouncement ret_var = ChannelAnnouncement_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKUnsignedChannelUpdate ret_var = ChannelUpdate_get_contents(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
contents_arg_conv.is_owned = (contents_arg & 1) || (contents_arg == 0);
contents_arg_conv = UnsignedChannelUpdate_clone(&contents_arg_conv);
LDKChannelUpdate ret_var = ChannelUpdate_new(signature_arg_ref, contents_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelUpdate ret_var = ChannelUpdate_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32);
(*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data);
LDKQueryChannelRange ret_var = QueryChannelRange_new(chain_hash_arg_ref, first_blocknum_arg, number_of_blocks_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKQueryChannelRange ret_var = QueryChannelRange_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
}
(*env)->ReleaseLongArrayElements(env, short_channel_ids_arg, short_channel_ids_arg_vals, 0);
LDKReplyChannelRange ret_var = ReplyChannelRange_new(chain_hash_arg_ref, first_blocknum_arg, number_of_blocks_arg, sync_complete_arg, short_channel_ids_arg_constr);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKReplyChannelRange ret_var = ReplyChannelRange_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
}
(*env)->ReleaseLongArrayElements(env, short_channel_ids_arg, short_channel_ids_arg_vals, 0);
LDKQueryShortChannelIds ret_var = QueryShortChannelIds_new(chain_hash_arg_ref, short_channel_ids_arg_constr);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKQueryShortChannelIds ret_var = QueryShortChannelIds_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32);
(*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data);
LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_new(chain_hash_arg_ref, full_information_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32);
(*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data);
LDKGossipTimestampFilter ret_var = GossipTimestampFilter_new(chain_hash_arg_ref, first_timestamp_arg, timestamp_range_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKGossipTimestampFilter ret_var = GossipTimestampFilter_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKErrorAction action_arg_conv = *(LDKErrorAction*)(action_arg_ptr);
action_arg_conv = ErrorAction_clone((LDKErrorAction*)(((uint64_t)action_arg) & ~1));
LDKLightningError ret_var = LightningError_new(err_arg_conv, action_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKLightningError ret_var = LightningError_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKCVec_UpdateAddHTLCZ ret_var = CommitmentUpdate_get_update_add_htlcs(&this_ptr_conv);
- int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t p = 0; p < ret_var.datalen; p++) {
LDKUpdateAddHTLC ret_conv_15_var = ret_var.data[p];
+ uint64_t ret_conv_15_ref = 0;
CHECK((((uint64_t)ret_conv_15_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_conv_15_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t ret_conv_15_ref = (uint64_t)ret_conv_15_var.inner;
+ ret_conv_15_ref = (uint64_t)ret_conv_15_var.inner;
if (ret_conv_15_var.is_owned) {
ret_conv_15_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKCVec_UpdateFulfillHTLCZ ret_var = CommitmentUpdate_get_update_fulfill_htlcs(&this_ptr_conv);
- int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t t = 0; t < ret_var.datalen; t++) {
LDKUpdateFulfillHTLC ret_conv_19_var = ret_var.data[t];
+ uint64_t ret_conv_19_ref = 0;
CHECK((((uint64_t)ret_conv_19_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_conv_19_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t ret_conv_19_ref = (uint64_t)ret_conv_19_var.inner;
+ ret_conv_19_ref = (uint64_t)ret_conv_19_var.inner;
if (ret_conv_19_var.is_owned) {
ret_conv_19_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKCVec_UpdateFailHTLCZ ret_var = CommitmentUpdate_get_update_fail_htlcs(&this_ptr_conv);
- int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t q = 0; q < ret_var.datalen; q++) {
LDKUpdateFailHTLC ret_conv_16_var = ret_var.data[q];
+ uint64_t ret_conv_16_ref = 0;
CHECK((((uint64_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner;
+ ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner;
if (ret_conv_16_var.is_owned) {
ret_conv_16_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKCVec_UpdateFailMalformedHTLCZ ret_var = CommitmentUpdate_get_update_fail_malformed_htlcs(&this_ptr_conv);
- int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t z = 0; z < ret_var.datalen; z++) {
LDKUpdateFailMalformedHTLC ret_conv_25_var = ret_var.data[z];
+ uint64_t ret_conv_25_ref = 0;
CHECK((((uint64_t)ret_conv_25_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_conv_25_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t ret_conv_25_ref = (uint64_t)ret_conv_25_var.inner;
+ ret_conv_25_ref = (uint64_t)ret_conv_25_var.inner;
if (ret_conv_25_var.is_owned) {
ret_conv_25_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKUpdateFee ret_var = CommitmentUpdate_get_update_fee(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKCommitmentSigned ret_var = CommitmentUpdate_get_commitment_signed(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
commitment_signed_arg_conv.is_owned = (commitment_signed_arg & 1) || (commitment_signed_arg == 0);
commitment_signed_arg_conv = CommitmentSigned_clone(&commitment_signed_arg_conv);
LDKCommitmentUpdate ret_var = CommitmentUpdate_new(update_add_htlcs_arg_constr, update_fulfill_htlcs_arg_constr, update_fail_htlcs_arg_constr, update_fail_malformed_htlcs_arg_constr, update_fee_arg_conv, commitment_signed_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKCommitmentUpdate ret_var = CommitmentUpdate_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1new(JNIEnv *env, jclass clz) {
LDKIgnoringMessageHandler ret_var = IgnoringMessageHandler_new();
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKIgnoringMessageHandler this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKMessageSendEventsProvider* ret_ret =MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
+ LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
*ret_ret = IgnoringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKIgnoringMessageHandler this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKRoutingMessageHandler* ret_ret =MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
+ LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
*ret_ret = IgnoringMessageHandler_as_RoutingMessageHandler(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKIgnoringMessageHandler this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKCustomMessageReader* ret_ret =MALLOC(sizeof(LDKCustomMessageReader), "LDKCustomMessageReader");
+ LDKCustomMessageReader* ret_ret = MALLOC(sizeof(LDKCustomMessageReader), "LDKCustomMessageReader");
*ret_ret = IgnoringMessageHandler_as_CustomMessageReader(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKIgnoringMessageHandler this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKCustomMessageHandler* ret_ret =MALLOC(sizeof(LDKCustomMessageHandler), "LDKCustomMessageHandler");
+ LDKCustomMessageHandler* ret_ret = MALLOC(sizeof(LDKCustomMessageHandler), "LDKCustomMessageHandler");
*ret_ret = IgnoringMessageHandler_as_CustomMessageHandler(&this_arg_conv);
return (uint64_t)ret_ret;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroringMessageHandler_1new(JNIEnv *env, jclass clz) {
LDKErroringMessageHandler ret_var = ErroringMessageHandler_new();
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKErroringMessageHandler this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKMessageSendEventsProvider* ret_ret =MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
+ LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
*ret_ret = ErroringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKErroringMessageHandler this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKChannelMessageHandler* ret_ret =MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
+ LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
*ret_ret = ErroringMessageHandler_as_ChannelMessageHandler(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKMessageHandler this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- uint64_t ret_ret = (uint64_t)MessageHandler_get_chan_handler(&this_ptr_conv);
+ // WARNING: This object doesn't live past this scope, needs clone!
+ uint64_t ret_ret = ((uint64_t)MessageHandler_get_chan_handler(&this_ptr_conv)) | 1;
return ret_ret;
}
LDKMessageHandler this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- uint64_t ret_ret = (uint64_t)MessageHandler_get_route_handler(&this_ptr_conv);
+ // WARNING: This object doesn't live past this scope, needs clone!
+ uint64_t ret_ret = ((uint64_t)MessageHandler_get_route_handler(&this_ptr_conv)) | 1;
return ret_ret;
}
LDKRoutingMessageHandler_JCalls_cloned(&route_handler_arg_conv);
}
LDKMessageHandler ret_var = MessageHandler_new(chan_handler_arg_conv, route_handler_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
void* orig_ptr = (void*)(((uint64_t)orig) & ~1);
if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); }
LDKSocketDescriptor* orig_conv = (LDKSocketDescriptor*)orig_ptr;
- LDKSocketDescriptor* ret_ret =MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
+ LDKSocketDescriptor* ret_ret = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
*ret_ret = SocketDescriptor_clone(orig_conv);
return (uint64_t)ret_ret;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1new(JNIEnv *env, jclass clz, jboolean no_connection_possible_arg) {
LDKPeerHandleError ret_var = PeerHandleError_new(no_connection_possible_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKPeerHandleError ret_var = PeerHandleError_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKCustomMessageHandler_JCalls_cloned(&custom_message_handler_conv);
}
LDKPeerManager ret_var = PeerManager_new(message_handler_conv, our_node_secret_ref, ephemeral_random_data_ref, logger_conv, custom_message_handler_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCVec_PublicKeyZ ret_var = PeerManager_get_peer_node_ids(&this_arg_conv);
- jobjectArray ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
+ jobjectArray ret_arr = NULL;
+ ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
;
for (size_t i = 0; i < ret_var.datalen; i++) {
int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 33, ret_var.data[i].compressed_form);
(*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr);
}
+
FREE(ret_var.data);
return ret_arr;
}
PeerManager_disconnect_by_node_id(&this_arg_conv, node_id_ref, no_connection_possible);
}
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1disconnect_1all_1peers(JNIEnv *env, jclass clz, int64_t this_arg) {
+ LDKPeerManager this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ PeerManager_disconnect_all_peers(&this_arg_conv);
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1timer_1tick_1occurred(JNIEnv *env, jclass clz, int64_t this_arg) {
LDKPeerManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
CHECK((*env)->GetArrayLength(env, broadcaster_delayed_payment_key_arg) == 33);
(*env)->GetByteArrayRegion(env, broadcaster_delayed_payment_key_arg, 0, 33, broadcaster_delayed_payment_key_arg_ref.compressed_form);
LDKTxCreationKeys ret_var = TxCreationKeys_new(per_commitment_point_arg_ref, revocation_key_arg_ref, broadcaster_htlc_key_arg_ref, countersignatory_htlc_key_arg_ref, broadcaster_delayed_payment_key_arg_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKTxCreationKeys ret_var = TxCreationKeys_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK((*env)->GetArrayLength(env, htlc_basepoint_arg) == 33);
(*env)->GetByteArrayRegion(env, htlc_basepoint_arg, 0, 33, htlc_basepoint_arg_ref.compressed_form);
LDKChannelPublicKeys ret_var = ChannelPublicKeys_new(funding_pubkey_arg_ref, revocation_basepoint_arg_ref, payment_point_arg_ref, delayed_payment_basepoint_arg_ref, htlc_basepoint_arg_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelPublicKeys ret_var = ChannelPublicKeys_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKCOption_u32Z transaction_output_index_arg_conv = *(LDKCOption_u32Z*)(transaction_output_index_arg_ptr);
transaction_output_index_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)(((uint64_t)transaction_output_index_arg) & ~1));
LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_new(offered_arg, amount_msat_arg, cltv_expiry_arg, payment_hash_arg_ref, transaction_output_index_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKChannelPublicKeys ret_var = ChannelTransactionParameters_get_holder_pubkeys(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKCounterpartyChannelTransactionParameters ret_var = ChannelTransactionParameters_get_counterparty_parameters(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKOutPoint ret_var = ChannelTransactionParameters_get_funding_outpoint(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
funding_outpoint_arg_conv.is_owned = (funding_outpoint_arg & 1) || (funding_outpoint_arg == 0);
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);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKChannelPublicKeys ret_var = CounterpartyChannelTransactionParameters_get_pubkeys(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
pubkeys_arg_conv.is_owned = (pubkeys_arg & 1) || (pubkeys_arg == 0);
pubkeys_arg_conv = ChannelPublicKeys_clone(&pubkeys_arg_conv);
LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_new(pubkeys_arg_conv, selected_contest_delay_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_holder_broadcastable(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_counterparty_broadcastable(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_broadcaster_pubkeys(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_countersignatory_pubkeys(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKOutPoint ret_var = DirectedChannelTransactionParameters_funding_outpoint(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK((*env)->GetArrayLength(env, counterparty_funding_key) == 33);
(*env)->GetByteArrayRegion(env, counterparty_funding_key, 0, 33, counterparty_funding_key_ref.compressed_form);
LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_new(commitment_tx_conv, counterparty_sig_ref, counterparty_htlc_sigs_constr, holder_funding_key_ref, counterparty_funding_key_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK((*env)->GetArrayLength(env, txid_arg) == 32);
(*env)->GetByteArrayRegion(env, txid_arg, 0, 32, txid_arg_ref.data);
LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_new(transaction_arg_ref, txid_arg_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKClosingTransaction ret_var = ClosingTransaction_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
funding_outpoint_conv.is_owned = (funding_outpoint & 1) || (funding_outpoint == 0);
funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv);
LDKClosingTransaction ret_var = ClosingTransaction_new(to_holder_value_sat, to_counterparty_value_sat, to_holder_script_ref, to_counterparty_script_ref, funding_outpoint_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKTrustedClosingTransaction ret_var = ClosingTransaction_trust(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKCommitmentTransaction ret_var = CommitmentTransaction_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKTrustedCommitmentTransaction ret_var = CommitmentTransaction_trust(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKBuiltCommitmentTransaction ret_var = TrustedCommitmentTransaction_built_transaction(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKTxCreationKeys ret_var = TrustedCommitmentTransaction_keys(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKInitFeatures ret_var = InitFeatures_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKNodeFeatures ret_var = NodeFeatures_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelFeatures ret_var = ChannelFeatures_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKInvoiceFeatures ret_var = InvoiceFeatures_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
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;
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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1known(JNIEnv *env, jclass clz) {
LDKInitFeatures ret_var = InitFeatures_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1empty(JNIEnv *env, jclass clz) {
LDKNodeFeatures ret_var = NodeFeatures_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1known(JNIEnv *env, jclass clz) {
LDKNodeFeatures ret_var = NodeFeatures_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1empty(JNIEnv *env, jclass clz) {
LDKChannelFeatures ret_var = ChannelFeatures_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1known(JNIEnv *env, jclass clz) {
LDKChannelFeatures ret_var = ChannelFeatures_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1empty(JNIEnv *env, jclass clz) {
LDKInvoiceFeatures ret_var = InvoiceFeatures_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1known(JNIEnv *env, jclass clz) {
LDKInvoiceFeatures ret_var = InvoiceFeatures_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKShutdownScript ret_var = ShutdownScript_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
script_arg_ref.data = MALLOC(script_arg_ref.datalen, "LDKCVec_u8Z Bytes");
(*env)->GetByteArrayRegion(env, script_arg, 0, script_arg_ref.datalen, script_arg_ref.data);
LDKInvalidShutdownScript ret_var = InvalidShutdownScript_new(script_arg_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKInvalidShutdownScript ret_var = InvalidShutdownScript_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
(*env)->GetByteArrayRegion(env, pubkey_hash, 0, 20, pubkey_hash_arr);
unsigned char (*pubkey_hash_ref)[20] = &pubkey_hash_arr;
LDKShutdownScript ret_var = ShutdownScript_new_p2wpkh(pubkey_hash_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
(*env)->GetByteArrayRegion(env, script_hash, 0, 32, script_hash_arr);
unsigned char (*script_hash_ref)[32] = &script_hash_arr;
LDKShutdownScript ret_var = ShutdownScript_new_p2wsh(script_hash_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
void* orig_ptr = (void*)(((uint64_t)orig) & ~1);
if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); }
LDKType* orig_conv = (LDKType*)orig_ptr;
- LDKType* ret_ret =MALLOC(sizeof(LDKType), "LDKType");
+ LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType");
*ret_ret = Type_clone(orig_conv);
return (uint64_t)ret_ret;
}
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);
+ 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.
+ 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;
+ 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));
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKNodeId ret_var = NodeId_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK((*env)->GetArrayLength(env, pubkey) == 33);
(*env)->GetByteArrayRegion(env, pubkey, 0, 33, pubkey_ref.compressed_form);
LDKNodeId ret_var = NodeId_from_pubkey(pubkey_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKNetworkGraph ret_var = NetworkGraph_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKNetGraphMsgHandler this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKEventHandler* ret_ret =MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
+ LDKEventHandler* ret_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
*ret_ret = NetGraphMsgHandler_as_EventHandler(&this_arg_conv);
return (uint64_t)ret_ret;
}
NetGraphMsgHandler_free(this_obj_conv);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1get_1network_1graph(JNIEnv *env, jclass clz, int64_t this_ptr) {
- LDKNetGraphMsgHandler this_ptr_conv;
- this_ptr_conv.inner = (void*)(this_ptr & (~1));
- this_ptr_conv.is_owned = false;
- LDKNetworkGraph ret_var = NetGraphMsgHandler_get_network_graph(&this_ptr_conv);
- 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.
- uint64_t 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_NetGraphMsgHandler_1set_1network_1graph(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
- LDKNetGraphMsgHandler this_ptr_conv;
- this_ptr_conv.inner = (void*)(this_ptr & (~1));
- this_ptr_conv.is_owned = false;
- LDKNetworkGraph val_conv;
- val_conv.inner = (void*)(val & (~1));
- val_conv.is_owned = (val & 1) || (val == 0);
- val_conv = NetworkGraph_clone(&val_conv);
- NetGraphMsgHandler_set_network_graph(&this_ptr_conv, val_conv);
-}
-
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1new(JNIEnv *env, jclass clz, int64_t network_graph, int64_t chain_access, int64_t logger) {
LDKNetworkGraph network_graph_conv;
network_graph_conv.inner = (void*)(network_graph & (~1));
- network_graph_conv.is_owned = (network_graph & 1) || (network_graph == 0);
- network_graph_conv = NetworkGraph_clone(&network_graph_conv);
+ network_graph_conv.is_owned = false;
void* chain_access_ptr = (void*)(((uint64_t)chain_access) & ~1);
CHECK_ACCESS(chain_access_ptr);
LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKLogger_JCalls_cloned(&logger_conv);
}
- LDKNetGraphMsgHandler ret_var = NetGraphMsgHandler_new(network_graph_conv, chain_access_conv, logger_conv);
+ LDKNetGraphMsgHandler ret_var = NetGraphMsgHandler_new(&network_graph_conv, chain_access_conv, logger_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKNetGraphMsgHandler this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKRoutingMessageHandler* ret_ret =MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
+ LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
*ret_ret = NetGraphMsgHandler_as_RoutingMessageHandler(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKNetGraphMsgHandler this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKMessageSendEventsProvider* ret_ret =MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
+ LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
*ret_ret = NetGraphMsgHandler_as_MessageSendEventsProvider(&this_arg_conv);
return (uint64_t)ret_ret;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKRoutingFees ret_var = DirectionalChannelInfo_get_fees(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKChannelUpdate ret_var = DirectionalChannelInfo_get_last_update_message(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
last_update_message_arg_conv.is_owned = (last_update_message_arg & 1) || (last_update_message_arg == 0);
last_update_message_arg_conv = ChannelUpdate_clone(&last_update_message_arg_conv);
LDKDirectionalChannelInfo ret_var = DirectionalChannelInfo_new(last_update_arg, enabled_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg_conv, fees_arg_conv, last_update_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKDirectionalChannelInfo ret_var = DirectionalChannelInfo_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKChannelFeatures ret_var = ChannelInfo_get_features(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKNodeId ret_var = ChannelInfo_get_node_one(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKDirectionalChannelInfo ret_var = ChannelInfo_get_one_to_two(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKNodeId ret_var = ChannelInfo_get_node_two(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKDirectionalChannelInfo ret_var = ChannelInfo_get_two_to_one(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKChannelAnnouncement ret_var = ChannelInfo_get_announcement_message(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
announcement_message_arg_conv.is_owned = (announcement_message_arg & 1) || (announcement_message_arg == 0);
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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelInfo ret_var = ChannelInfo_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1new(JNIEnv *env, jclass clz, int32_t base_msat_arg, int32_t proportional_millionths_arg) {
LDKRoutingFees ret_var = RoutingFees_new(base_msat_arg, proportional_millionths_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKRoutingFees ret_var = RoutingFees_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKNodeFeatures ret_var = NodeAnnouncementInfo_get_features(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKNodeAnnouncement ret_var = NodeAnnouncementInfo_get_announcement_message(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
announcement_message_arg_conv.is_owned = (announcement_message_arg & 1) || (announcement_message_arg == 0);
announcement_message_arg_conv = NodeAnnouncement_clone(&announcement_message_arg_conv);
LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_new(features_arg_conv, last_update_arg, rgb_arg_ref, alias_arg_ref, addresses_arg_constr, 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKRoutingFees ret_var = NodeInfo_get_lowest_inbound_channel_fees(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKNodeAnnouncementInfo ret_var = NodeInfo_get_announcement_info(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
announcement_info_arg_conv.is_owned = (announcement_info_arg & 1) || (announcement_info_arg == 0);
announcement_info_arg_conv = NodeAnnouncementInfo_clone(&announcement_info_arg_conv);
LDKNodeInfo ret_var = NodeInfo_new(channels_arg_constr, lowest_inbound_channel_fees_arg_conv, announcement_info_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKNodeInfo ret_var = NodeInfo_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK((*env)->GetArrayLength(env, genesis_hash) == 32);
(*env)->GetByteArrayRegion(env, genesis_hash, 0, 32, genesis_hash_ref.data);
LDKNetworkGraph ret_var = NetworkGraph_new(genesis_hash_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKReadOnlyNetworkGraph ret_var = NetworkGraph_read_only(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKNodeFeatures ret_var = RouteHop_get_node_features(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKChannelFeatures ret_var = RouteHop_get_channel_features(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
channel_features_arg_conv.is_owned = (channel_features_arg & 1) || (channel_features_arg == 0);
channel_features_arg_conv = ChannelFeatures_clone(&channel_features_arg_conv);
LDKRouteHop ret_var = RouteHop_new(pubkey_arg_ref, node_features_arg_conv, short_channel_id_arg, channel_features_arg_conv, fee_msat_arg, cltv_expiry_delta_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKRouteHop ret_var = RouteHop_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKCVec_CVec_RouteHopZZ ret_var = Route_get_paths(&this_ptr_conv);
- jobjectArray ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_J_clz, NULL);
+ jobjectArray ret_arr = NULL;
+ ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_J_clz, NULL);
;
for (size_t m = 0; m < ret_var.datalen; m++) {
LDKCVec_RouteHopZ ret_conv_12_var = ret_var.data[m];
- int64_tArray ret_conv_12_arr = (*env)->NewLongArray(env, ret_conv_12_var.datalen);
+ int64_tArray ret_conv_12_arr = NULL;
+ ret_conv_12_arr = (*env)->NewLongArray(env, ret_conv_12_var.datalen);
int64_t *ret_conv_12_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_conv_12_arr, NULL);
for (size_t k = 0; k < ret_conv_12_var.datalen; k++) {
LDKRouteHop ret_conv_12_conv_10_var = ret_conv_12_var.data[k];
+ uint64_t ret_conv_12_conv_10_ref = 0;
CHECK((((uint64_t)ret_conv_12_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_conv_12_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t ret_conv_12_conv_10_ref = (uint64_t)ret_conv_12_conv_10_var.inner;
+ ret_conv_12_conv_10_ref = (uint64_t)ret_conv_12_conv_10_var.inner;
if (ret_conv_12_conv_10_var.is_owned) {
ret_conv_12_conv_10_ref |= 1;
}
FREE(ret_conv_12_var.data);
(*env)->SetObjectArrayElement(env, ret_arr, m, ret_conv_12_arr);
}
+
FREE(ret_var.data);
return ret_arr;
}
Route_set_paths(&this_ptr_conv, val_constr);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1new(JNIEnv *env, jclass clz, jobjectArray paths_arg) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1get_1payee(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKRoute this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKPayee ret_var = Route_get_payee(&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.
+ 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_Route_1set_1payee(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
+ LDKRoute this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKPayee val_conv;
+ val_conv.inner = (void*)(val & (~1));
+ val_conv.is_owned = (val & 1) || (val == 0);
+ val_conv = Payee_clone(&val_conv);
+ Route_set_payee(&this_ptr_conv, val_conv);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1new(JNIEnv *env, jclass clz, jobjectArray paths_arg, int64_t payee_arg) {
LDKCVec_CVec_RouteHopZZ paths_arg_constr;
paths_arg_constr.datalen = (*env)->GetArrayLength(env, paths_arg);
if (paths_arg_constr.datalen > 0)
paths_arg_constr.data = MALLOC(paths_arg_constr.datalen * sizeof(LDKCVec_RouteHopZ), "LDKCVec_CVec_RouteHopZZ Elements");
else
- paths_arg_constr.data = NULL;
- for (size_t m = 0; m < paths_arg_constr.datalen; m++) {
- int64_tArray paths_arg_conv_12 = (*env)->GetObjectArrayElement(env, paths_arg, m);
- LDKCVec_RouteHopZ paths_arg_conv_12_constr;
- paths_arg_conv_12_constr.datalen = (*env)->GetArrayLength(env, paths_arg_conv_12);
- if (paths_arg_conv_12_constr.datalen > 0)
- paths_arg_conv_12_constr.data = MALLOC(paths_arg_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
- else
- paths_arg_conv_12_constr.data = NULL;
- int64_t* paths_arg_conv_12_vals = (*env)->GetLongArrayElements (env, paths_arg_conv_12, NULL);
- for (size_t k = 0; k < paths_arg_conv_12_constr.datalen; k++) {
- int64_t paths_arg_conv_12_conv_10 = paths_arg_conv_12_vals[k];
- LDKRouteHop paths_arg_conv_12_conv_10_conv;
- paths_arg_conv_12_conv_10_conv.inner = (void*)(paths_arg_conv_12_conv_10 & (~1));
- paths_arg_conv_12_conv_10_conv.is_owned = (paths_arg_conv_12_conv_10 & 1) || (paths_arg_conv_12_conv_10 == 0);
- paths_arg_conv_12_conv_10_conv = RouteHop_clone(&paths_arg_conv_12_conv_10_conv);
- paths_arg_conv_12_constr.data[k] = paths_arg_conv_12_conv_10_conv;
- }
- (*env)->ReleaseLongArrayElements(env, paths_arg_conv_12, paths_arg_conv_12_vals, 0);
- paths_arg_constr.data[m] = paths_arg_conv_12_constr;
+ paths_arg_constr.data = NULL;
+ for (size_t m = 0; m < paths_arg_constr.datalen; m++) {
+ int64_tArray paths_arg_conv_12 = (*env)->GetObjectArrayElement(env, paths_arg, m);
+ LDKCVec_RouteHopZ paths_arg_conv_12_constr;
+ paths_arg_conv_12_constr.datalen = (*env)->GetArrayLength(env, paths_arg_conv_12);
+ if (paths_arg_conv_12_constr.datalen > 0)
+ paths_arg_conv_12_constr.data = MALLOC(paths_arg_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
+ else
+ paths_arg_conv_12_constr.data = NULL;
+ int64_t* paths_arg_conv_12_vals = (*env)->GetLongArrayElements (env, paths_arg_conv_12, NULL);
+ for (size_t k = 0; k < paths_arg_conv_12_constr.datalen; k++) {
+ int64_t paths_arg_conv_12_conv_10 = paths_arg_conv_12_vals[k];
+ LDKRouteHop paths_arg_conv_12_conv_10_conv;
+ paths_arg_conv_12_conv_10_conv.inner = (void*)(paths_arg_conv_12_conv_10 & (~1));
+ paths_arg_conv_12_conv_10_conv.is_owned = (paths_arg_conv_12_conv_10 & 1) || (paths_arg_conv_12_conv_10 == 0);
+ paths_arg_conv_12_conv_10_conv = RouteHop_clone(&paths_arg_conv_12_conv_10_conv);
+ paths_arg_conv_12_constr.data[k] = paths_arg_conv_12_conv_10_conv;
+ }
+ (*env)->ReleaseLongArrayElements(env, paths_arg_conv_12, paths_arg_conv_12_vals, 0);
+ paths_arg_constr.data[m] = paths_arg_conv_12_constr;
+ }
+ LDKPayee payee_arg_conv;
+ payee_arg_conv.inner = (void*)(payee_arg & (~1));
+ payee_arg_conv.is_owned = (payee_arg & 1) || (payee_arg == 0);
+ payee_arg_conv = Payee_clone(&payee_arg_conv);
+ LDKRoute ret_var = Route_new(paths_arg_constr, payee_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.
+ 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_Route_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKRoute orig_conv;
+ orig_conv.inner = (void*)(orig & (~1));
+ orig_conv.is_owned = false;
+ LDKRoute ret_var = Route_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.
+ 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_Route_1hash(JNIEnv *env, jclass clz, int64_t o) {
+ LDKRoute o_conv;
+ o_conv.inner = (void*)(o & (~1));
+ o_conv.is_owned = false;
+ int64_t ret_val = Route_hash(&o_conv);
+ return ret_val;
+}
+
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Route_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKRoute a_conv;
+ a_conv.inner = (void*)(a & (~1));
+ a_conv.is_owned = false;
+ LDKRoute b_conv;
+ b_conv.inner = (void*)(b & (~1));
+ b_conv.is_owned = false;
+ jboolean ret_val = Route_eq(&a_conv, &b_conv);
+ return ret_val;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1get_1total_1fees(JNIEnv *env, jclass clz, int64_t this_arg) {
+ LDKRoute this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ int64_t ret_val = Route_get_total_fees(&this_arg_conv);
+ return ret_val;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1get_1total_1amount(JNIEnv *env, jclass clz, int64_t this_arg) {
+ LDKRoute this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ int64_t ret_val = Route_get_total_amount(&this_arg_conv);
+ return ret_val;
+}
+
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Route_1write(JNIEnv *env, jclass clz, int64_t obj) {
+ LDKRoute obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z ret_var = Route_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_Route_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_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
+ *ret_conv = Route_read(ser_ref);
+ (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
+ LDKRouteParameters this_obj_conv;
+ this_obj_conv.inner = (void*)(this_obj & (~1));
+ this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+ RouteParameters_free(this_obj_conv);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1get_1payee(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKRouteParameters this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKPayee ret_var = RouteParameters_get_payee(&this_ptr_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.
+ 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_RouteParameters_1set_1payee(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
+ LDKRouteParameters this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKPayee val_conv;
+ val_conv.inner = (void*)(val & (~1));
+ val_conv.is_owned = (val & 1) || (val == 0);
+ val_conv = Payee_clone(&val_conv);
+ RouteParameters_set_payee(&this_ptr_conv, val_conv);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1get_1final_1value_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKRouteParameters this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ int64_t ret_val = RouteParameters_get_final_value_msat(&this_ptr_conv);
+ return ret_val;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1set_1final_1value_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
+ LDKRouteParameters this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ RouteParameters_set_final_value_msat(&this_ptr_conv, val);
+}
+
+JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1get_1final_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKRouteParameters this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ int32_t ret_val = RouteParameters_get_final_cltv_expiry_delta(&this_ptr_conv);
+ return ret_val;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1set_1final_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
+ LDKRouteParameters this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ RouteParameters_set_final_cltv_expiry_delta(&this_ptr_conv, val);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1new(JNIEnv *env, jclass clz, int64_t payee_arg, int64_t final_value_msat_arg, int32_t final_cltv_expiry_delta_arg) {
+ LDKPayee payee_arg_conv;
+ payee_arg_conv.inner = (void*)(payee_arg & (~1));
+ payee_arg_conv.is_owned = (payee_arg & 1) || (payee_arg == 0);
+ payee_arg_conv = Payee_clone(&payee_arg_conv);
+ LDKRouteParameters ret_var = RouteParameters_new(payee_arg_conv, final_value_msat_arg, final_cltv_expiry_delta_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.
+ 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_RouteParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKRouteParameters orig_conv;
+ orig_conv.inner = (void*)(orig & (~1));
+ orig_conv.is_owned = false;
+ LDKRouteParameters ret_var = RouteParameters_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.
+ 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_RouteParameters_1write(JNIEnv *env, jclass clz, int64_t obj) {
+ LDKRouteParameters obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z ret_var = RouteParameters_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_RouteParameters_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_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
+ *ret_conv = RouteParameters_read(ser_ref);
+ (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payee_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
+ LDKPayee this_obj_conv;
+ this_obj_conv.inner = (void*)(this_obj & (~1));
+ this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+ Payee_free(this_obj_conv);
+}
+
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Payee_1get_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKPayee this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, Payee_get_pubkey(&this_ptr_conv).compressed_form);
+ return ret_arr;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payee_1set_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
+ LDKPayee this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKPublicKey val_ref;
+ CHECK((*env)->GetArrayLength(env, val) == 33);
+ (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
+ Payee_set_pubkey(&this_ptr_conv, val_ref);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKPayee this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKInvoiceFeatures ret_var = Payee_get_features(&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.
+ 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_Payee_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
+ LDKPayee this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKInvoiceFeatures val_conv;
+ val_conv.inner = (void*)(val & (~1));
+ val_conv.is_owned = (val & 1) || (val == 0);
+ val_conv = InvoiceFeatures_clone(&val_conv);
+ Payee_set_features(&this_ptr_conv, val_conv);
+}
+
+JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Payee_1get_1route_1hints(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKPayee this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKCVec_RouteHintZ ret_var = Payee_get_route_hints(&this_ptr_conv);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
+ for (size_t l = 0; l < ret_var.datalen; l++) {
+ LDKRouteHint ret_conv_11_var = ret_var.data[l];
+ uint64_t ret_conv_11_ref = 0;
+ CHECK((((uint64_t)ret_conv_11_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&ret_conv_11_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ ret_conv_11_ref = (uint64_t)ret_conv_11_var.inner;
+ if (ret_conv_11_var.is_owned) {
+ ret_conv_11_ref |= 1;
+ }
+ ret_arr_ptr[l] = ret_conv_11_ref;
+ }
+ (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
+ FREE(ret_var.data);
+ return ret_arr;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payee_1set_1route_1hints(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
+ LDKPayee this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKCVec_RouteHintZ val_constr;
+ val_constr.datalen = (*env)->GetArrayLength(env, val);
+ if (val_constr.datalen > 0)
+ val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
+ else
+ val_constr.data = NULL;
+ int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
+ for (size_t l = 0; l < val_constr.datalen; l++) {
+ int64_t val_conv_11 = val_vals[l];
+ LDKRouteHint val_conv_11_conv;
+ val_conv_11_conv.inner = (void*)(val_conv_11 & (~1));
+ val_conv_11_conv.is_owned = (val_conv_11 & 1) || (val_conv_11 == 0);
+ val_conv_11_conv = RouteHint_clone(&val_conv_11_conv);
+ val_constr.data[l] = val_conv_11_conv;
+ }
+ (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
+ Payee_set_route_hints(&this_ptr_conv, val_constr);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1get_1expiry_1time(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKPayee this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
+ *ret_copy = Payee_get_expiry_time(&this_ptr_conv);
+ uint64_t ret_ref = (uint64_t)ret_copy;
+ return ret_ref;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payee_1set_1expiry_1time(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
+ LDKPayee this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
+ val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)val) & ~1));
+ Payee_set_expiry_time(&this_ptr_conv, val_conv);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1new(JNIEnv *env, jclass clz, int8_tArray pubkey_arg, int64_t features_arg, int64_tArray route_hints_arg, int64_t expiry_time_arg) {
+ LDKPublicKey pubkey_arg_ref;
+ CHECK((*env)->GetArrayLength(env, pubkey_arg) == 33);
+ (*env)->GetByteArrayRegion(env, pubkey_arg, 0, 33, pubkey_arg_ref.compressed_form);
+ LDKInvoiceFeatures features_arg_conv;
+ features_arg_conv.inner = (void*)(features_arg & (~1));
+ features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0);
+ features_arg_conv = InvoiceFeatures_clone(&features_arg_conv);
+ LDKCVec_RouteHintZ route_hints_arg_constr;
+ route_hints_arg_constr.datalen = (*env)->GetArrayLength(env, route_hints_arg);
+ if (route_hints_arg_constr.datalen > 0)
+ route_hints_arg_constr.data = MALLOC(route_hints_arg_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
+ else
+ route_hints_arg_constr.data = NULL;
+ int64_t* route_hints_arg_vals = (*env)->GetLongArrayElements (env, route_hints_arg, NULL);
+ for (size_t l = 0; l < route_hints_arg_constr.datalen; l++) {
+ int64_t route_hints_arg_conv_11 = route_hints_arg_vals[l];
+ LDKRouteHint route_hints_arg_conv_11_conv;
+ route_hints_arg_conv_11_conv.inner = (void*)(route_hints_arg_conv_11 & (~1));
+ route_hints_arg_conv_11_conv.is_owned = (route_hints_arg_conv_11 & 1) || (route_hints_arg_conv_11 == 0);
+ route_hints_arg_conv_11_conv = RouteHint_clone(&route_hints_arg_conv_11_conv);
+ route_hints_arg_constr.data[l] = route_hints_arg_conv_11_conv;
}
- LDKRoute ret_var = Route_new(paths_arg_constr);
+ (*env)->ReleaseLongArrayElements(env, route_hints_arg, route_hints_arg_vals, 0);
+ void* expiry_time_arg_ptr = (void*)(((uint64_t)expiry_time_arg) & ~1);
+ CHECK_ACCESS(expiry_time_arg_ptr);
+ LDKCOption_u64Z expiry_time_arg_conv = *(LDKCOption_u64Z*)(expiry_time_arg_ptr);
+ expiry_time_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)expiry_time_arg) & ~1));
+ LDKPayee ret_var = Payee_new(pubkey_arg_ref, features_arg_conv, route_hints_arg_constr, expiry_time_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ 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_Route_1clone(JNIEnv *env, jclass clz, int64_t orig) {
- LDKRoute orig_conv;
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKPayee orig_conv;
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
- LDKRoute ret_var = Route_clone(&orig_conv);
+ LDKPayee ret_var = Payee_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ 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_Route_1hash(JNIEnv *env, jclass clz, int64_t o) {
- LDKRoute o_conv;
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1hash(JNIEnv *env, jclass clz, int64_t o) {
+ LDKPayee o_conv;
o_conv.inner = (void*)(o & (~1));
o_conv.is_owned = false;
- int64_t ret_val = Route_hash(&o_conv);
+ int64_t ret_val = Payee_hash(&o_conv);
return ret_val;
}
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Route_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
- LDKRoute a_conv;
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Payee_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKPayee a_conv;
a_conv.inner = (void*)(a & (~1));
a_conv.is_owned = false;
- LDKRoute b_conv;
+ LDKPayee b_conv;
b_conv.inner = (void*)(b & (~1));
b_conv.is_owned = false;
- jboolean ret_val = Route_eq(&a_conv, &b_conv);
- return ret_val;
-}
-
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1get_1total_1fees(JNIEnv *env, jclass clz, int64_t this_arg) {
- LDKRoute this_arg_conv;
- this_arg_conv.inner = (void*)(this_arg & (~1));
- this_arg_conv.is_owned = false;
- int64_t ret_val = Route_get_total_fees(&this_arg_conv);
- return ret_val;
-}
-
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1get_1total_1amount(JNIEnv *env, jclass clz, int64_t this_arg) {
- LDKRoute this_arg_conv;
- this_arg_conv.inner = (void*)(this_arg & (~1));
- this_arg_conv.is_owned = false;
- int64_t ret_val = Route_get_total_amount(&this_arg_conv);
+ jboolean ret_val = Payee_eq(&a_conv, &b_conv);
return ret_val;
}
-JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Route_1write(JNIEnv *env, jclass clz, int64_t obj) {
- LDKRoute obj_conv;
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Payee_1write(JNIEnv *env, jclass clz, int64_t obj) {
+ LDKPayee obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z ret_var = Route_write(&obj_conv);
+ LDKCVec_u8Z ret_var = Payee_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_Route_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_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_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
- *ret_conv = Route_read(ser_ref);
+ LDKCResult_PayeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeeDecodeErrorZ), "LDKCResult_PayeeDecodeErrorZ");
+ *ret_conv = Payee_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_Payee_1from_1node_1id(JNIEnv *env, jclass clz, int8_tArray pubkey) {
+ LDKPublicKey pubkey_ref;
+ CHECK((*env)->GetArrayLength(env, pubkey) == 33);
+ (*env)->GetByteArrayRegion(env, pubkey, 0, 33, pubkey_ref.compressed_form);
+ LDKPayee ret_var = Payee_from_node_id(pubkey_ref);
+ 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.
+ 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_Payee_1for_1keysend(JNIEnv *env, jclass clz, int8_tArray pubkey) {
+ LDKPublicKey pubkey_ref;
+ CHECK((*env)->GetArrayLength(env, pubkey) == 33);
+ (*env)->GetByteArrayRegion(env, pubkey, 0, 33, pubkey_ref.compressed_form);
+ LDKPayee ret_var = Payee_for_keysend(pubkey_ref);
+ 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.
+ 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_RouteHint_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKRouteHint this_obj_conv;
this_obj_conv.inner = (void*)(this_obj & (~1));
RouteHint_free(this_obj_conv);
}
+JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKRouteHint this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKCVec_RouteHintHopZ ret_var = RouteHint_get_a(&this_ptr_conv);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
+ for (size_t o = 0; o < ret_var.datalen; o++) {
+ LDKRouteHintHop ret_conv_14_var = ret_var.data[o];
+ uint64_t ret_conv_14_ref = 0;
+ CHECK((((uint64_t)ret_conv_14_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&ret_conv_14_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ ret_conv_14_ref = (uint64_t)ret_conv_14_var.inner;
+ if (ret_conv_14_var.is_owned) {
+ ret_conv_14_ref |= 1;
+ }
+ ret_arr_ptr[o] = ret_conv_14_ref;
+ }
+ (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
+ FREE(ret_var.data);
+ return ret_arr;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
+ LDKRouteHint this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKCVec_RouteHintHopZ val_constr;
+ val_constr.datalen = (*env)->GetArrayLength(env, val);
+ if (val_constr.datalen > 0)
+ val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements");
+ else
+ val_constr.data = NULL;
+ int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
+ for (size_t o = 0; o < val_constr.datalen; o++) {
+ int64_t val_conv_14 = val_vals[o];
+ LDKRouteHintHop val_conv_14_conv;
+ val_conv_14_conv.inner = (void*)(val_conv_14 & (~1));
+ val_conv_14_conv.is_owned = (val_conv_14 & 1) || (val_conv_14 == 0);
+ val_conv_14_conv = RouteHintHop_clone(&val_conv_14_conv);
+ val_constr.data[o] = val_conv_14_conv;
+ }
+ (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
+ RouteHint_set_a(&this_ptr_conv, val_constr);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1new(JNIEnv *env, jclass clz, int64_tArray a_arg) {
+ LDKCVec_RouteHintHopZ a_arg_constr;
+ a_arg_constr.datalen = (*env)->GetArrayLength(env, a_arg);
+ if (a_arg_constr.datalen > 0)
+ a_arg_constr.data = MALLOC(a_arg_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements");
+ else
+ a_arg_constr.data = NULL;
+ int64_t* a_arg_vals = (*env)->GetLongArrayElements (env, a_arg, NULL);
+ for (size_t o = 0; o < a_arg_constr.datalen; o++) {
+ int64_t a_arg_conv_14 = a_arg_vals[o];
+ LDKRouteHintHop a_arg_conv_14_conv;
+ a_arg_conv_14_conv.inner = (void*)(a_arg_conv_14 & (~1));
+ a_arg_conv_14_conv.is_owned = (a_arg_conv_14 & 1) || (a_arg_conv_14 == 0);
+ a_arg_conv_14_conv = RouteHintHop_clone(&a_arg_conv_14_conv);
+ a_arg_constr.data[o] = a_arg_conv_14_conv;
+ }
+ (*env)->ReleaseLongArrayElements(env, a_arg, a_arg_vals, 0);
+ LDKRouteHint ret_var = RouteHint_new(a_arg_constr);
+ 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.
+ 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_RouteHint_1clone(JNIEnv *env, jclass clz, int64_t orig) {
LDKRouteHint orig_conv;
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKRouteHint ret_var = RouteHint_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
return ret_val;
}
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHint_1write(JNIEnv *env, jclass clz, int64_t obj) {
+ LDKRouteHint obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z ret_var = RouteHint_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_RouteHint_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_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
+ *ret_conv = RouteHint_read(ser_ref);
+ (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
+ return (uint64_t)ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKRouteHintHop this_obj_conv;
this_obj_conv.inner = (void*)(this_obj & (~1));
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKRoutingFees ret_var = RouteHintHop_get_fees(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKCOption_u64Z htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_maximum_msat_arg_ptr);
htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)htlc_maximum_msat_arg) & ~1));
LDKRouteHintHop ret_var = RouteHintHop_new(src_node_id_arg_ref, short_channel_id_arg, fees_arg_conv, cltv_expiry_delta_arg, htlc_minimum_msat_arg_conv, htlc_maximum_msat_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKRouteHintHop ret_var = RouteHintHop_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
return ret_val;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_get_1keysend_1route(JNIEnv *env, jclass clz, int8_tArray our_node_pubkey, int64_t network, int8_tArray payee, int64_tArray first_hops, int64_tArray last_hops, int64_t final_value_msat, int32_t final_cltv, int64_t logger, int64_t scorer) {
- LDKPublicKey our_node_pubkey_ref;
- CHECK((*env)->GetArrayLength(env, our_node_pubkey) == 33);
- (*env)->GetByteArrayRegion(env, our_node_pubkey, 0, 33, our_node_pubkey_ref.compressed_form);
- LDKNetworkGraph network_conv;
- network_conv.inner = (void*)(network & (~1));
- network_conv.is_owned = false;
- LDKPublicKey payee_ref;
- CHECK((*env)->GetArrayLength(env, payee) == 33);
- (*env)->GetByteArrayRegion(env, payee, 0, 33, payee_ref.compressed_form);
- LDKCVec_ChannelDetailsZ first_hops_constr;
- LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL;
- if (first_hops != NULL) {
- first_hops_constr.datalen = (*env)->GetArrayLength(env, first_hops);
- if (first_hops_constr.datalen > 0)
- first_hops_constr.data = MALLOC(first_hops_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
- else
- first_hops_constr.data = NULL;
- int64_t* first_hops_vals = (*env)->GetLongArrayElements (env, first_hops, NULL);
- for (size_t q = 0; q < first_hops_constr.datalen; q++) {
- int64_t first_hops_conv_16 = first_hops_vals[q];
- LDKChannelDetails first_hops_conv_16_conv;
- first_hops_conv_16_conv.inner = (void*)(first_hops_conv_16 & (~1));
- first_hops_conv_16_conv.is_owned = (first_hops_conv_16 & 1) || (first_hops_conv_16 == 0);
- first_hops_constr.data[q] = first_hops_conv_16_conv;
- }
- (*env)->ReleaseLongArrayElements(env, first_hops, first_hops_vals, 0);
- first_hops_ptr = &first_hops_constr;
- }
- LDKCVec_RouteHintZ last_hops_constr;
- last_hops_constr.datalen = (*env)->GetArrayLength(env, last_hops);
- if (last_hops_constr.datalen > 0)
- last_hops_constr.data = MALLOC(last_hops_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
- else
- last_hops_constr.data = NULL;
- int64_t* last_hops_vals = (*env)->GetLongArrayElements (env, last_hops, NULL);
- for (size_t l = 0; l < last_hops_constr.datalen; l++) {
- int64_t last_hops_conv_11 = last_hops_vals[l];
- LDKRouteHint last_hops_conv_11_conv;
- last_hops_conv_11_conv.inner = (void*)(last_hops_conv_11 & (~1));
- last_hops_conv_11_conv.is_owned = (last_hops_conv_11 & 1) || (last_hops_conv_11 == 0);
- last_hops_conv_11_conv = RouteHint_clone(&last_hops_conv_11_conv);
- last_hops_constr.data[l] = last_hops_conv_11_conv;
- }
- (*env)->ReleaseLongArrayElements(env, last_hops, last_hops_vals, 0);
- void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
- CHECK_ACCESS(logger_ptr);
- LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
- if (logger_conv.free == LDKLogger_JCalls_free) {
- // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
- LDKLogger_JCalls_cloned(&logger_conv);
- }
- void* scorer_ptr = (void*)(((uint64_t)scorer) & ~1);
- 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 = get_keysend_route(our_node_pubkey_ref, &network_conv, payee_ref, first_hops_ptr, last_hops_constr, final_value_msat, final_cltv, logger_conv, scorer_conv);
- if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1write(JNIEnv *env, jclass clz, int64_t obj) {
+ LDKRouteHintHop obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z ret_var = RouteHintHop_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_RouteHintHop_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_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
+ *ret_conv = RouteHintHop_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_get_1route(JNIEnv *env, jclass clz, int8_tArray our_node_pubkey, int64_t network, int8_tArray payee, int64_t payee_features, int64_tArray first_hops, int64_tArray last_hops, int64_t final_value_msat, int32_t final_cltv, int64_t logger, int64_t scorer) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_find_1route(JNIEnv *env, jclass clz, int8_tArray our_node_pubkey, int64_t params, int64_t network, int64_tArray first_hops, int64_t logger, int64_t scorer) {
LDKPublicKey our_node_pubkey_ref;
CHECK((*env)->GetArrayLength(env, our_node_pubkey) == 33);
(*env)->GetByteArrayRegion(env, our_node_pubkey, 0, 33, our_node_pubkey_ref.compressed_form);
+ LDKRouteParameters params_conv;
+ params_conv.inner = (void*)(params & (~1));
+ params_conv.is_owned = false;
LDKNetworkGraph network_conv;
network_conv.inner = (void*)(network & (~1));
network_conv.is_owned = false;
- LDKPublicKey payee_ref;
- CHECK((*env)->GetArrayLength(env, payee) == 33);
- (*env)->GetByteArrayRegion(env, payee, 0, 33, payee_ref.compressed_form);
- LDKInvoiceFeatures payee_features_conv;
- payee_features_conv.inner = (void*)(payee_features & (~1));
- payee_features_conv.is_owned = (payee_features & 1) || (payee_features == 0);
- payee_features_conv = InvoiceFeatures_clone(&payee_features_conv);
LDKCVec_ChannelDetailsZ first_hops_constr;
LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL;
if (first_hops != NULL) {
(*env)->ReleaseLongArrayElements(env, first_hops, first_hops_vals, 0);
first_hops_ptr = &first_hops_constr;
}
- LDKCVec_RouteHintZ last_hops_constr;
- last_hops_constr.datalen = (*env)->GetArrayLength(env, last_hops);
- if (last_hops_constr.datalen > 0)
- last_hops_constr.data = MALLOC(last_hops_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
- else
- last_hops_constr.data = NULL;
- int64_t* last_hops_vals = (*env)->GetLongArrayElements (env, last_hops, NULL);
- for (size_t l = 0; l < last_hops_constr.datalen; l++) {
- int64_t last_hops_conv_11 = last_hops_vals[l];
- LDKRouteHint last_hops_conv_11_conv;
- last_hops_conv_11_conv.inner = (void*)(last_hops_conv_11 & (~1));
- last_hops_conv_11_conv.is_owned = (last_hops_conv_11 & 1) || (last_hops_conv_11 == 0);
- last_hops_conv_11_conv = RouteHint_clone(&last_hops_conv_11_conv);
- last_hops_constr.data[l] = last_hops_conv_11_conv;
- }
- (*env)->ReleaseLongArrayElements(env, last_hops, last_hops_vals, 0);
void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
CHECK_ACCESS(logger_ptr);
LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
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 = get_route(our_node_pubkey_ref, &network_conv, payee_ref, payee_features_conv, first_hops_ptr, last_hops_constr, final_value_msat, final_cltv, logger_conv, scorer_conv);
+ *ret_conv = find_route(our_node_pubkey_ref, ¶ms_conv, &network_conv, first_hops_ptr, logger_conv, scorer_conv);
if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
return (uint64_t)ret_conv;
}
Scorer_free(this_obj_conv);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Scorer_1new(JNIEnv *env, jclass clz, int64_t base_penalty_msat) {
- LDKScorer ret_var = Scorer_new(base_penalty_msat);
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
+ LDKScoringParameters this_obj_conv;
+ this_obj_conv.inner = (void*)(this_obj & (~1));
+ this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+ ScoringParameters_free(this_obj_conv);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1get_1base_1penalty_1msat(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;
+ int64_t ret_val = ScoringParameters_get_base_penalty_msat(&this_ptr_conv);
+ return ret_val;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1set_1base_1penalty_1msat(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;
+ ScoringParameters_set_base_penalty_msat(&this_ptr_conv, val);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1get_1failure_1penalty_1msat(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;
+ int64_t ret_val = ScoringParameters_get_failure_penalty_msat(&this_ptr_conv);
+ return ret_val;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1set_1failure_1penalty_1msat(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;
+ ScoringParameters_set_failure_penalty_msat(&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));
+ this_ptr_conv.is_owned = false;
+ int64_t ret_val = ScoringParameters_get_failure_penalty_half_life(&this_ptr_conv);
+ return ret_val;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1set_1failure_1penalty_1half_1life(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;
+ 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);
+ 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.
+ 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_ScoringParameters_1write(JNIEnv *env, jclass clz, int64_t obj) {
+ LDKScoringParameters obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z ret_var = ScoringParameters_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_ScoringParameters_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_ScoringParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScoringParametersDecodeErrorZ), "LDKCResult_ScoringParametersDecodeErrorZ");
+ *ret_conv = ScoringParameters_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_Scorer_1new(JNIEnv *env, jclass clz, int64_t params) {
+ LDKScoringParameters params_conv;
+ params_conv.inner = (void*)(params & (~1));
+ params_conv.is_owned = (params & 1) || (params == 0);
+ // Warning: we need a move here but no clone is available for LDKScoringParameters
+ LDKScorer ret_var = Scorer_new(params_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Scorer_1default(JNIEnv *env, jclass clz) {
LDKScorer ret_var = Scorer_default();
+ 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.
+ 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_ScoringParameters_1default(JNIEnv *env, jclass clz) {
+ LDKScoringParameters ret_var = ScoringParameters_default();
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKScorer this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKScore* ret_ret =MALLOC(sizeof(LDKScore), "LDKScore");
+ LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore");
*ret_ret = Scorer_as_Score(&this_arg_conv);
return (uint64_t)ret_ret;
}
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Scorer_1write(JNIEnv *env, jclass clz, int64_t obj) {
+ LDKScorer obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z ret_var = Scorer_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_Scorer_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_ScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScorerDecodeErrorZ), "LDKCResult_ScorerDecodeErrorZ");
+ *ret_conv = Scorer_read(ser_ref);
+ (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
+ return (uint64_t)ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKFilesystemPersister this_obj_conv;
this_obj_conv.inner = (void*)(this_obj & (~1));
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1new(JNIEnv *env, jclass clz, jstring path_to_channel_data) {
LDKStr path_to_channel_data_conv = java_to_owned_str(env, path_to_channel_data);
LDKFilesystemPersister ret_var = FilesystemPersister_new(path_to_channel_data_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKFilesystemPersister this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKPersist* ret_ret =MALLOC(sizeof(LDKPersist), "LDKPersist");
+ LDKPersist* ret_ret = MALLOC(sizeof(LDKPersist), "LDKPersist");
*ret_ret = FilesystemPersister_as_Persist(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKLogger_JCalls_cloned(&logger_conv);
}
LDKBackgroundProcessor ret_var = BackgroundProcessor_start(persister_conv, event_handler_conv, &chain_monitor_conv, &channel_manager_conv, net_graph_msg_handler_conv, &peer_manager_conv, logger_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKInvoice ret_var = Invoice_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKSignedRawInvoice ret_var = SignedRawInvoice_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKRawDataPart ret_var = RawInvoice_get_data(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKRawInvoice ret_var = RawInvoice_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKPositiveTimestamp ret_var = RawDataPart_get_timestamp(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKRawDataPart ret_var = RawDataPart_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKPositiveTimestamp ret_var = PositiveTimestamp_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKSha256 ret_var = Sha256_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKDescription ret_var = Description_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
PayeePubKey_free(this_obj_conv);
}
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKPayeePubKey this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, PayeePubKey_get_a(&this_ptr_conv).compressed_form);
+ return ret_arr;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
+ LDKPayeePubKey this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKPublicKey val_ref;
+ CHECK((*env)->GetArrayLength(env, val) == 33);
+ (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
+ PayeePubKey_set_a(&this_ptr_conv, val_ref);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1new(JNIEnv *env, jclass clz, int8_tArray a_arg) {
+ LDKPublicKey a_arg_ref;
+ CHECK((*env)->GetArrayLength(env, a_arg) == 33);
+ (*env)->GetByteArrayRegion(env, a_arg, 0, 33, a_arg_ref.compressed_form);
+ LDKPayeePubKey ret_var = PayeePubKey_new(a_arg_ref);
+ 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.
+ 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_PayeePubKey_1clone(JNIEnv *env, jclass clz, int64_t orig) {
LDKPayeePubKey orig_conv;
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKPayeePubKey ret_var = PayeePubKey_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKExpiryTime ret_var = ExpiryTime_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
MinFinalCltvExpiry_free(this_obj_conv);
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKMinFinalCltvExpiry this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ int64_t ret_val = MinFinalCltvExpiry_get_a(&this_ptr_conv);
+ return ret_val;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
+ LDKMinFinalCltvExpiry this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ MinFinalCltvExpiry_set_a(&this_ptr_conv, val);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1new(JNIEnv *env, jclass clz, int64_t a_arg) {
+ LDKMinFinalCltvExpiry ret_var = MinFinalCltvExpiry_new(a_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.
+ 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_MinFinalCltvExpiry_1clone(JNIEnv *env, jclass clz, int64_t orig) {
LDKMinFinalCltvExpiry orig_conv;
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKMinFinalCltvExpiry ret_var = MinFinalCltvExpiry_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKInvoiceSignature ret_var = InvoiceSignature_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKPrivateRoute ret_var = PrivateRoute_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKRawInvoice ret_var = SignedRawInvoice_raw_invoice(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKInvoiceSignature ret_var = SignedRawInvoice_signature(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKSha256 ret_var = RawInvoice_payment_hash(&this_arg_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKDescription ret_var = RawInvoice_description(&this_arg_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKPayeePubKey ret_var = RawInvoice_payee_pub_key(&this_arg_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKSha256 ret_var = RawInvoice_description_hash(&this_arg_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKExpiryTime ret_var = RawInvoice_expiry_time(&this_arg_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKMinFinalCltvExpiry ret_var = RawInvoice_min_final_cltv_expiry(&this_arg_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKInvoiceFeatures ret_var = RawInvoice_features(&this_arg_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCVec_PrivateRouteZ ret_var = RawInvoice_private_routes(&this_arg_conv);
- int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t o = 0; o < ret_var.datalen; o++) {
LDKPrivateRoute ret_conv_14_var = ret_var.data[o];
+ uint64_t ret_conv_14_ref = 0;
CHECK((((uint64_t)ret_conv_14_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_conv_14_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t ret_conv_14_ref = (uint64_t)ret_conv_14_var.inner;
+ ret_conv_14_ref = (uint64_t)ret_conv_14_var.inner;
if (ret_conv_14_var.is_owned) {
ret_conv_14_ref |= 1;
}
this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
this_arg_conv = Invoice_clone(&this_arg_conv);
LDKSignedRawInvoice ret_var = Invoice_into_signed_raw(this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
- (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, Invoice_payment_secret(&this_arg_conv).data);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *Invoice_payment_secret(&this_arg_conv));
return ret_arr;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKInvoiceFeatures ret_var = Invoice_features(&this_arg_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
return ret_val;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Invoice_1is_1expired(JNIEnv *env, jclass clz, int64_t this_arg) {
+ LDKInvoice this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ jboolean ret_val = Invoice_is_expired(&this_arg_conv);
+ return ret_val;
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1min_1final_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_arg) {
LDKInvoice this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCVec_PrivateRouteZ ret_var = Invoice_private_routes(&this_arg_conv);
- int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t o = 0; o < ret_var.datalen; o++) {
LDKPrivateRoute ret_conv_14_var = ret_var.data[o];
+ uint64_t ret_conv_14_ref = 0;
CHECK((((uint64_t)ret_conv_14_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_conv_14_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t ret_conv_14_ref = (uint64_t)ret_conv_14_var.inner;
+ ret_conv_14_ref = (uint64_t)ret_conv_14_var.inner;
if (ret_conv_14_var.is_owned) {
ret_conv_14_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCVec_RouteHintZ ret_var = Invoice_route_hints(&this_arg_conv);
- int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t l = 0; l < ret_var.datalen; l++) {
LDKRouteHint ret_conv_11_var = ret_var.data[l];
+ uint64_t ret_conv_11_ref = 0;
CHECK((((uint64_t)ret_conv_11_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_conv_11_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t ret_conv_11_ref = (uint64_t)ret_conv_11_var.inner;
+ ret_conv_11_ref = (uint64_t)ret_conv_11_var.inner;
if (ret_conv_11_var.is_owned) {
ret_conv_11_ref |= 1;
}
return ret_conv;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1amount_1pico_1btc(JNIEnv *env, jclass clz, int64_t this_arg) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1amount_1milli_1satoshis(JNIEnv *env, jclass clz, int64_t this_arg) {
LDKInvoice this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
- *ret_copy = Invoice_amount_pico_btc(&this_arg_conv);
+ *ret_copy = Invoice_amount_milli_satoshis(&this_arg_conv);
uint64_t ret_ref = (uint64_t)ret_copy;
return ret_ref;
}
this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
this_arg_conv = PrivateRoute_clone(&this_arg_conv);
LDKRouteHint ret_var = PrivateRoute_into_inner(this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
return ret_conv;
}
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
+ LDKInvoicePayer this_obj_conv;
+ this_obj_conv.inner = (void*)(this_obj & (~1));
+ this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+ InvoicePayer_free(this_obj_conv);
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payer_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);
+ LDKPayer this_ptr_conv = *(LDKPayer*)(this_ptr_ptr);
+ FREE((void*)this_ptr);
+ Payer_free(this_ptr_conv);
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Router_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);
+ LDKRouter this_ptr_conv = *(LDKRouter*)(this_ptr_ptr);
+ FREE((void*)this_ptr);
+ Router_free(this_ptr_conv);
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
+ LDKRetryAttempts this_obj_conv;
+ this_obj_conv.inner = (void*)(this_obj & (~1));
+ this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+ RetryAttempts_free(this_obj_conv);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKRetryAttempts this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ int64_t ret_val = RetryAttempts_get_a(&this_ptr_conv);
+ return ret_val;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
+ LDKRetryAttempts this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ RetryAttempts_set_a(&this_ptr_conv, val);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1new(JNIEnv *env, jclass clz, int64_t a_arg) {
+ LDKRetryAttempts ret_var = RetryAttempts_new(a_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.
+ 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_RetryAttempts_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKRetryAttempts orig_conv;
+ orig_conv.inner = (void*)(orig & (~1));
+ orig_conv.is_owned = false;
+ LDKRetryAttempts ret_var = RetryAttempts_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.
+ 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_RetryAttempts_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKRetryAttempts a_conv;
+ a_conv.inner = (void*)(a & (~1));
+ a_conv.is_owned = false;
+ LDKRetryAttempts b_conv;
+ b_conv.inner = (void*)(b & (~1));
+ b_conv.is_owned = false;
+ jboolean ret_val = RetryAttempts_eq(&a_conv, &b_conv);
+ return ret_val;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1hash(JNIEnv *env, jclass clz, int64_t o) {
+ LDKRetryAttempts o_conv;
+ o_conv.inner = (void*)(o & (~1));
+ o_conv.is_owned = false;
+ int64_t ret_val = RetryAttempts_hash(&o_conv);
+ return ret_val;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentError_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);
+ LDKPaymentError this_ptr_conv = *(LDKPaymentError*)(this_ptr_ptr);
+ FREE((void*)this_ptr);
+ PaymentError_free(this_ptr_conv);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKPaymentError* orig_conv = (LDKPaymentError*)orig;
+ LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
+ *ret_copy = PaymentError_clone(orig_conv);
+ uint64_t ret_ref = (uint64_t)ret_copy;
+ return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentError_1invoice(JNIEnv *env, jclass clz, jstring a) {
+ LDKStr a_conv = java_to_owned_str(env, a);
+ LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
+ *ret_copy = PaymentError_invoice(a_conv);
+ uint64_t ret_ref = (uint64_t)ret_copy;
+ return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentError_1routing(JNIEnv *env, jclass clz, int64_t a) {
+ LDKLightningError a_conv;
+ a_conv.inner = (void*)(a & (~1));
+ a_conv.is_owned = (a & 1) || (a == 0);
+ a_conv = LightningError_clone(&a_conv);
+ LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
+ *ret_copy = PaymentError_routing(a_conv);
+ uint64_t ret_ref = (uint64_t)ret_copy;
+ return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentError_1sending(JNIEnv *env, jclass clz, int64_t a) {
+ void* a_ptr = (void*)(((uint64_t)a) & ~1);
+ CHECK_ACCESS(a_ptr);
+ LDKPaymentSendFailure a_conv = *(LDKPaymentSendFailure*)(a_ptr);
+ a_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)(((uint64_t)a) & ~1));
+ LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
+ *ret_copy = PaymentError_sending(a_conv);
+ uint64_t ret_ref = (uint64_t)ret_copy;
+ return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1new(JNIEnv *env, jclass clz, int64_t payer, int64_t router, int64_t scorer, int64_t logger, int64_t event_handler, int64_t retry_attempts) {
+ void* payer_ptr = (void*)(((uint64_t)payer) & ~1);
+ CHECK_ACCESS(payer_ptr);
+ LDKPayer payer_conv = *(LDKPayer*)(payer_ptr);
+ if (payer_conv.free == LDKPayer_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKPayer_JCalls_cloned(&payer_conv);
+ }
+ void* router_ptr = (void*)(((uint64_t)router) & ~1);
+ CHECK_ACCESS(router_ptr);
+ LDKRouter router_conv = *(LDKRouter*)(router_ptr);
+ if (router_conv.free == LDKRouter_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKRouter_JCalls_cloned(&router_conv);
+ }
+ LDKLockableScore scorer_conv;
+ scorer_conv.inner = (void*)(scorer & (~1));
+ scorer_conv.is_owned = false;
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
+ if (logger_conv.free == LDKLogger_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKLogger_JCalls_cloned(&logger_conv);
+ }
+ void* event_handler_ptr = (void*)(((uint64_t)event_handler) & ~1);
+ CHECK_ACCESS(event_handler_ptr);
+ LDKEventHandler event_handler_conv = *(LDKEventHandler*)(event_handler_ptr);
+ if (event_handler_conv.free == LDKEventHandler_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKEventHandler_JCalls_cloned(&event_handler_conv);
+ }
+ LDKRetryAttempts retry_attempts_conv;
+ retry_attempts_conv.inner = (void*)(retry_attempts & (~1));
+ retry_attempts_conv.is_owned = (retry_attempts & 1) || (retry_attempts == 0);
+ retry_attempts_conv = RetryAttempts_clone(&retry_attempts_conv);
+ LDKInvoicePayer ret_var = InvoicePayer_new(payer_conv, router_conv, &scorer_conv, logger_conv, event_handler_conv, retry_attempts_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.
+ 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_InvoicePayer_1pay_1invoice(JNIEnv *env, jclass clz, int64_t this_arg, int64_t invoice) {
+ LDKInvoicePayer this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ LDKInvoice invoice_conv;
+ invoice_conv.inner = (void*)(invoice & (~1));
+ invoice_conv.is_owned = false;
+ LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
+ *ret_conv = InvoicePayer_pay_invoice(&this_arg_conv, &invoice_conv);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1pay_1zero_1value_1invoice(JNIEnv *env, jclass clz, int64_t this_arg, int64_t invoice, int64_t amount_msats) {
+ LDKInvoicePayer this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ LDKInvoice invoice_conv;
+ invoice_conv.inner = (void*)(invoice & (~1));
+ invoice_conv.is_owned = false;
+ LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
+ *ret_conv = InvoicePayer_pay_zero_value_invoice(&this_arg_conv, &invoice_conv, amount_msats);
+ 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));
+ this_arg_conv.is_owned = false;
+ 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;
+ InvoicePayer_remove_cached_payment(&this_arg_conv, payment_hash_ref);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1as_1EventHandler(JNIEnv *env, jclass clz, int64_t this_arg) {
+ LDKInvoicePayer this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ LDKEventHandler* ret_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
+ *ret_ret = InvoicePayer_as_EventHandler(&this_arg_conv);
+ return (uint64_t)ret_ret;
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t keys_manager, jclass network, int64_t amt_msat, jstring description) {
LDKChannelManager channelmanager_conv;
channelmanager_conv.inner = (void*)(channelmanager & (~1));
return (uint64_t)ret_conv;
}
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
+ LDKDefaultRouter this_obj_conv;
+ this_obj_conv.inner = (void*)(this_obj & (~1));
+ this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+ DefaultRouter_free(this_obj_conv);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1new(JNIEnv *env, jclass clz, int64_t network_graph, int64_t logger) {
+ LDKNetworkGraph network_graph_conv;
+ network_graph_conv.inner = (void*)(network_graph & (~1));
+ network_graph_conv.is_owned = false;
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
+ if (logger_conv.free == LDKLogger_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKLogger_JCalls_cloned(&logger_conv);
+ }
+ LDKDefaultRouter ret_var = DefaultRouter_new(&network_graph_conv, logger_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.
+ 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_DefaultRouter_1as_1Router(JNIEnv *env, jclass clz, int64_t this_arg) {
+ LDKDefaultRouter this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ LDKRouter* ret_ret = MALLOC(sizeof(LDKRouter), "LDKRouter");
+ *ret_ret = DefaultRouter_as_Router(&this_arg_conv);
+ return (uint64_t)ret_ret;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1Payer(JNIEnv *env, jclass clz, int64_t this_arg) {
+ LDKChannelManager this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ LDKPayer* ret_ret = MALLOC(sizeof(LDKPayer), "LDKPayer");
+ *ret_ret = ChannelManager_as_Payer(&this_arg_conv);
+ return (uint64_t)ret_ret;
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SiPrefix_1from_1str(JNIEnv *env, jclass clz, jstring s) {
LDKStr s_conv = java_to_owned_str(env, s);
LDKCResult_SiPrefixNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixNoneZ), "LDKCResult_SiPrefixNoneZ");
#define DEBUG_PRINT(...) fprintf(stderr, __VA_ARGS__)
#define MALLOC(a, _) malloc(a)
-#define FREE(p) if ((uint64_t)(p) > 1024) { free(p); }
+#define FREE(p) if ((uint64_t)(p) > 4096) { free(p); }
#define CHECK_ACCESS(p)
#define DO_ASSERT(a) (void)(a)
#define CHECK(a)
LDKCResult_TxCreationKeysDecodeErrorZ *val = (LDKCResult_TxCreationKeysDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKTxCreationKeys 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_TxCreationKeysDecodeErrorZ *val = (LDKCResult_TxCreationKeysDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelPublicKeysDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ChannelPublicKeysDecodeErrorZ *val = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKChannelPublicKeys 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelPublicKeysDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ChannelPublicKeysDecodeErrorZ *val = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_TxCreationKeysErrorZ *val = (LDKCResult_TxCreationKeysErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKTxCreationKeys 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *val = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKHTLCOutputInCommitment 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HTLCOutputInCommitmentDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *val = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *val = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKCounterpartyChannelTransactionParameters 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *val = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelTransactionParametersDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ChannelTransactionParametersDecodeErrorZ *val = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKChannelTransactionParameters 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelTransactionParametersDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ChannelTransactionParametersDecodeErrorZ *val = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HolderCommitmentTransactionDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_HolderCommitmentTransactionDecodeErrorZ *val = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKHolderCommitmentTransaction 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HolderCommitmentTransactionDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_HolderCommitmentTransactionDecodeErrorZ *val = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1BuiltCommitmentTransactionDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *val = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKBuiltCommitmentTransaction 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1BuiltCommitmentTransactionDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *val = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TrustedClosingTransactionNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_TrustedClosingTransactionNoneZ *val = (LDKCResult_TrustedClosingTransactionNoneZ*)(arg & ~1);
CHECK(val->result_ok);
LDKTrustedClosingTransaction 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TrustedClosingTransactionNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_CommitmentTransactionDecodeErrorZ *val = (LDKCResult_CommitmentTransactionDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKCommitmentTransaction 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CommitmentTransactionDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_CommitmentTransactionDecodeErrorZ *val = (LDKCResult_CommitmentTransactionDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TrustedCommitmentTransactionNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_TrustedCommitmentTransactionNoneZ *val = (LDKCResult_TrustedCommitmentTransactionNoneZ*)(arg & ~1);
CHECK(val->result_ok);
LDKTrustedCommitmentTransaction 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TrustedCommitmentTransactionNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_CVec_SignatureZNoneZ *val = (LDKCResult_CVec_SignatureZNoneZ*)(arg & ~1);
CHECK(val->result_ok);
LDKCVec_SignatureZ res_var = (*val->contents.result);
- jobjectArray res_arr = (*env)->NewObjectArray(env, res_var.datalen, arr_of_B_clz, NULL);
+ jobjectArray res_arr = NULL;
+ res_arr = (*env)->NewObjectArray(env, res_var.datalen, arr_of_B_clz, NULL);
;
for (size_t i = 0; i < res_var.datalen; i++) {
int8_tArray res_conv_8_arr = (*env)->NewByteArray(env, 64);
(*env)->SetByteArrayRegion(env, res_conv_8_arr, 0, 64, res_var.data[i].compact_form);
(*env)->SetObjectArrayElement(env, res_arr, i, res_conv_8_arr);
}
+
return res_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1SignatureZNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ShutdownScriptDecodeErrorZ *val = (LDKCResult_ShutdownScriptDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKShutdownScript 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownScriptDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ShutdownScriptDecodeErrorZ *val = (LDKCResult_ShutdownScriptDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownScriptInvalidShutdownScriptZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ShutdownScriptInvalidShutdownScriptZ *val = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(arg & ~1);
CHECK(val->result_ok);
LDKShutdownScript 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownScriptInvalidShutdownScriptZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ShutdownScriptInvalidShutdownScriptZ *val = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(arg & ~1);
CHECK(!val->result_ok);
LDKInvalidShutdownScript 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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_RouteHopDecodeErrorZ *val = (LDKCResult_RouteHopDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKRouteHop 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHopDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_RouteHopDecodeErrorZ *val = (LDKCResult_RouteHopDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1RouteHopZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
LDKCResult_RouteDecodeErrorZ *val = (LDKCResult_RouteDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKRoute 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_RouteDecodeErrorZ *val = (LDKCResult_RouteDecodeErrorZ*)(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.
+ err_ref = (uint64_t)err_var.inner & ~1;
+ return err_ref;
+}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteParametersDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ return ((LDKCResult_RouteParametersDecodeErrorZ*)arg)->result_ok;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteParametersDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_RouteParametersDecodeErrorZ *val = (LDKCResult_RouteParametersDecodeErrorZ*)(arg & ~1);
+ CHECK(val->result_ok);
+ LDKRouteParameters 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_1RouteParametersDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_RouteParametersDecodeErrorZ *val = (LDKCResult_RouteParametersDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1RouteHintZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
+ LDKCVec_RouteHintZ *ret = MALLOC(sizeof(LDKCVec_RouteHintZ), "LDKCVec_RouteHintZ");
+ ret->datalen = (*env)->GetArrayLength(env, elems);
+ if (ret->datalen == 0) {
+ ret->data = NULL;
+ } else {
+ ret->data = MALLOC(sizeof(LDKRouteHint) * ret->datalen, "LDKCVec_RouteHintZ Data");
+ int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
+ for (size_t i = 0; i < ret->datalen; i++) {
+ int64_t arr_elem = java_elems[i];
+ LDKRouteHint arr_elem_conv;
+ arr_elem_conv.inner = (void*)(arr_elem & (~1));
+ arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0);
+ arr_elem_conv = RouteHint_clone(&arr_elem_conv);
+ ret->data[i] = arr_elem_conv;
+ }
+ (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
+ }
+ return (uint64_t)ret;
+}
+static inline LDKCVec_RouteHintZ CVec_RouteHintZ_clone(const LDKCVec_RouteHintZ *orig) {
+ LDKCVec_RouteHintZ ret = { .data = MALLOC(sizeof(LDKRouteHint) * orig->datalen, "LDKCVec_RouteHintZ clone bytes"), .datalen = orig->datalen };
+ for (size_t i = 0; i < ret.datalen; i++) {
+ ret.data[i] = RouteHint_clone(&orig->data[i]);
+ }
+ return ret;
+}
static jclass LDKCOption_u64Z_Some_class = NULL;
static jmethodID LDKCOption_u64Z_Some_meth = NULL;
static jclass LDKCOption_u64Z_None_class = NULL;
default: abort();
}
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1ChannelDetailsZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
- LDKCVec_ChannelDetailsZ *ret = MALLOC(sizeof(LDKCVec_ChannelDetailsZ), "LDKCVec_ChannelDetailsZ");
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PayeeDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ return ((LDKCResult_PayeeDecodeErrorZ*)arg)->result_ok;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PayeeDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_PayeeDecodeErrorZ *val = (LDKCResult_PayeeDecodeErrorZ*)(arg & ~1);
+ CHECK(val->result_ok);
+ LDKPayee 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_1PayeeDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_PayeeDecodeErrorZ *val = (LDKCResult_PayeeDecodeErrorZ*)(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.
+ err_ref = (uint64_t)err_var.inner & ~1;
+ return err_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1RouteHintHopZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
+ LDKCVec_RouteHintHopZ *ret = MALLOC(sizeof(LDKCVec_RouteHintHopZ), "LDKCVec_RouteHintHopZ");
ret->datalen = (*env)->GetArrayLength(env, elems);
if (ret->datalen == 0) {
ret->data = NULL;
} else {
- ret->data = MALLOC(sizeof(LDKChannelDetails) * ret->datalen, "LDKCVec_ChannelDetailsZ Data");
+ ret->data = MALLOC(sizeof(LDKRouteHintHop) * ret->datalen, "LDKCVec_RouteHintHopZ Data");
int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
for (size_t i = 0; i < ret->datalen; i++) {
int64_t arr_elem = java_elems[i];
- LDKChannelDetails arr_elem_conv;
+ LDKRouteHintHop arr_elem_conv;
arr_elem_conv.inner = (void*)(arr_elem & (~1));
arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0);
- arr_elem_conv = ChannelDetails_clone(&arr_elem_conv);
+ arr_elem_conv = RouteHintHop_clone(&arr_elem_conv);
ret->data[i] = arr_elem_conv;
}
(*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
}
return (uint64_t)ret;
}
-static inline LDKCVec_ChannelDetailsZ CVec_ChannelDetailsZ_clone(const LDKCVec_ChannelDetailsZ *orig) {
- LDKCVec_ChannelDetailsZ ret = { .data = MALLOC(sizeof(LDKChannelDetails) * orig->datalen, "LDKCVec_ChannelDetailsZ clone bytes"), .datalen = orig->datalen };
+static inline LDKCVec_RouteHintHopZ CVec_RouteHintHopZ_clone(const LDKCVec_RouteHintHopZ *orig) {
+ LDKCVec_RouteHintHopZ ret = { .data = MALLOC(sizeof(LDKRouteHintHop) * orig->datalen, "LDKCVec_RouteHintHopZ clone bytes"), .datalen = orig->datalen };
for (size_t i = 0; i < ret.datalen; i++) {
- ret.data[i] = ChannelDetails_clone(&orig->data[i]);
+ ret.data[i] = RouteHintHop_clone(&orig->data[i]);
}
return ret;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1RouteHintZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
- LDKCVec_RouteHintZ *ret = MALLOC(sizeof(LDKCVec_RouteHintZ), "LDKCVec_RouteHintZ");
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHintDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ return ((LDKCResult_RouteHintDecodeErrorZ*)arg)->result_ok;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHintDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_RouteHintDecodeErrorZ *val = (LDKCResult_RouteHintDecodeErrorZ*)(arg & ~1);
+ CHECK(val->result_ok);
+ LDKRouteHint 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_1RouteHintDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_RouteHintDecodeErrorZ *val = (LDKCResult_RouteHintDecodeErrorZ*)(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.
+ err_ref = (uint64_t)err_var.inner & ~1;
+ return err_ref;
+}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHintHopDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ return ((LDKCResult_RouteHintHopDecodeErrorZ*)arg)->result_ok;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHintHopDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_RouteHintHopDecodeErrorZ *val = (LDKCResult_RouteHintHopDecodeErrorZ*)(arg & ~1);
+ CHECK(val->result_ok);
+ LDKRouteHintHop 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_1RouteHintHopDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_RouteHintHopDecodeErrorZ *val = (LDKCResult_RouteHintHopDecodeErrorZ*)(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.
+ err_ref = (uint64_t)err_var.inner & ~1;
+ return err_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1ChannelDetailsZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
+ LDKCVec_ChannelDetailsZ *ret = MALLOC(sizeof(LDKCVec_ChannelDetailsZ), "LDKCVec_ChannelDetailsZ");
ret->datalen = (*env)->GetArrayLength(env, elems);
if (ret->datalen == 0) {
ret->data = NULL;
} else {
- ret->data = MALLOC(sizeof(LDKRouteHint) * ret->datalen, "LDKCVec_RouteHintZ Data");
+ ret->data = MALLOC(sizeof(LDKChannelDetails) * ret->datalen, "LDKCVec_ChannelDetailsZ Data");
int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
for (size_t i = 0; i < ret->datalen; i++) {
int64_t arr_elem = java_elems[i];
- LDKRouteHint arr_elem_conv;
+ LDKChannelDetails arr_elem_conv;
arr_elem_conv.inner = (void*)(arr_elem & (~1));
arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0);
- arr_elem_conv = RouteHint_clone(&arr_elem_conv);
+ arr_elem_conv = ChannelDetails_clone(&arr_elem_conv);
ret->data[i] = arr_elem_conv;
}
(*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
}
return (uint64_t)ret;
}
-static inline LDKCVec_RouteHintZ CVec_RouteHintZ_clone(const LDKCVec_RouteHintZ *orig) {
- LDKCVec_RouteHintZ ret = { .data = MALLOC(sizeof(LDKRouteHint) * orig->datalen, "LDKCVec_RouteHintZ clone bytes"), .datalen = orig->datalen };
+static inline LDKCVec_ChannelDetailsZ CVec_ChannelDetailsZ_clone(const LDKCVec_ChannelDetailsZ *orig) {
+ LDKCVec_ChannelDetailsZ ret = { .data = MALLOC(sizeof(LDKChannelDetails) * orig->datalen, "LDKCVec_ChannelDetailsZ clone bytes"), .datalen = orig->datalen };
for (size_t i = 0; i < ret.datalen; i++) {
- ret.data[i] = RouteHint_clone(&orig->data[i]);
+ ret.data[i] = ChannelDetails_clone(&orig->data[i]);
}
return ret;
}
LDKCResult_RouteLightningErrorZ *val = (LDKCResult_RouteLightningErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKRoute 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteLightningErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_RouteLightningErrorZ *val = (LDKCResult_RouteLightningErrorZ*)(arg & ~1);
CHECK(!val->result_ok);
LDKLightningError 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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxOutAccessErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
static jmethodID LDKMonitorEvent_HTLCEvent_meth = NULL;
static jclass LDKMonitorEvent_CommitmentTxConfirmed_class = NULL;
static jmethodID LDKMonitorEvent_CommitmentTxConfirmed_meth = NULL;
+static jclass LDKMonitorEvent_UpdateCompleted_class = NULL;
+static jmethodID LDKMonitorEvent_UpdateCompleted_meth = NULL;
+static jclass LDKMonitorEvent_UpdateFailed_class = 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;"));
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;"));
+ 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;"));
+ CHECK(LDKMonitorEvent_UpdateFailed_class != NULL);
+ LDKMonitorEvent_UpdateFailed_meth = (*env)->GetMethodID(env, LDKMonitorEvent_UpdateFailed_class, "<init>", "(J)V");
+ CHECK(LDKMonitorEvent_UpdateFailed_meth != NULL);
}
JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMonitorEvent_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
LDKMonitorEvent *obj = (LDKMonitorEvent*)(ptr & ~1);
switch(obj->tag) {
case LDKMonitorEvent_HTLCEvent: {
LDKHTLCUpdate htlc_event_var = obj->htlc_event;
+ uint64_t htlc_event_ref = 0;
CHECK((((uint64_t)htlc_event_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&htlc_event_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t htlc_event_ref = (uint64_t)htlc_event_var.inner & ~1;
+ htlc_event_ref = (uint64_t)htlc_event_var.inner & ~1;
return (*env)->NewObject(env, LDKMonitorEvent_HTLCEvent_class, LDKMonitorEvent_HTLCEvent_meth, htlc_event_ref);
}
case LDKMonitorEvent_CommitmentTxConfirmed: {
LDKOutPoint commitment_tx_confirmed_var = obj->commitment_tx_confirmed;
+ uint64_t commitment_tx_confirmed_ref = 0;
CHECK((((uint64_t)commitment_tx_confirmed_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&commitment_tx_confirmed_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t commitment_tx_confirmed_ref = (uint64_t)commitment_tx_confirmed_var.inner & ~1;
+ commitment_tx_confirmed_ref = (uint64_t)commitment_tx_confirmed_var.inner & ~1;
return (*env)->NewObject(env, LDKMonitorEvent_CommitmentTxConfirmed_class, LDKMonitorEvent_CommitmentTxConfirmed_meth, commitment_tx_confirmed_ref);
}
+ case LDKMonitorEvent_UpdateCompleted: {
+ LDKOutPoint funding_txo_var = obj->update_completed.funding_txo;
+ uint64_t funding_txo_ref = 0;
+ CHECK((((uint64_t)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&funding_txo_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ funding_txo_ref = (uint64_t)funding_txo_var.inner & ~1;
+ return (*env)->NewObject(env, LDKMonitorEvent_UpdateCompleted_class, LDKMonitorEvent_UpdateCompleted_meth, funding_txo_ref, obj->update_completed.monitor_update_id);
+ }
+ case LDKMonitorEvent_UpdateFailed: {
+ LDKOutPoint update_failed_var = obj->update_failed;
+ uint64_t update_failed_ref = 0;
+ CHECK((((uint64_t)update_failed_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&update_failed_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ update_failed_ref = (uint64_t)update_failed_var.inner & ~1;
+ return (*env)->NewObject(env, LDKMonitorEvent_UpdateFailed_class, LDKMonitorEvent_UpdateFailed_meth, update_failed_ref);
+ }
default: abort();
}
}
switch(obj->tag) {
case LDKNetworkUpdate_ChannelUpdateMessage: {
LDKChannelUpdate msg_var = obj->channel_update_message.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return (*env)->NewObject(env, LDKNetworkUpdate_ChannelUpdateMessage_class, LDKNetworkUpdate_ChannelUpdateMessage_meth, msg_ref);
}
case LDKNetworkUpdate_ChannelClosed: {
switch(obj->tag) {
case LDKSpendableOutputDescriptor_StaticOutput: {
LDKOutPoint outpoint_var = obj->static_output.outpoint;
+ uint64_t outpoint_ref = 0;
CHECK((((uint64_t)outpoint_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&outpoint_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t outpoint_ref = (uint64_t)outpoint_var.inner & ~1;
+ outpoint_ref = (uint64_t)outpoint_var.inner & ~1;
uint64_t output_ref = ((uint64_t)&obj->static_output.output) | 1;
return (*env)->NewObject(env, LDKSpendableOutputDescriptor_StaticOutput_class, LDKSpendableOutputDescriptor_StaticOutput_meth, outpoint_ref, (uint64_t)output_ref);
}
case LDKSpendableOutputDescriptor_DelayedPaymentOutput: {
LDKDelayedPaymentOutputDescriptor delayed_payment_output_var = obj->delayed_payment_output;
+ uint64_t delayed_payment_output_ref = 0;
CHECK((((uint64_t)delayed_payment_output_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&delayed_payment_output_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t delayed_payment_output_ref = (uint64_t)delayed_payment_output_var.inner & ~1;
+ delayed_payment_output_ref = (uint64_t)delayed_payment_output_var.inner & ~1;
return (*env)->NewObject(env, LDKSpendableOutputDescriptor_DelayedPaymentOutput_class, LDKSpendableOutputDescriptor_DelayedPaymentOutput_meth, delayed_payment_output_ref);
}
case LDKSpendableOutputDescriptor_StaticPaymentOutput: {
LDKStaticPaymentOutputDescriptor static_payment_output_var = obj->static_payment_output;
+ uint64_t static_payment_output_ref = 0;
CHECK((((uint64_t)static_payment_output_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&static_payment_output_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t static_payment_output_ref = (uint64_t)static_payment_output_var.inner & ~1;
+ static_payment_output_ref = (uint64_t)static_payment_output_var.inner & ~1;
return (*env)->NewObject(env, LDKSpendableOutputDescriptor_StaticPaymentOutput_class, LDKSpendableOutputDescriptor_StaticPaymentOutput_meth, static_payment_output_ref);
}
default: abort();
switch(obj->tag) {
case LDKErrorAction_DisconnectPeer: {
LDKErrorMessage msg_var = obj->disconnect_peer.msg;
- CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
- CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ uint64_t msg_ref = 0;
+ if ((uint64_t)msg_var.inner > 4096) {
+ CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ msg_ref = (uint64_t)msg_var.inner & ~1;
+ }
return (*env)->NewObject(env, LDKErrorAction_DisconnectPeer_class, LDKErrorAction_DisconnectPeer_meth, msg_ref);
}
case LDKErrorAction_IgnoreError: {
}
case LDKErrorAction_SendErrorMessage: {
LDKErrorMessage msg_var = obj->send_error_message.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return (*env)->NewObject(env, LDKErrorAction_SendErrorMessage_class, LDKErrorAction_SendErrorMessage_meth, msg_ref);
}
default: abort();
int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_accept_channel.node_id.compressed_form);
LDKAcceptChannel msg_var = obj->send_accept_channel.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return (*env)->NewObject(env, LDKMessageSendEvent_SendAcceptChannel_class, LDKMessageSendEvent_SendAcceptChannel_meth, node_id_arr, msg_ref);
}
case LDKMessageSendEvent_SendOpenChannel: {
int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_open_channel.node_id.compressed_form);
LDKOpenChannel msg_var = obj->send_open_channel.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return (*env)->NewObject(env, LDKMessageSendEvent_SendOpenChannel_class, LDKMessageSendEvent_SendOpenChannel_meth, node_id_arr, msg_ref);
}
case LDKMessageSendEvent_SendFundingCreated: {
int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_funding_created.node_id.compressed_form);
LDKFundingCreated msg_var = obj->send_funding_created.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return (*env)->NewObject(env, LDKMessageSendEvent_SendFundingCreated_class, LDKMessageSendEvent_SendFundingCreated_meth, node_id_arr, msg_ref);
}
case LDKMessageSendEvent_SendFundingSigned: {
int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_funding_signed.node_id.compressed_form);
LDKFundingSigned msg_var = obj->send_funding_signed.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return (*env)->NewObject(env, LDKMessageSendEvent_SendFundingSigned_class, LDKMessageSendEvent_SendFundingSigned_meth, node_id_arr, msg_ref);
}
case LDKMessageSendEvent_SendFundingLocked: {
int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_funding_locked.node_id.compressed_form);
LDKFundingLocked msg_var = obj->send_funding_locked.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return (*env)->NewObject(env, LDKMessageSendEvent_SendFundingLocked_class, LDKMessageSendEvent_SendFundingLocked_meth, node_id_arr, msg_ref);
}
case LDKMessageSendEvent_SendAnnouncementSignatures: {
int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_announcement_signatures.node_id.compressed_form);
LDKAnnouncementSignatures msg_var = obj->send_announcement_signatures.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return (*env)->NewObject(env, LDKMessageSendEvent_SendAnnouncementSignatures_class, LDKMessageSendEvent_SendAnnouncementSignatures_meth, node_id_arr, msg_ref);
}
case LDKMessageSendEvent_UpdateHTLCs: {
int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->update_htl_cs.node_id.compressed_form);
LDKCommitmentUpdate updates_var = obj->update_htl_cs.updates;
+ uint64_t updates_ref = 0;
CHECK((((uint64_t)updates_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&updates_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t updates_ref = (uint64_t)updates_var.inner & ~1;
+ updates_ref = (uint64_t)updates_var.inner & ~1;
return (*env)->NewObject(env, LDKMessageSendEvent_UpdateHTLCs_class, LDKMessageSendEvent_UpdateHTLCs_meth, node_id_arr, updates_ref);
}
case LDKMessageSendEvent_SendRevokeAndACK: {
int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_revoke_and_ack.node_id.compressed_form);
LDKRevokeAndACK msg_var = obj->send_revoke_and_ack.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return (*env)->NewObject(env, LDKMessageSendEvent_SendRevokeAndACK_class, LDKMessageSendEvent_SendRevokeAndACK_meth, node_id_arr, msg_ref);
}
case LDKMessageSendEvent_SendClosingSigned: {
int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_closing_signed.node_id.compressed_form);
LDKClosingSigned msg_var = obj->send_closing_signed.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return (*env)->NewObject(env, LDKMessageSendEvent_SendClosingSigned_class, LDKMessageSendEvent_SendClosingSigned_meth, node_id_arr, msg_ref);
}
case LDKMessageSendEvent_SendShutdown: {
int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_shutdown.node_id.compressed_form);
LDKShutdown msg_var = obj->send_shutdown.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return (*env)->NewObject(env, LDKMessageSendEvent_SendShutdown_class, LDKMessageSendEvent_SendShutdown_meth, node_id_arr, msg_ref);
}
case LDKMessageSendEvent_SendChannelReestablish: {
int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_channel_reestablish.node_id.compressed_form);
LDKChannelReestablish msg_var = obj->send_channel_reestablish.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return (*env)->NewObject(env, LDKMessageSendEvent_SendChannelReestablish_class, LDKMessageSendEvent_SendChannelReestablish_meth, node_id_arr, msg_ref);
}
case LDKMessageSendEvent_BroadcastChannelAnnouncement: {
LDKChannelAnnouncement msg_var = obj->broadcast_channel_announcement.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
LDKChannelUpdate update_msg_var = obj->broadcast_channel_announcement.update_msg;
+ uint64_t update_msg_ref = 0;
CHECK((((uint64_t)update_msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&update_msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t update_msg_ref = (uint64_t)update_msg_var.inner & ~1;
+ update_msg_ref = (uint64_t)update_msg_var.inner & ~1;
return (*env)->NewObject(env, LDKMessageSendEvent_BroadcastChannelAnnouncement_class, LDKMessageSendEvent_BroadcastChannelAnnouncement_meth, msg_ref, update_msg_ref);
}
case LDKMessageSendEvent_BroadcastNodeAnnouncement: {
LDKNodeAnnouncement msg_var = obj->broadcast_node_announcement.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return (*env)->NewObject(env, LDKMessageSendEvent_BroadcastNodeAnnouncement_class, LDKMessageSendEvent_BroadcastNodeAnnouncement_meth, msg_ref);
}
case LDKMessageSendEvent_BroadcastChannelUpdate: {
LDKChannelUpdate msg_var = obj->broadcast_channel_update.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return (*env)->NewObject(env, LDKMessageSendEvent_BroadcastChannelUpdate_class, LDKMessageSendEvent_BroadcastChannelUpdate_meth, msg_ref);
}
case LDKMessageSendEvent_SendChannelUpdate: {
int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_channel_update.node_id.compressed_form);
LDKChannelUpdate msg_var = obj->send_channel_update.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return (*env)->NewObject(env, LDKMessageSendEvent_SendChannelUpdate_class, LDKMessageSendEvent_SendChannelUpdate_meth, node_id_arr, msg_ref);
}
case LDKMessageSendEvent_HandleError: {
int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_channel_range_query.node_id.compressed_form);
LDKQueryChannelRange msg_var = obj->send_channel_range_query.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return (*env)->NewObject(env, LDKMessageSendEvent_SendChannelRangeQuery_class, LDKMessageSendEvent_SendChannelRangeQuery_meth, node_id_arr, msg_ref);
}
case LDKMessageSendEvent_SendShortIdsQuery: {
int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_short_ids_query.node_id.compressed_form);
LDKQueryShortChannelIds msg_var = obj->send_short_ids_query.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return (*env)->NewObject(env, LDKMessageSendEvent_SendShortIdsQuery_class, LDKMessageSendEvent_SendShortIdsQuery_meth, node_id_arr, msg_ref);
}
case LDKMessageSendEvent_SendReplyChannelRange: {
int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_reply_channel_range.node_id.compressed_form);
LDKReplyChannelRange msg_var = obj->send_reply_channel_range.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return (*env)->NewObject(env, LDKMessageSendEvent_SendReplyChannelRange_class, LDKMessageSendEvent_SendReplyChannelRange_meth, node_id_arr, msg_ref);
}
default: abort();
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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ 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;
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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeFeaturesDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_NodeFeaturesDecodeErrorZ *val = (LDKCResult_NodeFeaturesDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ 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);
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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelFeaturesDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ChannelFeaturesDecodeErrorZ *val = (LDKCResult_ChannelFeaturesDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKChannelFeatures 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ChannelFeaturesDecodeErrorZ *val = (LDKCResult_ChannelFeaturesDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceFeaturesDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_InvoiceFeaturesDecodeErrorZ *val = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ 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);
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.
+ err_ref = (uint64_t)err_var.inner & ~1;
+ return err_ref;
+}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScoringParametersDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ return ((LDKCResult_ScoringParametersDecodeErrorZ*)arg)->result_ok;
+}
+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);
+ 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_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;
+ 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.
+ err_ref = (uint64_t)err_var.inner & ~1;
+ return err_ref;
+}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScorerDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ return ((LDKCResult_ScorerDecodeErrorZ*)arg)->result_ok;
+}
+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);
+ 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_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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *val = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKDelayedPaymentOutputDescriptor 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *val = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *val = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKStaticPaymentOutputDescriptor 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *val = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SpendableOutputDescriptorDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_SpendableOutputDescriptorDecodeErrorZ *val = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1get_1b(JNIEnv *env, jclass clz, int64_t tuple) {
LDKC2Tuple_SignatureCVec_SignatureZZ* tuple_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)(tuple & ~1);
LDKCVec_SignatureZ ret_var = C2Tuple_SignatureCVec_SignatureZZ_get_b(tuple_conv);
- jobjectArray ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
+ jobjectArray ret_arr = NULL;
+ ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
;
for (size_t i = 0; i < ret_var.datalen; i++) {
int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 64);
(*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 64, ret_var.data[i].compact_form);
(*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr);
}
+
FREE(ret_var.data);
return ret_arr;
}
DO_ASSERT(get_jenv_res == JNI_OK);
}
LDKHolderCommitmentTransaction holder_tx_var = *holder_tx;
+ uint64_t holder_tx_ref = 0;
holder_tx_var = HolderCommitmentTransaction_clone(holder_tx);
CHECK((((uint64_t)holder_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&holder_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t holder_tx_ref = (uint64_t)holder_tx_var.inner;
+ holder_tx_ref = (uint64_t)holder_tx_var.inner;
if (holder_tx_var.is_owned) {
holder_tx_ref |= 1;
}
DO_ASSERT(get_jenv_res == JNI_OK);
}
LDKCommitmentTransaction commitment_tx_var = *commitment_tx;
+ uint64_t commitment_tx_ref = 0;
commitment_tx_var = CommitmentTransaction_clone(commitment_tx);
CHECK((((uint64_t)commitment_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&commitment_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t commitment_tx_ref = (uint64_t)commitment_tx_var.inner;
+ commitment_tx_ref = (uint64_t)commitment_tx_var.inner;
if (commitment_tx_var.is_owned) {
commitment_tx_ref |= 1;
}
DO_ASSERT(get_jenv_res == JNI_OK);
}
LDKHolderCommitmentTransaction commitment_tx_var = *commitment_tx;
+ uint64_t commitment_tx_ref = 0;
commitment_tx_var = HolderCommitmentTransaction_clone(commitment_tx);
CHECK((((uint64_t)commitment_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&commitment_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t commitment_tx_ref = (uint64_t)commitment_tx_var.inner;
+ commitment_tx_ref = (uint64_t)commitment_tx_var.inner;
if (commitment_tx_var.is_owned) {
commitment_tx_ref |= 1;
}
int8_tArray per_commitment_key_arr = (*env)->NewByteArray(env, 32);
(*env)->SetByteArrayRegion(env, per_commitment_key_arr, 0, 32, *per_commitment_key);
LDKHTLCOutputInCommitment htlc_var = *htlc;
+ uint64_t htlc_ref = 0;
htlc_var = HTLCOutputInCommitment_clone(htlc);
CHECK((((uint64_t)htlc_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&htlc_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t htlc_ref = (uint64_t)htlc_var.inner;
+ htlc_ref = (uint64_t)htlc_var.inner;
if (htlc_var.is_owned) {
htlc_ref |= 1;
}
int8_tArray per_commitment_point_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, per_commitment_point_arr, 0, 33, per_commitment_point.compressed_form);
LDKHTLCOutputInCommitment htlc_var = *htlc;
+ uint64_t htlc_ref = 0;
htlc_var = HTLCOutputInCommitment_clone(htlc);
CHECK((((uint64_t)htlc_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&htlc_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t htlc_ref = (uint64_t)htlc_var.inner;
+ htlc_ref = (uint64_t)htlc_var.inner;
if (htlc_var.is_owned) {
htlc_ref |= 1;
}
DO_ASSERT(get_jenv_res == JNI_OK);
}
LDKClosingTransaction closing_tx_var = *closing_tx;
+ uint64_t closing_tx_ref = 0;
closing_tx_var = ClosingTransaction_clone(closing_tx);
CHECK((((uint64_t)closing_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&closing_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t closing_tx_ref = (uint64_t)closing_tx_var.inner;
+ closing_tx_ref = (uint64_t)closing_tx_var.inner;
if (closing_tx_var.is_owned) {
closing_tx_ref |= 1;
}
DO_ASSERT(get_jenv_res == JNI_OK);
}
LDKUnsignedChannelAnnouncement msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = UnsignedChannelAnnouncement_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
DO_ASSERT(get_jenv_res == JNI_OK);
}
LDKChannelTransactionParameters channel_parameters_var = *channel_parameters;
+ uint64_t channel_parameters_ref = 0;
channel_parameters_var = ChannelTransactionParameters_clone(channel_parameters);
CHECK((((uint64_t)channel_parameters_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&channel_parameters_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t channel_parameters_ref = (uint64_t)channel_parameters_var.inner;
+ channel_parameters_ref = (uint64_t)channel_parameters_var.inner;
if (channel_parameters_var.is_owned) {
channel_parameters_ref |= 1;
}
if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
LDKChannelPublicKeys ret_var = LDKBaseSign_set_get_pubkeys(this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_SignDecodeErrorZ *val = (LDKCResult_SignDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
- LDKSign* res_ret =MALLOC(sizeof(LDKSign), "LDKSign");
+ LDKSign* res_ret = MALLOC(sizeof(LDKSign), "LDKSign");
*res_ret = Sign_clone(&(*val->contents.result));
return (uint64_t)res_ret;
}
LDKCResult_SignDecodeErrorZ *val = (LDKCResult_SignDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RecoverableSignatureNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_CVec_CVec_u8ZZNoneZ *val = (LDKCResult_CVec_CVec_u8ZZNoneZ*)(arg & ~1);
CHECK(val->result_ok);
LDKCVec_CVec_u8ZZ res_var = (*val->contents.result);
- jobjectArray res_arr = (*env)->NewObjectArray(env, res_var.datalen, arr_of_B_clz, NULL);
+ jobjectArray res_arr = NULL;
+ res_arr = (*env)->NewObjectArray(env, res_var.datalen, arr_of_B_clz, NULL);
;
for (size_t i = 0; i < res_var.datalen; i++) {
LDKCVec_u8Z res_conv_8_var = res_var.data[i];
(*env)->SetByteArrayRegion(env, res_conv_8_arr, 0, res_conv_8_var.datalen, res_conv_8_var.data);
(*env)->SetObjectArrayElement(env, res_arr, i, res_conv_8_arr);
}
+
return res_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1CVec_1u8ZZNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_InMemorySignerDecodeErrorZ *val = (LDKCResult_InMemorySignerDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKInMemorySigner 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InMemorySignerDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_InMemorySignerDecodeErrorZ *val = (LDKCResult_InMemorySignerDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1TxOutZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1get_1b(JNIEnv *env, jclass clz, int64_t tuple) {
LDKC2Tuple_BlockHashChannelMonitorZ* tuple_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)(tuple & ~1);
LDKChannelMonitor ret_var = C2Tuple_BlockHashChannelMonitorZ_get_b(tuple_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *val = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKCVec_C2Tuple_BlockHashChannelMonitorZZ res_var = (*val->contents.result);
- int64_tArray res_arr = (*env)->NewLongArray(env, res_var.datalen);
+ int64_tArray res_arr = NULL;
+ res_arr = (*env)->NewLongArray(env, res_var.datalen);
int64_t *res_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, res_arr, NULL);
for (size_t j = 0; j < res_var.datalen; j++) {
LDKC2Tuple_BlockHashChannelMonitorZ* res_conv_35_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ");
jclass err_conv = LDKIOError_to_java(env, (*val->contents.err));
return err_conv;
}
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
- return ((LDKCResult_PaymentIdDecodeErrorZ*)arg)->result_ok;
-}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
- LDKCResult_PaymentIdDecodeErrorZ *val = (LDKCResult_PaymentIdDecodeErrorZ*)(arg & ~1);
- CHECK(val->result_ok);
- LDKPaymentId res_var = (*val->contents.result);
- 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
- return res_ref;
-}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
- LDKCResult_PaymentIdDecodeErrorZ *val = (LDKCResult_PaymentIdDecodeErrorZ*)(arg & ~1);
- CHECK(!val->result_ok);
- LDKDecodeError err_var = (*val->contents.err);
- 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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
- return err_ref;
-}
static jclass LDKCOption_u16Z_Some_class = NULL;
static jmethodID LDKCOption_u16Z_Some_meth = NULL;
static jclass LDKCOption_u16Z_None_class = NULL;
}
case LDKAPIError_IncompatibleShutdownScript: {
LDKShutdownScript script_var = obj->incompatible_shutdown_script.script;
+ uint64_t script_ref = 0;
CHECK((((uint64_t)script_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&script_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t script_ref = (uint64_t)script_var.inner & ~1;
+ script_ref = (uint64_t)script_var.inner & ~1;
return (*env)->NewObject(env, LDKAPIError_IncompatibleShutdownScript_class, LDKAPIError_IncompatibleShutdownScript_meth, script_ref);
}
default: abort();
LDKPaymentSendFailure_PartialFailure_class =
(*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKPaymentSendFailure$PartialFailure;"));
CHECK(LDKPaymentSendFailure_PartialFailure_class != NULL);
- LDKPaymentSendFailure_PartialFailure_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_PartialFailure_class, "<init>", "([J)V");
+ LDKPaymentSendFailure_PartialFailure_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_PartialFailure_class, "<init>", "([JJ[B)V");
CHECK(LDKPaymentSendFailure_PartialFailure_meth != NULL);
}
JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentSendFailure_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
}
case LDKPaymentSendFailure_PathParameterError: {
LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error_var = obj->path_parameter_error;
- int64_tArray path_parameter_error_arr = (*env)->NewLongArray(env, path_parameter_error_var.datalen);
+ int64_tArray path_parameter_error_arr = NULL;
+ path_parameter_error_arr = (*env)->NewLongArray(env, path_parameter_error_var.datalen);
int64_t *path_parameter_error_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_parameter_error_arr, NULL);
for (size_t w = 0; w < path_parameter_error_var.datalen; w++) {
LDKCResult_NoneAPIErrorZ* path_parameter_error_conv_22_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
}
case LDKPaymentSendFailure_AllFailedRetrySafe: {
LDKCVec_APIErrorZ all_failed_retry_safe_var = obj->all_failed_retry_safe;
- int64_tArray all_failed_retry_safe_arr = (*env)->NewLongArray(env, all_failed_retry_safe_var.datalen);
+ int64_tArray all_failed_retry_safe_arr = NULL;
+ all_failed_retry_safe_arr = (*env)->NewLongArray(env, all_failed_retry_safe_var.datalen);
int64_t *all_failed_retry_safe_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, all_failed_retry_safe_arr, NULL);
for (size_t k = 0; k < all_failed_retry_safe_var.datalen; k++) {
uint64_t all_failed_retry_safe_conv_10_ref = ((uint64_t)&all_failed_retry_safe_var.data[k]) | 1;
return (*env)->NewObject(env, LDKPaymentSendFailure_AllFailedRetrySafe_class, LDKPaymentSendFailure_AllFailedRetrySafe_meth, all_failed_retry_safe_arr);
}
case LDKPaymentSendFailure_PartialFailure: {
- LDKCVec_CResult_NoneAPIErrorZZ partial_failure_var = obj->partial_failure;
- int64_tArray partial_failure_arr = (*env)->NewLongArray(env, partial_failure_var.datalen);
- int64_t *partial_failure_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, partial_failure_arr, NULL);
- for (size_t w = 0; w < partial_failure_var.datalen; w++) {
- LDKCResult_NoneAPIErrorZ* partial_failure_conv_22_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
- *partial_failure_conv_22_conv = partial_failure_var.data[w];
- *partial_failure_conv_22_conv = CResult_NoneAPIErrorZ_clone(partial_failure_conv_22_conv);
- partial_failure_arr_ptr[w] = (uint64_t)partial_failure_conv_22_conv;
+ LDKCVec_CResult_NoneAPIErrorZZ results_var = obj->partial_failure.results;
+ int64_tArray results_arr = NULL;
+ results_arr = (*env)->NewLongArray(env, results_var.datalen);
+ int64_t *results_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, results_arr, NULL);
+ for (size_t w = 0; w < results_var.datalen; w++) {
+ LDKCResult_NoneAPIErrorZ* results_conv_22_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
+ *results_conv_22_conv = results_var.data[w];
+ *results_conv_22_conv = CResult_NoneAPIErrorZ_clone(results_conv_22_conv);
+ results_arr_ptr[w] = (uint64_t)results_conv_22_conv;
+ }
+ (*env)->ReleasePrimitiveArrayCritical(env, results_arr, results_arr_ptr, 0);
+ LDKRouteParameters failed_paths_retry_var = obj->partial_failure.failed_paths_retry;
+ uint64_t failed_paths_retry_ref = 0;
+ if ((uint64_t)failed_paths_retry_var.inner > 4096) {
+ CHECK((((uint64_t)failed_paths_retry_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&failed_paths_retry_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ failed_paths_retry_ref = (uint64_t)failed_paths_retry_var.inner & ~1;
}
- (*env)->ReleasePrimitiveArrayCritical(env, partial_failure_arr, partial_failure_arr_ptr, 0);
- return (*env)->NewObject(env, LDKPaymentSendFailure_PartialFailure_class, LDKPaymentSendFailure_PartialFailure_meth, partial_failure_arr);
+ int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32);
+ (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->partial_failure.payment_id.data);
+ return (*env)->NewObject(env, LDKPaymentSendFailure_PartialFailure_class, LDKPaymentSendFailure_PartialFailure_meth, results_arr, failed_paths_retry_ref, payment_id_arr);
}
default: abort();
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdPaymentSendFailureZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
return ((LDKCResult_PaymentIdPaymentSendFailureZ*)arg)->result_ok;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdPaymentSendFailureZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdPaymentSendFailureZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_PaymentIdPaymentSendFailureZ *val = (LDKCResult_PaymentIdPaymentSendFailureZ*)(arg & ~1);
CHECK(val->result_ok);
- LDKPaymentId res_var = (*val->contents.result);
- 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
- return res_ref;
+ 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_1PaymentIdPaymentSendFailureZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_PaymentIdPaymentSendFailureZ *val = (LDKCResult_PaymentIdPaymentSendFailureZ*)(arg & ~1);
return ret_arr;
}
-static inline struct LDKPaymentId C2Tuple_PaymentHashPaymentIdZ_get_b(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR tuple){
- return PaymentId_clone(&tuple->b);
+static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentIdZ_get_b(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR tuple){
+ return ThirtyTwoBytes_clone(&tuple->b);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1get_1b(JNIEnv *env, jclass clz, int64_t tuple) {
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1get_1b(JNIEnv *env, jclass clz, int64_t tuple) {
LDKC2Tuple_PaymentHashPaymentIdZ* tuple_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)(tuple & ~1);
- LDKPaymentId ret_var = C2Tuple_PaymentHashPaymentIdZ_get_b(tuple_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
- }
- return ret_ref;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C2Tuple_PaymentHashPaymentIdZ_get_b(tuple_conv).data);
+ return ret_arr;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
DO_ASSERT(get_jenv_res == JNI_OK);
}
LDKOutPoint funding_txo_var = funding_txo;
+ uint64_t funding_txo_ref = 0;
CHECK((((uint64_t)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&funding_txo_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t funding_txo_ref = (uint64_t)funding_txo_var.inner;
+ funding_txo_ref = (uint64_t)funding_txo_var.inner;
if (funding_txo_var.is_owned) {
funding_txo_ref |= 1;
}
LDKChannelMonitor monitor_var = monitor;
+ uint64_t monitor_ref = 0;
CHECK((((uint64_t)monitor_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&monitor_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t monitor_ref = (uint64_t)monitor_var.inner;
+ monitor_ref = (uint64_t)monitor_var.inner;
if (monitor_var.is_owned) {
monitor_ref |= 1;
}
DO_ASSERT(get_jenv_res == JNI_OK);
}
LDKOutPoint funding_txo_var = funding_txo;
+ uint64_t funding_txo_ref = 0;
CHECK((((uint64_t)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&funding_txo_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t funding_txo_ref = (uint64_t)funding_txo_var.inner;
+ funding_txo_ref = (uint64_t)funding_txo_var.inner;
if (funding_txo_var.is_owned) {
funding_txo_ref |= 1;
}
LDKChannelMonitorUpdate update_var = update;
+ uint64_t update_ref = 0;
CHECK((((uint64_t)update_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&update_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t update_ref = (uint64_t)update_var.inner;
+ update_ref = (uint64_t)update_var.inner;
if (update_var.is_owned) {
update_ref |= 1;
}
if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr;
LDKCVec_MonitorEventZ ret_var = (this_arg_conv->release_pending_monitor_events)(this_arg_conv->this_arg);
- int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t o = 0; o < ret_var.datalen; o++) {
LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
LDKShutdownScript ret_var = (this_arg_conv->get_shutdown_scriptpubkey)(this_arg_conv->this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
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;
- LDKSign* ret_ret =MALLOC(sizeof(LDKSign), "LDKSign");
+ LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
*ret_ret = (this_arg_conv->get_channel_signer)(this_arg_conv->this_arg, inbound, channel_value_satoshis);
return (uint64_t)ret_ret;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelManagerZ_1get_1b(JNIEnv *env, jclass clz, int64_t tuple) {
LDKC2Tuple_BlockHashChannelManagerZ* tuple_conv = (LDKC2Tuple_BlockHashChannelManagerZ*)(tuple & ~1);
LDKChannelManager ret_var = *C2Tuple_BlockHashChannelManagerZ_get_b(tuple_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner & ~1;
+ ret_ref = (uint64_t)ret_var.inner & ~1;
return ret_ref;
}
LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *val = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelConfigDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ChannelConfigDecodeErrorZ *val = (LDKCResult_ChannelConfigDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKChannelConfig 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelConfigDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ChannelConfigDecodeErrorZ *val = (LDKCResult_ChannelConfigDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1OutPointDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_OutPointDecodeErrorZ *val = (LDKCResult_OutPointDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKOutPoint 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1OutPointDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_OutPointDecodeErrorZ *val = (LDKCResult_OutPointDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
typedef struct LDKType_JCalls {
LDKCOption_TypeZ *obj = (LDKCOption_TypeZ*)(ptr & ~1);
switch(obj->tag) {
case LDKCOption_TypeZ_Some: {
- LDKType* some_ret =MALLOC(sizeof(LDKType), "LDKType");
+ LDKType* some_ret = MALLOC(sizeof(LDKType), "LDKType");
*some_ret = Type_clone(&obj->some);
return (*env)->NewObject(env, LDKCOption_TypeZ_Some_class, LDKCOption_TypeZ_Some_meth, (uint64_t)some_ret);
}
LDKCResult_COption_TypeZDecodeErrorZ *val = (LDKCResult_COption_TypeZDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
+ return err_ref;
+}
+static jclass LDKPaymentError_Invoice_class = NULL;
+static jmethodID LDKPaymentError_Invoice_meth = NULL;
+static jclass LDKPaymentError_Routing_class = NULL;
+static jmethodID LDKPaymentError_Routing_meth = NULL;
+static jclass LDKPaymentError_Sending_class = 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;"));
+ 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;"));
+ 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;"));
+ CHECK(LDKPaymentError_Sending_class != NULL);
+ LDKPaymentError_Sending_meth = (*env)->GetMethodID(env, LDKPaymentError_Sending_class, "<init>", "(J)V");
+ CHECK(LDKPaymentError_Sending_meth != NULL);
+}
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
+ LDKPaymentError *obj = (LDKPaymentError*)(ptr & ~1);
+ switch(obj->tag) {
+ case LDKPaymentError_Invoice: {
+ LDKStr invoice_str = obj->invoice;
+ jstring invoice_conv = str_ref_to_java(env, invoice_str.chars, invoice_str.len);
+ return (*env)->NewObject(env, LDKPaymentError_Invoice_class, LDKPaymentError_Invoice_meth, invoice_conv);
+ }
+ case LDKPaymentError_Routing: {
+ LDKLightningError routing_var = obj->routing;
+ uint64_t routing_ref = 0;
+ CHECK((((uint64_t)routing_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&routing_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ routing_ref = (uint64_t)routing_var.inner & ~1;
+ return (*env)->NewObject(env, LDKPaymentError_Routing_class, LDKPaymentError_Routing_meth, routing_ref);
+ }
+ case LDKPaymentError_Sending: {
+ uint64_t sending_ref = ((uint64_t)&obj->sending) | 1;
+ return (*env)->NewObject(env, LDKPaymentError_Sending_class, LDKPaymentError_Sending_meth, sending_ref);
+ }
+ default: abort();
+ }
+}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdPaymentErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ return ((LDKCResult_PaymentIdPaymentErrorZ*)arg)->result_ok;
+}
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdPaymentErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_PaymentIdPaymentErrorZ *val = (LDKCResult_PaymentIdPaymentErrorZ*)(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_1PaymentIdPaymentErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_PaymentIdPaymentErrorZ *val = (LDKCResult_PaymentIdPaymentErrorZ*)(arg & ~1);
+ CHECK(!val->result_ok);
+ uint64_t err_ref = ((uint64_t)&(*val->contents.err)) | 1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SiPrefixNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_InvoiceNoneZ *val = (LDKCResult_InvoiceNoneZ*)(arg & ~1);
CHECK(val->result_ok);
LDKInvoice 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_SignedRawInvoiceNoneZ *val = (LDKCResult_SignedRawInvoiceNoneZ*)(arg & ~1);
CHECK(val->result_ok);
LDKSignedRawInvoice 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignedRawInvoiceNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1get_1a(JNIEnv *env, jclass clz, int64_t tuple) {
LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* tuple_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(tuple & ~1);
LDKRawInvoice ret_var = C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(tuple_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1get_1c(JNIEnv *env, jclass clz, int64_t tuple) {
LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* tuple_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(tuple & ~1);
LDKInvoiceSignature ret_var = C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(tuple_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKCResult_PayeePubKeyErrorZ *val = (LDKCResult_PayeePubKeyErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKPayeePubKey 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PayeePubKeyErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_PositiveTimestampCreationErrorZ *val = (LDKCResult_PositiveTimestampCreationErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKPositiveTimestamp 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PositiveTimestampCreationErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_InvoiceSemanticErrorZ *val = (LDKCResult_InvoiceSemanticErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKInvoice 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceSemanticErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_DescriptionCreationErrorZ *val = (LDKCResult_DescriptionCreationErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKDescription 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DescriptionCreationErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ExpiryTimeCreationErrorZ *val = (LDKCResult_ExpiryTimeCreationErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKExpiryTime 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ExpiryTimeCreationErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_PrivateRouteCreationErrorZ *val = (LDKCResult_PrivateRouteCreationErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKPrivateRoute 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PrivateRouteCreationErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ChannelMonitorUpdateDecodeErrorZ *val = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKChannelMonitorUpdate 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelMonitorUpdateDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ChannelMonitorUpdateDecodeErrorZ *val = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HTLCUpdateDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_HTLCUpdateDecodeErrorZ *val = (LDKCResult_HTLCUpdateDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKHTLCUpdate 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HTLCUpdateDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_HTLCUpdateDecodeErrorZ *val = (LDKCResult_HTLCUpdateDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneMonitorUpdateErrorZ_1result_1ok(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
static inline struct LDKOutPoint C2Tuple_OutPointScriptZ_get_a(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR tuple){
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1get_1a(JNIEnv *env, jclass clz, int64_t tuple) {
LDKC2Tuple_OutPointScriptZ* tuple_conv = (LDKC2Tuple_OutPointScriptZ*)(tuple & ~1);
LDKOutPoint ret_var = C2Tuple_OutPointScriptZ_get_a(tuple_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1get_1b(JNIEnv *env, jclass clz, int64_t tuple) {
LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* tuple_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(tuple & ~1);
LDKCVec_C2Tuple_u32ScriptZZ ret_var = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(tuple_conv);
- int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t v = 0; v < ret_var.datalen; v++) {
LDKC2Tuple_u32ScriptZ* ret_conv_21_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ");
LDKEvent_PaymentSent_class =
(*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentSent;"));
CHECK(LDKEvent_PaymentSent_class != NULL);
- LDKEvent_PaymentSent_meth = (*env)->GetMethodID(env, LDKEvent_PaymentSent_class, "<init>", "([B[B)V");
+ 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;"));
CHECK(LDKEvent_PaymentPathFailed_class != NULL);
- LDKEvent_PaymentPathFailed_meth = (*env)->GetMethodID(env, LDKEvent_PaymentPathFailed_class, "<init>", "([BZJZ[JJ)V");
+ LDKEvent_PaymentPathFailed_meth = (*env)->GetMethodID(env, LDKEvent_PaymentPathFailed_class, "<init>", "([B[BZJZ[JJJ)V");
CHECK(LDKEvent_PaymentPathFailed_meth != NULL);
LDKEvent_PendingHTLCsForwardable_class =
(*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PendingHTLCsForwardable;"));
return (*env)->NewObject(env, LDKEvent_PaymentReceived_class, LDKEvent_PaymentReceived_meth, payment_hash_arr, obj->payment_received.amt, purpose_ref);
}
case LDKEvent_PaymentSent: {
+ int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32);
+ (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->payment_sent.payment_id.data);
int8_tArray payment_preimage_arr = (*env)->NewByteArray(env, 32);
(*env)->SetByteArrayRegion(env, payment_preimage_arr, 0, 32, obj->payment_sent.payment_preimage.data);
int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
(*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_sent.payment_hash.data);
- return (*env)->NewObject(env, LDKEvent_PaymentSent_class, LDKEvent_PaymentSent_meth, payment_preimage_arr, payment_hash_arr);
+ uint64_t fee_paid_msat_ref = ((uint64_t)&obj->payment_sent.fee_paid_msat) | 1;
+ return (*env)->NewObject(env, LDKEvent_PaymentSent_class, LDKEvent_PaymentSent_meth, payment_id_arr, payment_preimage_arr, payment_hash_arr, fee_paid_msat_ref);
}
case LDKEvent_PaymentPathFailed: {
+ int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32);
+ (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->payment_path_failed.payment_id.data);
int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
(*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_path_failed.payment_hash.data);
uint64_t network_update_ref = ((uint64_t)&obj->payment_path_failed.network_update) | 1;
LDKCVec_RouteHopZ path_var = obj->payment_path_failed.path;
- int64_tArray path_arr = (*env)->NewLongArray(env, path_var.datalen);
+ 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.
- uint64_t path_conv_10_ref = (uint64_t)path_conv_10_var.inner & ~1;
+ 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);
uint64_t short_channel_id_ref = ((uint64_t)&obj->payment_path_failed.short_channel_id) | 1;
- return (*env)->NewObject(env, LDKEvent_PaymentPathFailed_class, LDKEvent_PaymentPathFailed_meth, 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);
+ LDKRouteParameters retry_var = obj->payment_path_failed.retry;
+ uint64_t retry_ref = 0;
+ if ((uint64_t)retry_var.inner > 4096) {
+ CHECK((((uint64_t)retry_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&retry_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ retry_ref = (uint64_t)retry_var.inner & ~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_PendingHTLCsForwardable: {
return (*env)->NewObject(env, LDKEvent_PendingHTLCsForwardable_class, LDKEvent_PendingHTLCsForwardable_meth, obj->pending_htl_cs_forwardable.time_forwardable);
}
case LDKEvent_SpendableOutputs: {
LDKCVec_SpendableOutputDescriptorZ outputs_var = obj->spendable_outputs.outputs;
- int64_tArray outputs_arr = (*env)->NewLongArray(env, outputs_var.datalen);
+ int64_tArray outputs_arr = NULL;
+ outputs_arr = (*env)->NewLongArray(env, outputs_var.datalen);
int64_t *outputs_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, outputs_arr, NULL);
for (size_t b = 0; b < outputs_var.datalen; b++) {
uint64_t outputs_conv_27_ref = ((uint64_t)&outputs_var.data[b]) | 1;
JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1get_1b(JNIEnv *env, jclass clz, int64_t tuple) {
LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* tuple_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(tuple & ~1);
LDKCVec_C2Tuple_u32TxOutZZ ret_var = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(tuple_conv);
- int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t u = 0; u < ret_var.datalen; u++) {
LDKC2Tuple_u32TxOutZ* ret_conv_20_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ");
LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *val = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneLightningErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_NoneLightningErrorZ *val = (LDKCResult_NoneLightningErrorZ*)(arg & ~1);
CHECK(!val->result_ok);
LDKLightningError 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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
static inline struct LDKPublicKey C2Tuple_PublicKeyTypeZ_get_a(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR tuple){
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1get_1b(JNIEnv *env, jclass clz, int64_t tuple) {
LDKC2Tuple_PublicKeyTypeZ* tuple_conv = (LDKC2Tuple_PublicKeyTypeZ*)(tuple & ~1);
- LDKType* ret_ret =MALLOC(sizeof(LDKType), "LDKType");
+ LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType");
*ret_ret = C2Tuple_PublicKeyTypeZ_get_b(tuple_conv);
return (uint64_t)ret_ret;
}
LDKCResult_boolLightningErrorZ *val = (LDKCResult_boolLightningErrorZ*)(arg & ~1);
CHECK(!val->result_ok);
LDKLightningError 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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
static inline struct LDKChannelAnnouncement C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR tuple){
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1get_1a(JNIEnv *env, jclass clz, int64_t tuple) {
LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* tuple_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(tuple & ~1);
LDKChannelAnnouncement ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(tuple_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1get_1b(JNIEnv *env, jclass clz, int64_t tuple) {
LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* tuple_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(tuple & ~1);
LDKChannelUpdate ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(tuple_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1get_1c(JNIEnv *env, jclass clz, int64_t tuple) {
LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* tuple_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(tuple & ~1);
LDKChannelUpdate ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(tuple_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKCResult_CVec_u8ZPeerHandleErrorZ *val = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)(arg & ~1);
CHECK(!val->result_ok);
LDKPeerHandleError 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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePeerHandleErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_NonePeerHandleErrorZ *val = (LDKCResult_NonePeerHandleErrorZ*)(arg & ~1);
CHECK(!val->result_ok);
LDKPeerHandleError 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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolPeerHandleErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_boolPeerHandleErrorZ *val = (LDKCResult_boolPeerHandleErrorZ*)(arg & ~1);
CHECK(!val->result_ok);
LDKPeerHandleError 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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeIdDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_NodeIdDecodeErrorZ *val = (LDKCResult_NodeIdDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKNodeId 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeIdDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_NodeIdDecodeErrorZ *val = (LDKCResult_NodeIdDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
typedef struct LDKAccess_JCalls {
LDKCOption_AccessZ *obj = (LDKCOption_AccessZ*)(ptr & ~1);
switch(obj->tag) {
case LDKCOption_AccessZ_Some: {
- LDKAccess* some_ret =MALLOC(sizeof(LDKAccess), "LDKAccess");
+ LDKAccess* some_ret = MALLOC(sizeof(LDKAccess), "LDKAccess");
*some_ret = obj->some;
// Warning: We likely need to clone here, but no clone is available, so we just do it for Java instances
if ((*some_ret).free == LDKAccess_JCalls_free) {
LDKCResult_DirectionalChannelInfoDecodeErrorZ *val = (LDKCResult_DirectionalChannelInfoDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKDirectionalChannelInfo 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DirectionalChannelInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_DirectionalChannelInfoDecodeErrorZ *val = (LDKCResult_DirectionalChannelInfoDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelInfoDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ChannelInfoDecodeErrorZ *val = (LDKCResult_ChannelInfoDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKChannelInfo 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ChannelInfoDecodeErrorZ *val = (LDKCResult_ChannelInfoDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RoutingFeesDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_RoutingFeesDecodeErrorZ *val = (LDKCResult_RoutingFeesDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKRoutingFees 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RoutingFeesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_RoutingFeesDecodeErrorZ *val = (LDKCResult_RoutingFeesDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeAnnouncementInfoDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_NodeAnnouncementInfoDecodeErrorZ *val = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKNodeAnnouncementInfo 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeAnnouncementInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_NodeAnnouncementInfoDecodeErrorZ *val = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1u64Z_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
LDKCResult_NodeInfoDecodeErrorZ *val = (LDKCResult_NodeInfoDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKNodeInfo 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_NodeInfoDecodeErrorZ *val = (LDKCResult_NodeInfoDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetworkGraphDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_NetworkGraphDecodeErrorZ *val = (LDKCResult_NetworkGraphDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKNetworkGraph 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetworkGraphDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_NetworkGraphDecodeErrorZ *val = (LDKCResult_NetworkGraphDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
static jclass LDKCOption_CVec_NetAddressZZ_Some_class = NULL;
switch(obj->tag) {
case LDKCOption_CVec_NetAddressZZ_Some: {
LDKCVec_NetAddressZ some_var = obj->some;
- int64_tArray some_arr = (*env)->NewLongArray(env, some_var.datalen);
+ int64_tArray some_arr = NULL;
+ some_arr = (*env)->NewLongArray(env, some_var.datalen);
int64_t *some_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, some_arr, NULL);
for (size_t m = 0; m < some_var.datalen; m++) {
uint64_t some_conv_12_ref = ((uint64_t)&some_var.data[m]) | 1;
default: abort();
}
}
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetAddressu8Z_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
- return ((LDKCResult_NetAddressu8Z*)arg)->result_ok;
-}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetAddressu8Z_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
- LDKCResult_NetAddressu8Z *val = (LDKCResult_NetAddressu8Z*)(arg & ~1);
- CHECK(val->result_ok);
- uint64_t res_ref = ((uint64_t)&(*val->contents.result)) | 1;
- return res_ref;
-}
-JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetAddressu8Z_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
- LDKCResult_NetAddressu8Z *val = (LDKCResult_NetAddressu8Z*)(arg & ~1);
- CHECK(!val->result_ok);
- return *val->contents.err;
-}
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CResult_1NetAddressu8ZDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
- return ((LDKCResult_CResult_NetAddressu8ZDecodeErrorZ*)arg)->result_ok;
-}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CResult_1NetAddressu8ZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
- LDKCResult_CResult_NetAddressu8ZDecodeErrorZ *val = (LDKCResult_CResult_NetAddressu8ZDecodeErrorZ*)(arg & ~1);
- CHECK(val->result_ok);
- LDKCResult_NetAddressu8Z* res_conv = MALLOC(sizeof(LDKCResult_NetAddressu8Z), "LDKCResult_NetAddressu8Z");
- *res_conv = (*val->contents.result);
- *res_conv = CResult_NetAddressu8Z_clone(res_conv);
- return (uint64_t)res_conv;
-}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CResult_1NetAddressu8ZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
- LDKCResult_CResult_NetAddressu8ZDecodeErrorZ *val = (LDKCResult_CResult_NetAddressu8ZDecodeErrorZ*)(arg & ~1);
- CHECK(!val->result_ok);
- LDKDecodeError err_var = (*val->contents.err);
- 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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
- return err_ref;
-}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetAddressDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
return ((LDKCResult_NetAddressDecodeErrorZ*)arg)->result_ok;
}
LDKCResult_NetAddressDecodeErrorZ *val = (LDKCResult_NetAddressDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1UpdateAddHTLCZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
LDKCResult_AcceptChannelDecodeErrorZ *val = (LDKCResult_AcceptChannelDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKAcceptChannel 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1AcceptChannelDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_AcceptChannelDecodeErrorZ *val = (LDKCResult_AcceptChannelDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1AnnouncementSignaturesDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_AnnouncementSignaturesDecodeErrorZ *val = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKAnnouncementSignatures 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1AnnouncementSignaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_AnnouncementSignaturesDecodeErrorZ *val = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelReestablishDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ChannelReestablishDecodeErrorZ *val = (LDKCResult_ChannelReestablishDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKChannelReestablish 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelReestablishDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ChannelReestablishDecodeErrorZ *val = (LDKCResult_ChannelReestablishDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ClosingSignedDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ClosingSignedDecodeErrorZ *val = (LDKCResult_ClosingSignedDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKClosingSigned 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ClosingSignedDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ClosingSignedDecodeErrorZ *val = (LDKCResult_ClosingSignedDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ClosingSignedFeeRangeDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *val = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKClosingSignedFeeRange 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ClosingSignedFeeRangeDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *val = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CommitmentSignedDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_CommitmentSignedDecodeErrorZ *val = (LDKCResult_CommitmentSignedDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKCommitmentSigned 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CommitmentSignedDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_CommitmentSignedDecodeErrorZ *val = (LDKCResult_CommitmentSignedDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingCreatedDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_FundingCreatedDecodeErrorZ *val = (LDKCResult_FundingCreatedDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKFundingCreated 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingCreatedDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_FundingCreatedDecodeErrorZ *val = (LDKCResult_FundingCreatedDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingSignedDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_FundingSignedDecodeErrorZ *val = (LDKCResult_FundingSignedDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKFundingSigned 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingSignedDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_FundingSignedDecodeErrorZ *val = (LDKCResult_FundingSignedDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingLockedDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_FundingLockedDecodeErrorZ *val = (LDKCResult_FundingLockedDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKFundingLocked 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingLockedDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_FundingLockedDecodeErrorZ *val = (LDKCResult_FundingLockedDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_InitDecodeErrorZ *val = (LDKCResult_InitDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKInit 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_InitDecodeErrorZ *val = (LDKCResult_InitDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1OpenChannelDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_OpenChannelDecodeErrorZ *val = (LDKCResult_OpenChannelDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKOpenChannel 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1OpenChannelDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_OpenChannelDecodeErrorZ *val = (LDKCResult_OpenChannelDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RevokeAndACKDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_RevokeAndACKDecodeErrorZ *val = (LDKCResult_RevokeAndACKDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKRevokeAndACK 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RevokeAndACKDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_RevokeAndACKDecodeErrorZ *val = (LDKCResult_RevokeAndACKDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ShutdownDecodeErrorZ *val = (LDKCResult_ShutdownDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKShutdown 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ShutdownDecodeErrorZ *val = (LDKCResult_ShutdownDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFailHTLCDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_UpdateFailHTLCDecodeErrorZ *val = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKUpdateFailHTLC 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFailHTLCDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_UpdateFailHTLCDecodeErrorZ *val = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFailMalformedHTLCDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *val = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKUpdateFailMalformedHTLC 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFailMalformedHTLCDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *val = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFeeDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_UpdateFeeDecodeErrorZ *val = (LDKCResult_UpdateFeeDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKUpdateFee 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFeeDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_UpdateFeeDecodeErrorZ *val = (LDKCResult_UpdateFeeDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFulfillHTLCDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_UpdateFulfillHTLCDecodeErrorZ *val = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKUpdateFulfillHTLC 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFulfillHTLCDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_UpdateFulfillHTLCDecodeErrorZ *val = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateAddHTLCDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_UpdateAddHTLCDecodeErrorZ *val = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKUpdateAddHTLC 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateAddHTLCDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_UpdateAddHTLCDecodeErrorZ *val = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PingDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_PingDecodeErrorZ *val = (LDKCResult_PingDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKPing 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PingDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_PingDecodeErrorZ *val = (LDKCResult_PingDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PongDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_PongDecodeErrorZ *val = (LDKCResult_PongDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKPong 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PongDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_PongDecodeErrorZ *val = (LDKCResult_PongDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannelAnnouncementDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *val = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKUnsignedChannelAnnouncement 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannelAnnouncementDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *val = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelAnnouncementDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ChannelAnnouncementDecodeErrorZ *val = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKChannelAnnouncement 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelAnnouncementDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ChannelAnnouncementDecodeErrorZ *val = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannelUpdateDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_UnsignedChannelUpdateDecodeErrorZ *val = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKUnsignedChannelUpdate 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannelUpdateDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_UnsignedChannelUpdateDecodeErrorZ *val = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelUpdateDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ChannelUpdateDecodeErrorZ *val = (LDKCResult_ChannelUpdateDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKChannelUpdate 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelUpdateDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ChannelUpdateDecodeErrorZ *val = (LDKCResult_ChannelUpdateDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ErrorMessageDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ErrorMessageDecodeErrorZ *val = (LDKCResult_ErrorMessageDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKErrorMessage 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ErrorMessageDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ErrorMessageDecodeErrorZ *val = (LDKCResult_ErrorMessageDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedNodeAnnouncementDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *val = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKUnsignedNodeAnnouncement 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedNodeAnnouncementDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *val = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeAnnouncementDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_NodeAnnouncementDecodeErrorZ *val = (LDKCResult_NodeAnnouncementDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKNodeAnnouncement 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeAnnouncementDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_NodeAnnouncementDecodeErrorZ *val = (LDKCResult_NodeAnnouncementDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryShortChannelIdsDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_QueryShortChannelIdsDecodeErrorZ *val = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKQueryShortChannelIds 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryShortChannelIdsDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_QueryShortChannelIdsDecodeErrorZ *val = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyShortChannelIdsEndDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *val = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKReplyShortChannelIdsEnd 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyShortChannelIdsEndDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *val = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryChannelRangeDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_QueryChannelRangeDecodeErrorZ *val = (LDKCResult_QueryChannelRangeDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKQueryChannelRange 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryChannelRangeDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_QueryChannelRangeDecodeErrorZ *val = (LDKCResult_QueryChannelRangeDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyChannelRangeDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ReplyChannelRangeDecodeErrorZ *val = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKReplyChannelRange 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyChannelRangeDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_ReplyChannelRangeDecodeErrorZ *val = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1GossipTimestampFilterDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_GossipTimestampFilterDecodeErrorZ *val = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKGossipTimestampFilter 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1GossipTimestampFilterDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_GossipTimestampFilterDecodeErrorZ *val = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
static jclass LDKSignOrCreationError_SignError_class = NULL;
LDKCResult_InvoiceSignOrCreationErrorZ *val = (LDKCResult_InvoiceSignOrCreationErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKInvoice 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceSignOrCreationErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
DO_ASSERT(get_jenv_res == JNI_OK);
}
LDKWatchedOutput output_var = output;
+ uint64_t output_ref = 0;
CHECK((((uint64_t)output_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&output_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t output_ref = (uint64_t)output_var.inner;
+ output_ref = (uint64_t)output_var.inner;
if (output_var.is_owned) {
output_ref |= 1;
}
LDKCOption_FilterZ *obj = (LDKCOption_FilterZ*)(ptr & ~1);
switch(obj->tag) {
case LDKCOption_FilterZ_Some: {
- LDKFilter* some_ret =MALLOC(sizeof(LDKFilter), "LDKFilter");
+ LDKFilter* some_ret = MALLOC(sizeof(LDKFilter), "LDKFilter");
*some_ret = obj->some;
// Warning: We likely need to clone here, but no clone is available, so we just do it for Java instances
if ((*some_ret).free == LDKFilter_JCalls_free) {
LDKCResult_LockedChannelMonitorNoneZ *val = (LDKCResult_LockedChannelMonitorNoneZ*)(arg & ~1);
CHECK(val->result_ok);
LDKLockedChannelMonitor 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1LockedChannelMonitorNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
LDKMessageSendEventsProvider* this_arg_conv = (LDKMessageSendEventsProvider*)this_arg_ptr;
LDKCVec_MessageSendEventZ ret_var = (this_arg_conv->get_and_clear_pending_msg_events)(this_arg_conv->this_arg);
- int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t s = 0; s < ret_var.datalen; s++) {
LDKMessageSendEvent *ret_conv_18_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
} else {
DO_ASSERT(get_jenv_res == JNI_OK);
}
- LDKEventHandler* handler_ret =MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
+ LDKEventHandler* handler_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
*handler_ret = handler;
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
int8_tArray header_arr = (*env)->NewByteArray(env, 80);
(*env)->SetByteArrayRegion(env, header_arr, 0, 80, *header);
LDKCVec_C2Tuple_usizeTransactionZZ txdata_var = txdata;
- int64_tArray txdata_arr = (*env)->NewLongArray(env, txdata_var.datalen);
+ int64_tArray txdata_arr = NULL;
+ txdata_arr = (*env)->NewLongArray(env, txdata_var.datalen);
int64_t *txdata_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, txdata_arr, NULL);
for (size_t c = 0; c < txdata_var.datalen; c++) {
LDKC2Tuple_usizeTransactionZ* txdata_conv_28_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
LDKCVec_TxidZ ret_var = (this_arg_conv->get_relevant_txids)(this_arg_conv->this_arg);
- jobjectArray ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
+ jobjectArray ret_arr = NULL;
+ ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
;
for (size_t i = 0; i < ret_var.datalen; i++) {
int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 32);
(*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 32, ret_var.data[i].data);
(*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr);
}
+
FREE(ret_var.data);
return ret_arr;
}
FREE(j_calls);
}
}
-LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint id, const LDKChannelMonitor * data) {
+LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) {
LDKPersist_JCalls *j_calls = (LDKPersist_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);
}
- LDKOutPoint id_var = id;
- CHECK((((uint64_t)id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
- CHECK((((uint64_t)&id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t id_ref = (uint64_t)id_var.inner;
- if (id_var.is_owned) {
- id_ref |= 1;
+ LDKOutPoint channel_id_var = channel_id;
+ uint64_t channel_id_ref = 0;
+ CHECK((((uint64_t)channel_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&channel_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ channel_id_ref = (uint64_t)channel_id_var.inner;
+ if (channel_id_var.is_owned) {
+ channel_id_ref |= 1;
}
LDKChannelMonitor data_var = *data;
+ uint64_t data_ref = 0;
data_var = ChannelMonitor_clone(data);
CHECK((((uint64_t)data_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&data_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t data_ref = (uint64_t)data_var.inner;
+ data_ref = (uint64_t)data_var.inner;
if (data_var.is_owned) {
data_ref |= 1;
}
+ LDKMonitorUpdateId update_id_var = update_id;
+ uint64_t update_id_ref = 0;
+ CHECK((((uint64_t)update_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&update_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ update_id_ref = (uint64_t)update_id_var.inner;
+ if (update_id_var.is_owned) {
+ update_id_ref |= 1;
+ }
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
- uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->persist_new_channel_meth, id_ref, data_ref);
+ 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)) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to persist_new_channel in LDKPersist from rust threw an exception.");
}
return ret_conv;
}
-LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint id, const LDKChannelMonitorUpdate * update, const LDKChannelMonitor * data) {
+LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, const LDKChannelMonitorUpdate * update, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) {
LDKPersist_JCalls *j_calls = (LDKPersist_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);
}
- LDKOutPoint id_var = id;
- CHECK((((uint64_t)id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
- CHECK((((uint64_t)&id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t id_ref = (uint64_t)id_var.inner;
- if (id_var.is_owned) {
- id_ref |= 1;
+ LDKOutPoint channel_id_var = channel_id;
+ uint64_t channel_id_ref = 0;
+ CHECK((((uint64_t)channel_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&channel_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ channel_id_ref = (uint64_t)channel_id_var.inner;
+ if (channel_id_var.is_owned) {
+ channel_id_ref |= 1;
}
LDKChannelMonitorUpdate update_var = *update;
- update_var = ChannelMonitorUpdate_clone(update);
- CHECK((((uint64_t)update_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
- CHECK((((uint64_t)&update_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t update_ref = (uint64_t)update_var.inner;
- if (update_var.is_owned) {
- update_ref |= 1;
+ uint64_t update_ref = 0;
+ if ((uint64_t)update_var.inner > 4096) {
+ update_var = ChannelMonitorUpdate_clone(update);
+ CHECK((((uint64_t)update_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&update_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ update_ref = (uint64_t)update_var.inner;
+ if (update_var.is_owned) {
+ update_ref |= 1;
+ }
}
LDKChannelMonitor data_var = *data;
+ uint64_t data_ref = 0;
data_var = ChannelMonitor_clone(data);
CHECK((((uint64_t)data_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&data_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t data_ref = (uint64_t)data_var.inner;
+ data_ref = (uint64_t)data_var.inner;
if (data_var.is_owned) {
data_ref |= 1;
}
+ LDKMonitorUpdateId update_id_var = update_id;
+ uint64_t update_id_ref = 0;
+ CHECK((((uint64_t)update_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&update_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ update_id_ref = (uint64_t)update_id_var.inner;
+ if (update_id_var.is_owned) {
+ update_id_ref |= 1;
+ }
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
- uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->update_persisted_channel_meth, id_ref, update_ref, data_ref);
+ 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)) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to update_persisted_channel in LDKPersist 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->persist_new_channel_meth = (*env)->GetMethodID(env, c, "persist_new_channel", "(JJ)J");
+ calls->persist_new_channel_meth = (*env)->GetMethodID(env, c, "persist_new_channel", "(JJJ)J");
CHECK(calls->persist_new_channel_meth != NULL);
- calls->update_persisted_channel_meth = (*env)->GetMethodID(env, c, "update_persisted_channel", "(JJJ)J");
+ calls->update_persisted_channel_meth = (*env)->GetMethodID(env, c, "update_persisted_channel", "(JJJJ)J");
CHECK(calls->update_persisted_channel_meth != NULL);
LDKPersist ret = {
*res_ptr = LDKPersist_init(env, clz, o);
return (uint64_t)res_ptr;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Persist_1persist_1new_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t id, int64_t data) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Persist_1persist_1new_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_id, int64_t data, int64_t update_id) {
void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr;
- LDKOutPoint id_conv;
- id_conv.inner = (void*)(id & (~1));
- id_conv.is_owned = (id & 1) || (id == 0);
- id_conv = OutPoint_clone(&id_conv);
+ LDKOutPoint channel_id_conv;
+ channel_id_conv.inner = (void*)(channel_id & (~1));
+ channel_id_conv.is_owned = (channel_id & 1) || (channel_id == 0);
+ channel_id_conv = OutPoint_clone(&channel_id_conv);
LDKChannelMonitor data_conv;
data_conv.inner = (void*)(data & (~1));
data_conv.is_owned = false;
+ LDKMonitorUpdateId update_id_conv;
+ update_id_conv.inner = (void*)(update_id & (~1));
+ update_id_conv.is_owned = (update_id & 1) || (update_id == 0);
+ update_id_conv = MonitorUpdateId_clone(&update_id_conv);
LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
- *ret_conv = (this_arg_conv->persist_new_channel)(this_arg_conv->this_arg, id_conv, &data_conv);
+ *ret_conv = (this_arg_conv->persist_new_channel)(this_arg_conv->this_arg, channel_id_conv, &data_conv, update_id_conv);
return (uint64_t)ret_conv;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Persist_1update_1persisted_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t id, int64_t update, int64_t data) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Persist_1update_1persisted_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_id, int64_t update, int64_t data, int64_t update_id) {
void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr;
- LDKOutPoint id_conv;
- id_conv.inner = (void*)(id & (~1));
- id_conv.is_owned = (id & 1) || (id == 0);
- id_conv = OutPoint_clone(&id_conv);
+ LDKOutPoint channel_id_conv;
+ channel_id_conv.inner = (void*)(channel_id & (~1));
+ channel_id_conv.is_owned = (channel_id & 1) || (channel_id == 0);
+ channel_id_conv = OutPoint_clone(&channel_id_conv);
LDKChannelMonitorUpdate update_conv;
update_conv.inner = (void*)(update & (~1));
update_conv.is_owned = false;
LDKChannelMonitor data_conv;
data_conv.inner = (void*)(data & (~1));
data_conv.is_owned = false;
+ LDKMonitorUpdateId update_id_conv;
+ update_id_conv.inner = (void*)(update_id & (~1));
+ update_id_conv.is_owned = (update_id & 1) || (update_id == 0);
+ update_id_conv = MonitorUpdateId_clone(&update_id_conv);
LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
- *ret_conv = (this_arg_conv->update_persisted_channel)(this_arg_conv->this_arg, id_conv, &update_conv, &data_conv);
+ *ret_conv = (this_arg_conv->update_persisted_channel)(this_arg_conv->this_arg, channel_id_conv, &update_conv, &data_conv, update_id_conv);
return (uint64_t)ret_conv;
}
int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
LDKInitFeatures their_features_var = their_features;
+ uint64_t their_features_ref = 0;
CHECK((((uint64_t)their_features_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&their_features_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t their_features_ref = (uint64_t)their_features_var.inner;
+ their_features_ref = (uint64_t)their_features_var.inner;
if (their_features_var.is_owned) {
their_features_ref |= 1;
}
LDKOpenChannel msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = OpenChannel_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
LDKInitFeatures their_features_var = their_features;
+ uint64_t their_features_ref = 0;
CHECK((((uint64_t)their_features_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&their_features_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t their_features_ref = (uint64_t)their_features_var.inner;
+ their_features_ref = (uint64_t)their_features_var.inner;
if (their_features_var.is_owned) {
their_features_ref |= 1;
}
LDKAcceptChannel msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = AcceptChannel_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
LDKFundingCreated msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = FundingCreated_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
LDKFundingSigned msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = FundingSigned_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
LDKFundingLocked msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = FundingLocked_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
LDKInitFeatures their_features_var = *their_features;
+ uint64_t their_features_ref = 0;
their_features_var = InitFeatures_clone(their_features);
CHECK((((uint64_t)their_features_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&their_features_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t their_features_ref = (uint64_t)their_features_var.inner;
+ their_features_ref = (uint64_t)their_features_var.inner;
if (their_features_var.is_owned) {
their_features_ref |= 1;
}
LDKShutdown msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = Shutdown_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
LDKClosingSigned msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = ClosingSigned_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
LDKUpdateAddHTLC msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = UpdateAddHTLC_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
LDKUpdateFulfillHTLC msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = UpdateFulfillHTLC_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
LDKUpdateFailHTLC msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = UpdateFailHTLC_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
LDKUpdateFailMalformedHTLC msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = UpdateFailMalformedHTLC_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
LDKCommitmentSigned msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = CommitmentSigned_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
LDKRevokeAndACK msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = RevokeAndACK_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
LDKUpdateFee msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = UpdateFee_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
LDKAnnouncementSignatures msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = AnnouncementSignatures_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
LDKInit msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = Init_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
LDKChannelReestablish msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = ChannelReestablish_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
LDKChannelUpdate msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = ChannelUpdate_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
LDKErrorMessage msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = ErrorMessage_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
DO_ASSERT(get_jenv_res == JNI_OK);
}
LDKNodeAnnouncement msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = NodeAnnouncement_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
DO_ASSERT(get_jenv_res == JNI_OK);
}
LDKChannelAnnouncement msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = ChannelAnnouncement_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
DO_ASSERT(get_jenv_res == JNI_OK);
}
LDKChannelUpdate msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = ChannelUpdate_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
LDKInit init_var = *init;
+ uint64_t init_ref = 0;
init_var = Init_clone(init);
CHECK((((uint64_t)init_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&init_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t init_ref = (uint64_t)init_var.inner;
+ init_ref = (uint64_t)init_var.inner;
if (init_var.is_owned) {
init_ref |= 1;
}
int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
LDKReplyChannelRange msg_var = msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
LDKReplyShortChannelIdsEnd msg_var = msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
LDKQueryChannelRange msg_var = msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
LDKQueryShortChannelIds msg_var = msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret_var = (this_arg_conv->get_next_channel_announcements)(this_arg_conv->this_arg, starting_point, batch_amount);
- int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t h = 0; h < ret_var.datalen; h++) {
LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv_59_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
CHECK((*env)->GetArrayLength(env, starting_point) == 33);
(*env)->GetByteArrayRegion(env, starting_point, 0, 33, starting_point_ref.compressed_form);
LDKCVec_NodeAnnouncementZ ret_var = (this_arg_conv->get_next_node_announcements)(this_arg_conv->this_arg, starting_point_ref, batch_amount);
- int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t s = 0; s < ret_var.datalen; s++) {
LDKNodeAnnouncement ret_conv_18_var = ret_var.data[s];
+ uint64_t ret_conv_18_ref = 0;
CHECK((((uint64_t)ret_conv_18_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_conv_18_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t ret_conv_18_ref = (uint64_t)ret_conv_18_var.inner;
+ ret_conv_18_ref = (uint64_t)ret_conv_18_var.inner;
if (ret_conv_18_var.is_owned) {
ret_conv_18_ref |= 1;
}
} else {
DO_ASSERT(get_jenv_res == JNI_OK);
}
- LDKType* msg_ret =MALLOC(sizeof(LDKType), "LDKType");
+ LDKType* msg_ret = MALLOC(sizeof(LDKType), "LDKType");
*msg_ret = msg;
int8_tArray sender_node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, sender_node_id_arr, 0, 33, sender_node_id.compressed_form);
if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
LDKCustomMessageHandler* this_arg_conv = (LDKCustomMessageHandler*)this_arg_ptr;
LDKCVec_C2Tuple_PublicKeyTypeZZ ret_var = (this_arg_conv->get_and_clear_pending_msg)(this_arg_conv->this_arg);
- int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t z = 0; z < ret_var.datalen; z++) {
LDKC2Tuple_PublicKeyTypeZ* ret_conv_25_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ");
JavaVM *vm;
jweak o;
jmethodID channel_penalty_msat_meth;
+ jmethodID payment_path_failed_meth;
+ jmethodID write_meth;
} LDKScore_JCalls;
static void LDKScore_JCalls_free(void* this_arg) {
LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
FREE(j_calls);
}
}
-uint64_t channel_penalty_msat_LDKScore_jcall(const void* this_arg, uint64_t short_channel_id) {
+uint64_t channel_penalty_msat_LDKScore_jcall(const void* this_arg, uint64_t short_channel_id, 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);
}
+ LDKNodeId source_var = *source;
+ uint64_t source_ref = 0;
+ source_var = NodeId_clone(source);
+ CHECK((((uint64_t)source_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&source_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ source_ref = (uint64_t)source_var.inner;
+ if (source_var.is_owned) {
+ source_ref |= 1;
+ }
+ LDKNodeId target_var = *target;
+ uint64_t target_ref = 0;
+ target_var = NodeId_clone(target);
+ CHECK((((uint64_t)target_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&target_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ target_ref = (uint64_t)target_var.inner;
+ if (target_var.is_owned) {
+ target_ref |= 1;
+ }
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);
+ int64_t ret = (*env)->CallLongMethod(env, obj, j_calls->channel_penalty_msat_meth, short_channel_id, source_ref, target_ref);
if ((*env)->ExceptionCheck(env)) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to channel_penalty_msat in LDKScore from rust threw an exception.");
}
return ret;
}
+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;
+ 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.
+ 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_failed_meth, path_arr, short_channel_id);
+ if ((*env)->ExceptionCheck(env)) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to payment_path_failed 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;
+ 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->write_meth);
+ if ((*env)->ExceptionCheck(env)) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to write in LDKScore from rust threw an exception.");
+ }
+ LDKCVec_u8Z ret_ref;
+ ret_ref.datalen = (*env)->GetArrayLength(env, ret);
+ ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
+ (*env)->GetByteArrayRegion(env, ret, 0, ret_ref.datalen, 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 LDKScore_JCalls_cloned(LDKScore* new_obj) {
LDKScore_JCalls *j_calls = (LDKScore_JCalls*) new_obj->this_arg;
atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
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", "(J)J");
+ calls->channel_penalty_msat_meth = (*env)->GetMethodID(env, c, "channel_penalty_msat", "(JJJ)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->write_meth = (*env)->GetMethodID(env, c, "write", "()[B");
+ CHECK(calls->write_meth != NULL);
LDKScore ret = {
.this_arg = (void*) calls,
.channel_penalty_msat = channel_penalty_msat_LDKScore_jcall,
+ .payment_path_failed = payment_path_failed_LDKScore_jcall,
+ .write = write_LDKScore_jcall,
.free = LDKScore_JCalls_free,
};
return ret;
*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) {
+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) {
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;
- int64_t ret_val = (this_arg_conv->channel_penalty_msat)(this_arg_conv->this_arg, short_channel_id);
+ LDKNodeId source_conv;
+ source_conv.inner = (void*)(source & (~1));
+ source_conv.is_owned = false;
+ LDKNodeId target_conv;
+ target_conv.inner = (void*)(target & (~1));
+ target_conv.is_owned = false;
+ int64_t ret_val = (this_arg_conv->channel_penalty_msat)(this_arg_conv->this_arg, short_channel_id, &source_conv, &target_conv);
return ret_val;
}
-typedef struct LDKChannelManagerPersister_JCalls {
- atomic_size_t refcnt;
- JavaVM *vm;
- jweak o;
- jmethodID persist_manager_meth;
-} LDKChannelManagerPersister_JCalls;
-static void LDKChannelManagerPersister_JCalls_free(void* this_arg) {
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1payment_1path_1failed(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray path, int64_t short_channel_id) {
+ 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);
+ 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_failed)(this_arg_conv->this_arg, path_constr, short_channel_id);
+}
+
+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); }
+ LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
+ LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
+ 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;
+}
+
+typedef struct LDKChannelManagerPersister_JCalls {
+ atomic_size_t refcnt;
+ JavaVM *vm;
+ jweak o;
+ jmethodID persist_manager_meth;
+} LDKChannelManagerPersister_JCalls;
+static void LDKChannelManagerPersister_JCalls_free(void* this_arg) {
LDKChannelManagerPersister_JCalls *j_calls = (LDKChannelManagerPersister_JCalls*) this_arg;
if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
JNIEnv *env;
DO_ASSERT(get_jenv_res == JNI_OK);
}
LDKChannelManager channel_manager_var = *channel_manager;
+ uint64_t channel_manager_ref = 0;
// Warning: we may need a move here but no clone is available for LDKChannelManager
CHECK((((uint64_t)channel_manager_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&channel_manager_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t channel_manager_ref = (uint64_t)channel_manager_var.inner;
+ channel_manager_ref = (uint64_t)channel_manager_var.inner;
if (channel_manager_var.is_owned) {
channel_manager_ref |= 1;
}
default: abort();
}
}
-JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings__1ldk_1get_1compiled_1version(JNIEnv *env, jclass clz) {
- LDKStr ret_str = _ldk_get_compiled_version();
- jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
- Str_free(ret_str);
- return ret_conv;
+typedef struct LDKPayer_JCalls {
+ atomic_size_t refcnt;
+ JavaVM *vm;
+ jweak o;
+ jmethodID node_id_meth;
+ jmethodID first_hops_meth;
+ jmethodID send_payment_meth;
+ jmethodID retry_payment_meth;
+} LDKPayer_JCalls;
+static void LDKPayer_JCalls_free(void* this_arg) {
+ LDKPayer_JCalls *j_calls = (LDKPayer_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);
+ }
}
-
-JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings__1ldk_1c_1bindings_1get_1compiled_1version(JNIEnv *env, jclass clz) {
- LDKStr ret_str = _ldk_c_bindings_get_compiled_version();
- jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
- Str_free(ret_str);
+LDKPublicKey node_id_LDKPayer_jcall(const void* this_arg) {
+ 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);
+ }
+ 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)) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to node_id in LDKPayer from rust threw an exception.");
+ }
+ LDKPublicKey ret_ref;
+ CHECK((*env)->GetArrayLength(env, ret) == 33);
+ (*env)->GetByteArrayRegion(env, ret, 0, 33, ret_ref.compressed_form);
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
+ }
+ return ret_ref;
+}
+LDKCVec_ChannelDetailsZ first_hops_LDKPayer_jcall(const void* this_arg) {
+ 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);
+ }
+ 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)) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to first_hops in LDKPayer from rust threw an exception.");
+ }
+ LDKCVec_ChannelDetailsZ ret_constr;
+ ret_constr.datalen = (*env)->GetArrayLength(env, ret);
+ if (ret_constr.datalen > 0)
+ ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
+ else
+ ret_constr.data = NULL;
+ int64_t* ret_vals = (*env)->GetLongArrayElements (env, ret, NULL);
+ for (size_t q = 0; q < ret_constr.datalen; q++) {
+ int64_t ret_conv_16 = ret_vals[q];
+ LDKChannelDetails ret_conv_16_conv;
+ ret_conv_16_conv.inner = (void*)(ret_conv_16 & (~1));
+ ret_conv_16_conv.is_owned = (ret_conv_16 & 1) || (ret_conv_16 == 0);
+ ret_conv_16_conv = ChannelDetails_clone(&ret_conv_16_conv);
+ ret_constr.data[q] = ret_conv_16_conv;
+ }
+ (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0);
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
+ }
+ return ret_constr;
+}
+LDKCResult_PaymentIdPaymentSendFailureZ send_payment_LDKPayer_jcall(const void* this_arg, const LDKRoute * route, LDKThirtyTwoBytes payment_hash, LDKThirtyTwoBytes payment_secret) {
+ 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.
+ route_ref = (uint64_t)route_var.inner;
+ if (route_var.is_owned) {
+ route_ref |= 1;
+ }
+ int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
+ (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, payment_hash.data);
+ int8_tArray payment_secret_arr = (*env)->NewByteArray(env, 32);
+ (*env)->SetByteArrayRegion(env, payment_secret_arr, 0, 32, payment_secret.data);
+ 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)) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to send_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);
+ ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone((LDKCResult_PaymentIdPaymentSendFailureZ*)(((uint64_t)ret) & ~1));
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
+ }
return ret_conv;
}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Transaction_1free(JNIEnv *env, jclass clz, int8_tArray _res) {
- LDKTransaction _res_ref;
- _res_ref.datalen = (*env)->GetArrayLength(env, _res);
- _res_ref.data = MALLOC(_res_ref.datalen, "LDKTransaction Bytes");
- (*env)->GetByteArrayRegion(env, _res, 0, _res_ref.datalen, _res_ref.data);
- _res_ref.data_is_owned = true;
- Transaction_free(_res_ref);
+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;
+ 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.
+ route_ref = (uint64_t)route_var.inner;
+ if (route_var.is_owned) {
+ route_ref |= 1;
+ }
+ 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);
+ uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->retry_payment_meth, route_ref, payment_id_arr);
+ if ((*env)->ExceptionCheck(env)) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to retry_payment in LDKPayer from rust threw an exception.");
+ }
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NonePaymentSendFailureZ ret_conv = *(LDKCResult_NonePaymentSendFailureZ*)(ret_ptr);
+ ret_conv = CResult_NonePaymentSendFailureZ_clone((LDKCResult_NonePaymentSendFailureZ*)(((uint64_t)ret) & ~1));
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
+ }
+ return ret_conv;
}
-
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxOut_1new(JNIEnv *env, jclass clz, int8_tArray script_pubkey, int64_t value) {
- LDKCVec_u8Z script_pubkey_ref;
- script_pubkey_ref.datalen = (*env)->GetArrayLength(env, script_pubkey);
- script_pubkey_ref.data = MALLOC(script_pubkey_ref.datalen, "LDKCVec_u8Z Bytes");
- (*env)->GetByteArrayRegion(env, script_pubkey, 0, script_pubkey_ref.datalen, script_pubkey_ref.data);
- LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
- *ret_ref = TxOut_new(script_pubkey_ref, value);
- return (uint64_t)ret_ref;
+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);
}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxOut_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);
- LDKTxOut _res_conv = *(LDKTxOut*)(_res_ptr);
- FREE((void*)_res);
- TxOut_free(_res_conv);
+static inline LDKPayer LDKPayer_init (JNIEnv *env, jclass clz, jobject o) {
+ jclass c = (*env)->GetObjectClass(env, o);
+ CHECK(c != NULL);
+ LDKPayer_JCalls *calls = MALLOC(sizeof(LDKPayer_JCalls), "LDKPayer_JCalls");
+ atomic_init(&calls->refcnt, 1);
+ DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
+ calls->o = (*env)->NewWeakGlobalRef(env, o);
+ calls->node_id_meth = (*env)->GetMethodID(env, c, "node_id", "()[B");
+ CHECK(calls->node_id_meth != NULL);
+ calls->first_hops_meth = (*env)->GetMethodID(env, c, "first_hops", "()[J");
+ 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->retry_payment_meth = (*env)->GetMethodID(env, c, "retry_payment", "(J[B)J");
+ CHECK(calls->retry_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,
+ .retry_payment = retry_payment_LDKPayer_jcall,
+ .free = LDKPayer_JCalls_free,
+ };
+ return ret;
}
-
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxOut_1clone(JNIEnv *env, jclass clz, int64_t orig) {
- LDKTxOut* orig_conv = (LDKTxOut*)(orig & ~1);
- LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
- *ret_ref = TxOut_clone(orig_conv);
- return (uint64_t)ret_ref;
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKPayer_1new(JNIEnv *env, jclass clz, jobject o) {
+ LDKPayer *res_ptr = MALLOC(sizeof(LDKPayer), "LDKPayer");
+ *res_ptr = LDKPayer_init(env, clz, o);
+ return (uint64_t)res_ptr;
}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Str_1free(JNIEnv *env, jclass clz, jstring _res) {
- LDKStr dummy = { .chars = NULL, .len = 0, .chars_is_owned = false };
- Str_free(dummy);
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Payer_1node_1id(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); }
+ LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, (this_arg_conv->node_id)(this_arg_conv->this_arg).compressed_form);
+ return ret_arr;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
- LDKSecretKey o_ref;
- CHECK((*env)->GetArrayLength(env, o) == 32);
- (*env)->GetByteArrayRegion(env, o, 0, 32, o_ref.bytes);
- LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
- *ret_conv = CResult_SecretKeyErrorZ_ok(o_ref);
- return (uint64_t)ret_conv;
+JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Payer_1first_1hops(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); }
+ LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
+ LDKCVec_ChannelDetailsZ ret_var = (this_arg_conv->first_hops)(this_arg_conv->this_arg);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
+ for (size_t q = 0; q < ret_var.datalen; q++) {
+ LDKChannelDetails ret_conv_16_var = ret_var.data[q];
+ uint64_t ret_conv_16_ref = 0;
+ CHECK((((uint64_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner;
+ if (ret_conv_16_var.is_owned) {
+ ret_conv_16_ref |= 1;
+ }
+ ret_arr_ptr[q] = ret_conv_16_ref;
+ }
+ (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
+ FREE(ret_var.data);
+ return ret_arr;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
- LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_java(env, e);
- LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
- *ret_conv = CResult_SecretKeyErrorZ_err(e_conv);
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payer_1send_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t route, int8_tArray payment_hash, int8_tArray payment_secret) {
+ 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;
+ 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_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
+ *ret_conv = (this_arg_conv->send_payment)(this_arg_conv->this_arg, &route_conv, payment_hash_ref, payment_secret_ref);
return (uint64_t)ret_conv;
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_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_SecretKeyErrorZ _res_conv = *(LDKCResult_SecretKeyErrorZ*)(_res_ptr);
- FREE((void*)_res);
- CResult_SecretKeyErrorZ_free(_res_conv);
-}
-
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
- LDKPublicKey o_ref;
- CHECK((*env)->GetArrayLength(env, o) == 33);
- (*env)->GetByteArrayRegion(env, o, 0, 33, o_ref.compressed_form);
- LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
- *ret_conv = CResult_PublicKeyErrorZ_ok(o_ref);
+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); }
+ LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
+ LDKRoute route_conv;
+ route_conv.inner = (void*)(route & (~1));
+ route_conv.is_owned = false;
+ LDKThirtyTwoBytes payment_id_ref;
+ CHECK((*env)->GetArrayLength(env, payment_id) == 32);
+ (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
+ LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
+ *ret_conv = (this_arg_conv->retry_payment)(this_arg_conv->this_arg, &route_conv, payment_id_ref);
return (uint64_t)ret_conv;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
- LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_java(env, e);
- LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
- *ret_conv = CResult_PublicKeyErrorZ_err(e_conv);
+typedef struct LDKRouter_JCalls {
+ atomic_size_t refcnt;
+ JavaVM *vm;
+ jweak o;
+ jmethodID find_route_meth;
+} LDKRouter_JCalls;
+static void LDKRouter_JCalls_free(void* this_arg) {
+ LDKRouter_JCalls *j_calls = (LDKRouter_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);
+ }
+}
+LDKCResult_RouteLightningErrorZ find_route_LDKRouter_jcall(const void* this_arg, LDKPublicKey payer, const LDKRouteParameters * params, 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 (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 payer_arr = (*env)->NewByteArray(env, 33);
+ (*env)->SetByteArrayRegion(env, payer_arr, 0, 33, payer.compressed_form);
+ LDKRouteParameters params_var = *params;
+ uint64_t params_ref = 0;
+ params_var = RouteParameters_clone(params);
+ CHECK((((uint64_t)params_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)¶ms_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ params_ref = (uint64_t)params_var.inner;
+ if (params_var.is_owned) {
+ params_ref |= 1;
+ }
+ LDKCVec_ChannelDetailsZ *first_hops_var_ptr = first_hops;
+ int64_tArray first_hops_arr = NULL;
+ if (first_hops != NULL) {
+ LDKCVec_ChannelDetailsZ first_hops_var = *first_hops_var_ptr;
+ first_hops_arr = (*env)->NewLongArray(env, first_hops_var.datalen);
+ int64_t *first_hops_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, first_hops_arr, NULL);
+ for (size_t q = 0; q < first_hops_var.datalen; q++) {
+ LDKChannelDetails first_hops_conv_16_var = first_hops_var.data[q];
+ uint64_t first_hops_conv_16_ref = 0;
+ CHECK((((uint64_t)first_hops_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&first_hops_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ first_hops_conv_16_ref = (uint64_t)first_hops_conv_16_var.inner;
+ if (first_hops_conv_16_var.is_owned) {
+ first_hops_conv_16_ref |= 1;
+ }
+ first_hops_arr_ptr[q] = first_hops_conv_16_ref;
+ }
+ (*env)->ReleasePrimitiveArrayCritical(env, first_hops_arr, first_hops_arr_ptr, 0);
+ }
+ // WARNING: This object doesn't live past this scope, needs clone!
+ 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)) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to find_route in LDKRouter from rust threw an exception.");
+ }
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_RouteLightningErrorZ ret_conv = *(LDKCResult_RouteLightningErrorZ*)(ret_ptr);
+ ret_conv = CResult_RouteLightningErrorZ_clone((LDKCResult_RouteLightningErrorZ*)(((uint64_t)ret) & ~1));
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
+ }
+ return ret_conv;
+}
+static void LDKRouter_JCalls_cloned(LDKRouter* new_obj) {
+ LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) new_obj->this_arg;
+ atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
+}
+static inline LDKRouter LDKRouter_init (JNIEnv *env, jclass clz, jobject o) {
+ jclass c = (*env)->GetObjectClass(env, o);
+ CHECK(c != NULL);
+ LDKRouter_JCalls *calls = MALLOC(sizeof(LDKRouter_JCalls), "LDKRouter_JCalls");
+ 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");
+ CHECK(calls->find_route_meth != NULL);
+
+ LDKRouter ret = {
+ .this_arg = (void*) calls,
+ .find_route = find_route_LDKRouter_jcall,
+ .free = LDKRouter_JCalls_free,
+ };
+ return ret;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKRouter_1new(JNIEnv *env, jclass clz, jobject o) {
+ LDKRouter *res_ptr = MALLOC(sizeof(LDKRouter), "LDKRouter");
+ *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) {
+ 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;
+ LDKPublicKey payer_ref;
+ CHECK((*env)->GetArrayLength(env, payer) == 33);
+ (*env)->GetByteArrayRegion(env, payer, 0, 33, payer_ref.compressed_form);
+ LDKRouteParameters params_conv;
+ params_conv.inner = (void*)(params & (~1));
+ params_conv.is_owned = false;
+ LDKCVec_ChannelDetailsZ first_hops_constr;
+ LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL;
+ if (first_hops != NULL) {
+ first_hops_constr.datalen = (*env)->GetArrayLength(env, first_hops);
+ if (first_hops_constr.datalen > 0)
+ first_hops_constr.data = MALLOC(first_hops_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
+ else
+ first_hops_constr.data = NULL;
+ int64_t* first_hops_vals = (*env)->GetLongArrayElements (env, first_hops, NULL);
+ for (size_t q = 0; q < first_hops_constr.datalen; q++) {
+ int64_t first_hops_conv_16 = first_hops_vals[q];
+ LDKChannelDetails first_hops_conv_16_conv;
+ first_hops_conv_16_conv.inner = (void*)(first_hops_conv_16 & (~1));
+ first_hops_conv_16_conv.is_owned = (first_hops_conv_16 & 1) || (first_hops_conv_16 == 0);
+ first_hops_constr.data[q] = first_hops_conv_16_conv;
+ }
+ (*env)->ReleaseLongArrayElements(env, first_hops, first_hops_vals, 0);
+ first_hops_ptr = &first_hops_constr;
+ }
+ void* scorer_ptr = (void*)(((uint64_t)scorer) & ~1);
+ 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);
+ if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings__1ldk_1get_1compiled_1version(JNIEnv *env, jclass clz) {
+ LDKStr ret_str = _ldk_get_compiled_version();
+ jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
+ Str_free(ret_str);
+ return ret_conv;
+}
+
+JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings__1ldk_1c_1bindings_1get_1compiled_1version(JNIEnv *env, jclass clz) {
+ LDKStr ret_str = _ldk_c_bindings_get_compiled_version();
+ 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_Transaction_1free(JNIEnv *env, jclass clz, int8_tArray _res) {
+ LDKTransaction _res_ref;
+ _res_ref.datalen = (*env)->GetArrayLength(env, _res);
+ _res_ref.data = MALLOC(_res_ref.datalen, "LDKTransaction Bytes");
+ (*env)->GetByteArrayRegion(env, _res, 0, _res_ref.datalen, _res_ref.data);
+ _res_ref.data_is_owned = true;
+ Transaction_free(_res_ref);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxOut_1new(JNIEnv *env, jclass clz, int8_tArray script_pubkey, int64_t value) {
+ LDKCVec_u8Z script_pubkey_ref;
+ script_pubkey_ref.datalen = (*env)->GetArrayLength(env, script_pubkey);
+ script_pubkey_ref.data = MALLOC(script_pubkey_ref.datalen, "LDKCVec_u8Z Bytes");
+ (*env)->GetByteArrayRegion(env, script_pubkey, 0, script_pubkey_ref.datalen, script_pubkey_ref.data);
+ LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
+ *ret_ref = TxOut_new(script_pubkey_ref, value);
+ return (uint64_t)ret_ref;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxOut_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);
+ LDKTxOut _res_conv = *(LDKTxOut*)(_res_ptr);
+ FREE((void*)_res);
+ TxOut_free(_res_conv);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxOut_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKTxOut* orig_conv = (LDKTxOut*)(orig & ~1);
+ LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
+ *ret_ref = TxOut_clone(orig_conv);
+ return (uint64_t)ret_ref;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Str_1free(JNIEnv *env, jclass clz, jstring _res) {
+ LDKStr dummy = { .chars = NULL, .len = 0, .chars_is_owned = false };
+ Str_free(dummy);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
+ LDKSecretKey o_ref;
+ CHECK((*env)->GetArrayLength(env, o) == 32);
+ (*env)->GetByteArrayRegion(env, o, 0, 32, o_ref.bytes);
+ LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
+ *ret_conv = CResult_SecretKeyErrorZ_ok(o_ref);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
+ LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_java(env, e);
+ LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
+ *ret_conv = CResult_SecretKeyErrorZ_err(e_conv);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_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_SecretKeyErrorZ _res_conv = *(LDKCResult_SecretKeyErrorZ*)(_res_ptr);
+ FREE((void*)_res);
+ CResult_SecretKeyErrorZ_free(_res_conv);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
+ LDKPublicKey o_ref;
+ CHECK((*env)->GetArrayLength(env, o) == 33);
+ (*env)->GetByteArrayRegion(env, o, 0, 33, o_ref.compressed_form);
+ LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
+ *ret_conv = CResult_PublicKeyErrorZ_ok(o_ref);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
+ LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_java(env, e);
+ LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
+ *ret_conv = CResult_PublicKeyErrorZ_err(e_conv);
return (uint64_t)ret_conv;
}
return (uint64_t)ret_conv;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1some(JNIEnv *env, jclass clz, int64_t o) {
- LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
- *ret_copy = COption_u64Z_some(o);
- uint64_t ret_ref = (uint64_t)ret_copy;
- return ret_ref;
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ LDKRouteParameters o_conv;
+ o_conv.inner = (void*)(o & (~1));
+ o_conv.is_owned = (o & 1) || (o == 0);
+ o_conv = RouteParameters_clone(&o_conv);
+ LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
+ *ret_conv = CResult_RouteParametersDecodeErrorZ_ok(o_conv);
+ return (uint64_t)ret_conv;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1none(JNIEnv *env, jclass clz) {
- LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
- *ret_copy = COption_u64Z_none();
- uint64_t ret_ref = (uint64_t)ret_copy;
- return ret_ref;
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_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);
+ e_conv = DecodeError_clone(&e_conv);
+ LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
+ *ret_conv = CResult_RouteParametersDecodeErrorZ_err(e_conv);
+ return (uint64_t)ret_conv;
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1free(JNIEnv *env, jclass clz, int64_t _res) {
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_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);
- LDKCOption_u64Z _res_conv = *(LDKCOption_u64Z*)(_res_ptr);
+ LDKCResult_RouteParametersDecodeErrorZ _res_conv = *(LDKCResult_RouteParametersDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
- COption_u64Z_free(_res_conv);
-}
-
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1clone(JNIEnv *env, jclass clz, int64_t orig) {
- LDKCOption_u64Z* orig_conv = (LDKCOption_u64Z*)orig;
- LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
- *ret_copy = COption_u64Z_clone(orig_conv);
- uint64_t ret_ref = (uint64_t)ret_copy;
- return ret_ref;
+ CResult_RouteParametersDecodeErrorZ_free(_res_conv);
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelDetailsZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
- LDKCVec_ChannelDetailsZ _res_constr;
- _res_constr.datalen = (*env)->GetArrayLength(env, _res);
- if (_res_constr.datalen > 0)
- _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
- else
- _res_constr.data = NULL;
- int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
- for (size_t q = 0; q < _res_constr.datalen; q++) {
- int64_t _res_conv_16 = _res_vals[q];
- LDKChannelDetails _res_conv_16_conv;
- _res_conv_16_conv.inner = (void*)(_res_conv_16 & (~1));
- _res_conv_16_conv.is_owned = (_res_conv_16 & 1) || (_res_conv_16 == 0);
- _res_constr.data[q] = _res_conv_16_conv;
- }
- (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
- CVec_ChannelDetailsZ_free(_res_constr);
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKCResult_RouteParametersDecodeErrorZ* orig_conv = (LDKCResult_RouteParametersDecodeErrorZ*)(orig & ~1);
+ LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
+ *ret_conv = CResult_RouteParametersDecodeErrorZ_clone(orig_conv);
+ return (uint64_t)ret_conv;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHintZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
CVec_RouteHintZ_free(_res_constr);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKRoute o_conv;
- o_conv.inner = (void*)(o & (~1));
- o_conv.is_owned = (o & 1) || (o == 0);
- o_conv = Route_clone(&o_conv);
- LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
- *ret_conv = CResult_RouteLightningErrorZ_ok(o_conv);
- return (uint64_t)ret_conv;
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1some(JNIEnv *env, jclass clz, int64_t o) {
+ LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
+ *ret_copy = COption_u64Z_some(o);
+ uint64_t ret_ref = (uint64_t)ret_copy;
+ return ret_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKLightningError e_conv;
- e_conv.inner = (void*)(e & (~1));
- e_conv.is_owned = (e & 1) || (e == 0);
- e_conv = LightningError_clone(&e_conv);
- LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
- *ret_conv = CResult_RouteLightningErrorZ_err(e_conv);
- return (uint64_t)ret_conv;
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1none(JNIEnv *env, jclass clz) {
+ LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
+ *ret_copy = COption_u64Z_none();
+ uint64_t ret_ref = (uint64_t)ret_copy;
+ return ret_ref;
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_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_RouteLightningErrorZ _res_conv = *(LDKCResult_RouteLightningErrorZ*)(_res_ptr);
+ LDKCOption_u64Z _res_conv = *(LDKCOption_u64Z*)(_res_ptr);
FREE((void*)_res);
- CResult_RouteLightningErrorZ_free(_res_conv);
+ COption_u64Z_free(_res_conv);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKCOption_u64Z* orig_conv = (LDKCOption_u64Z*)orig;
+ LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
+ *ret_copy = COption_u64Z_clone(orig_conv);
+ uint64_t ret_ref = (uint64_t)ret_copy;
+ return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeeDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ LDKPayee o_conv;
+ o_conv.inner = (void*)(o & (~1));
+ o_conv.is_owned = (o & 1) || (o == 0);
+ o_conv = Payee_clone(&o_conv);
+ LDKCResult_PayeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeeDecodeErrorZ), "LDKCResult_PayeeDecodeErrorZ");
+ *ret_conv = CResult_PayeeDecodeErrorZ_ok(o_conv);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeeDecodeErrorZ_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);
+ e_conv = DecodeError_clone(&e_conv);
+ LDKCResult_PayeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeeDecodeErrorZ), "LDKCResult_PayeeDecodeErrorZ");
+ *ret_conv = CResult_PayeeDecodeErrorZ_err(e_conv);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PayeeDecodeErrorZ_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_PayeeDecodeErrorZ _res_conv = *(LDKCResult_PayeeDecodeErrorZ*)(_res_ptr);
+ FREE((void*)_res);
+ CResult_PayeeDecodeErrorZ_free(_res_conv);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeeDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKCResult_PayeeDecodeErrorZ* orig_conv = (LDKCResult_PayeeDecodeErrorZ*)(orig & ~1);
+ LDKCResult_PayeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeeDecodeErrorZ), "LDKCResult_PayeeDecodeErrorZ");
+ *ret_conv = CResult_PayeeDecodeErrorZ_clone(orig_conv);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHintHopZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
+ LDKCVec_RouteHintHopZ _res_constr;
+ _res_constr.datalen = (*env)->GetArrayLength(env, _res);
+ if (_res_constr.datalen > 0)
+ _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements");
+ else
+ _res_constr.data = NULL;
+ int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
+ for (size_t o = 0; o < _res_constr.datalen; o++) {
+ int64_t _res_conv_14 = _res_vals[o];
+ LDKRouteHintHop _res_conv_14_conv;
+ _res_conv_14_conv.inner = (void*)(_res_conv_14 & (~1));
+ _res_conv_14_conv.is_owned = (_res_conv_14 & 1) || (_res_conv_14 == 0);
+ _res_constr.data[o] = _res_conv_14_conv;
+ }
+ (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
+ CVec_RouteHintHopZ_free(_res_constr);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ LDKRouteHint o_conv;
+ o_conv.inner = (void*)(o & (~1));
+ o_conv.is_owned = (o & 1) || (o == 0);
+ o_conv = RouteHint_clone(&o_conv);
+ LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
+ *ret_conv = CResult_RouteHintDecodeErrorZ_ok(o_conv);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_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);
+ e_conv = DecodeError_clone(&e_conv);
+ LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
+ *ret_conv = CResult_RouteHintDecodeErrorZ_err(e_conv);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_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_RouteHintDecodeErrorZ _res_conv = *(LDKCResult_RouteHintDecodeErrorZ*)(_res_ptr);
+ FREE((void*)_res);
+ CResult_RouteHintDecodeErrorZ_free(_res_conv);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKCResult_RouteHintDecodeErrorZ* orig_conv = (LDKCResult_RouteHintDecodeErrorZ*)(orig & ~1);
+ LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
+ *ret_conv = CResult_RouteHintDecodeErrorZ_clone(orig_conv);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ LDKRouteHintHop o_conv;
+ o_conv.inner = (void*)(o & (~1));
+ o_conv.is_owned = (o & 1) || (o == 0);
+ o_conv = RouteHintHop_clone(&o_conv);
+ LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
+ *ret_conv = CResult_RouteHintHopDecodeErrorZ_ok(o_conv);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_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);
+ e_conv = DecodeError_clone(&e_conv);
+ LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
+ *ret_conv = CResult_RouteHintHopDecodeErrorZ_err(e_conv);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_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_RouteHintHopDecodeErrorZ _res_conv = *(LDKCResult_RouteHintHopDecodeErrorZ*)(_res_ptr);
+ FREE((void*)_res);
+ CResult_RouteHintHopDecodeErrorZ_free(_res_conv);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKCResult_RouteHintHopDecodeErrorZ* orig_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)(orig & ~1);
+ LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
+ *ret_conv = CResult_RouteHintHopDecodeErrorZ_clone(orig_conv);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelDetailsZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
+ LDKCVec_ChannelDetailsZ _res_constr;
+ _res_constr.datalen = (*env)->GetArrayLength(env, _res);
+ if (_res_constr.datalen > 0)
+ _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
+ else
+ _res_constr.data = NULL;
+ int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
+ for (size_t q = 0; q < _res_constr.datalen; q++) {
+ int64_t _res_conv_16 = _res_vals[q];
+ LDKChannelDetails _res_conv_16_conv;
+ _res_conv_16_conv.inner = (void*)(_res_conv_16 & (~1));
+ _res_conv_16_conv.is_owned = (_res_conv_16 & 1) || (_res_conv_16 == 0);
+ _res_constr.data[q] = _res_conv_16_conv;
+ }
+ (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
+ CVec_ChannelDetailsZ_free(_res_constr);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ LDKRoute o_conv;
+ o_conv.inner = (void*)(o & (~1));
+ o_conv.is_owned = (o & 1) || (o == 0);
+ o_conv = Route_clone(&o_conv);
+ LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
+ *ret_conv = CResult_RouteLightningErrorZ_ok(o_conv);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
+ LDKLightningError e_conv;
+ e_conv.inner = (void*)(e & (~1));
+ e_conv.is_owned = (e & 1) || (e == 0);
+ e_conv = LightningError_clone(&e_conv);
+ LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
+ *ret_conv = CResult_RouteLightningErrorZ_err(e_conv);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_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_RouteLightningErrorZ _res_conv = *(LDKCResult_RouteLightningErrorZ*)(_res_ptr);
+ FREE((void*)_res);
+ CResult_RouteLightningErrorZ_free(_res_conv);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
CResult_InvoiceFeaturesDecodeErrorZ_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;
+ o_conv.inner = (void*)(o & (~1));
+ o_conv.is_owned = (o & 1) || (o == 0);
+ // 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_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);
+ e_conv = DecodeError_clone(&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 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_ScoringParametersDecodeErrorZ _res_conv = *(LDKCResult_ScoringParametersDecodeErrorZ*)(_res_ptr);
+ FREE((void*)_res);
+ CResult_ScoringParametersDecodeErrorZ_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;
+ o_conv.inner = (void*)(o & (~1));
+ o_conv.is_owned = (o & 1) || (o == 0);
+ // 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_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);
+ e_conv = DecodeError_clone(&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 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_ScorerDecodeErrorZ _res_conv = *(LDKCResult_ScorerDecodeErrorZ*)(_res_ptr);
+ FREE((void*)_res);
+ CResult_ScorerDecodeErrorZ_free(_res_conv);
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
LDKDelayedPaymentOutputDescriptor o_conv;
o_conv.inner = (void*)(o & (~1));
return (uint64_t)ret_conv;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKPaymentId o_conv;
- o_conv.inner = (void*)(o & (~1));
- o_conv.is_owned = (o & 1) || (o == 0);
- o_conv = PaymentId_clone(&o_conv);
- LDKCResult_PaymentIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdDecodeErrorZ), "LDKCResult_PaymentIdDecodeErrorZ");
- *ret_conv = CResult_PaymentIdDecodeErrorZ_ok(o_conv);
- return (uint64_t)ret_conv;
-}
-
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdDecodeErrorZ_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);
- e_conv = DecodeError_clone(&e_conv);
- LDKCResult_PaymentIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdDecodeErrorZ), "LDKCResult_PaymentIdDecodeErrorZ");
- *ret_conv = CResult_PaymentIdDecodeErrorZ_err(e_conv);
- return (uint64_t)ret_conv;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdDecodeErrorZ_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_PaymentIdDecodeErrorZ _res_conv = *(LDKCResult_PaymentIdDecodeErrorZ*)(_res_ptr);
- FREE((void*)_res);
- CResult_PaymentIdDecodeErrorZ_free(_res_conv);
-}
-
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
- LDKCResult_PaymentIdDecodeErrorZ* orig_conv = (LDKCResult_PaymentIdDecodeErrorZ*)(orig & ~1);
- LDKCResult_PaymentIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdDecodeErrorZ), "LDKCResult_PaymentIdDecodeErrorZ");
- *ret_conv = CResult_PaymentIdDecodeErrorZ_clone(orig_conv);
- return (uint64_t)ret_conv;
-}
-
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1some(JNIEnv *env, jclass clz, int16_t o) {
LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z");
*ret_copy = COption_u16Z_some(o);
return (uint64_t)ret_conv;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKPaymentId o_conv;
- o_conv.inner = (void*)(o & (~1));
- o_conv.is_owned = (o & 1) || (o == 0);
- o_conv = PaymentId_clone(&o_conv);
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_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_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
- *ret_conv = CResult_PaymentIdPaymentSendFailureZ_ok(o_conv);
+ *ret_conv = CResult_PaymentIdPaymentSendFailureZ_ok(o_ref);
return (uint64_t)ret_conv;
}
return ((uint64_t)ret_conv);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_t b) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int8_tArray b) {
LDKThirtyTwoBytes a_ref;
CHECK((*env)->GetArrayLength(env, a) == 32);
(*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data);
- LDKPaymentId b_conv;
- b_conv.inner = (void*)(b & (~1));
- b_conv.is_owned = (b & 1) || (b == 0);
- b_conv = PaymentId_clone(&b_conv);
+ LDKThirtyTwoBytes b_ref;
+ CHECK((*env)->GetArrayLength(env, b) == 32);
+ (*env)->GetByteArrayRegion(env, b, 0, 32, b_ref.data);
LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ");
- *ret_conv = C2Tuple_PaymentHashPaymentIdZ_new(a_ref, b_conv);
+ *ret_conv = C2Tuple_PaymentHashPaymentIdZ_new(a_ref, b_ref);
return ((uint64_t)ret_conv);
}
return (uint64_t)ret_conv;
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_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_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
+ *ret_conv = CResult_PaymentIdPaymentErrorZ_ok(o_ref);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
+ void* e_ptr = (void*)(((uint64_t)e) & ~1);
+ CHECK_ACCESS(e_ptr);
+ LDKPaymentError e_conv = *(LDKPaymentError*)(e_ptr);
+ e_conv = PaymentError_clone((LDKPaymentError*)(((uint64_t)e) & ~1));
+ LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
+ *ret_conv = CResult_PaymentIdPaymentErrorZ_err(e_conv);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_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_PaymentIdPaymentErrorZ _res_conv = *(LDKCResult_PaymentIdPaymentErrorZ*)(_res_ptr);
+ FREE((void*)_res);
+ CResult_PaymentIdPaymentErrorZ_free(_res_conv);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKCResult_PaymentIdPaymentErrorZ* orig_conv = (LDKCResult_PaymentIdPaymentErrorZ*)(orig & ~1);
+ LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
+ *ret_conv = CResult_PaymentIdPaymentErrorZ_clone(orig_conv);
+ return (uint64_t)ret_conv;
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixNoneZ_1ok(JNIEnv *env, jclass clz, jclass o) {
LDKSiPrefix o_conv = LDKSiPrefix_from_java(env, o);
LDKCResult_SiPrefixNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixNoneZ), "LDKCResult_SiPrefixNoneZ");
return ret_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressu8Z_1ok(JNIEnv *env, jclass clz, int64_t o) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
void* o_ptr = (void*)(((uint64_t)o) & ~1);
CHECK_ACCESS(o_ptr);
LDKNetAddress o_conv = *(LDKNetAddress*)(o_ptr);
o_conv = NetAddress_clone((LDKNetAddress*)(((uint64_t)o) & ~1));
- LDKCResult_NetAddressu8Z* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressu8Z), "LDKCResult_NetAddressu8Z");
- *ret_conv = CResult_NetAddressu8Z_ok(o_conv);
- return (uint64_t)ret_conv;
-}
-
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressu8Z_1err(JNIEnv *env, jclass clz, int8_t e) {
- LDKCResult_NetAddressu8Z* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressu8Z), "LDKCResult_NetAddressu8Z");
- *ret_conv = CResult_NetAddressu8Z_err(e);
- return (uint64_t)ret_conv;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressu8Z_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_NetAddressu8Z _res_conv = *(LDKCResult_NetAddressu8Z*)(_res_ptr);
- FREE((void*)_res);
- CResult_NetAddressu8Z_free(_res_conv);
-}
-
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressu8Z_1clone(JNIEnv *env, jclass clz, int64_t orig) {
- LDKCResult_NetAddressu8Z* orig_conv = (LDKCResult_NetAddressu8Z*)(orig & ~1);
- LDKCResult_NetAddressu8Z* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressu8Z), "LDKCResult_NetAddressu8Z");
- *ret_conv = CResult_NetAddressu8Z_clone(orig_conv);
- return (uint64_t)ret_conv;
-}
-
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CResult_1NetAddressu8ZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
- void* o_ptr = (void*)(((uint64_t)o) & ~1);
- CHECK_ACCESS(o_ptr);
- LDKCResult_NetAddressu8Z o_conv = *(LDKCResult_NetAddressu8Z*)(o_ptr);
- o_conv = CResult_NetAddressu8Z_clone((LDKCResult_NetAddressu8Z*)(((uint64_t)o) & ~1));
- LDKCResult_CResult_NetAddressu8ZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CResult_NetAddressu8ZDecodeErrorZ), "LDKCResult_CResult_NetAddressu8ZDecodeErrorZ");
- *ret_conv = CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(o_conv);
+ LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
+ *ret_conv = CResult_NetAddressDecodeErrorZ_ok(o_conv);
return (uint64_t)ret_conv;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CResult_1NetAddressu8ZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_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);
e_conv = DecodeError_clone(&e_conv);
- LDKCResult_CResult_NetAddressu8ZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CResult_NetAddressu8ZDecodeErrorZ), "LDKCResult_CResult_NetAddressu8ZDecodeErrorZ");
- *ret_conv = CResult_CResult_NetAddressu8ZDecodeErrorZ_err(e_conv);
+ LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
+ *ret_conv = CResult_NetAddressDecodeErrorZ_err(e_conv);
return (uint64_t)ret_conv;
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CResult_1NetAddressu8ZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_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_CResult_NetAddressu8ZDecodeErrorZ _res_conv = *(LDKCResult_CResult_NetAddressu8ZDecodeErrorZ*)(_res_ptr);
+ LDKCResult_NetAddressDecodeErrorZ _res_conv = *(LDKCResult_NetAddressDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
- CResult_CResult_NetAddressu8ZDecodeErrorZ_free(_res_conv);
+ CResult_NetAddressDecodeErrorZ_free(_res_conv);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CResult_1NetAddressu8ZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
- LDKCResult_CResult_NetAddressu8ZDecodeErrorZ* orig_conv = (LDKCResult_CResult_NetAddressu8ZDecodeErrorZ*)(orig & ~1);
- LDKCResult_CResult_NetAddressu8ZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CResult_NetAddressu8ZDecodeErrorZ), "LDKCResult_CResult_NetAddressu8ZDecodeErrorZ");
- *ret_conv = CResult_CResult_NetAddressu8ZDecodeErrorZ_clone(orig_conv);
- return (uint64_t)ret_conv;
-}
-
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
- void* o_ptr = (void*)(((uint64_t)o) & ~1);
- CHECK_ACCESS(o_ptr);
- LDKNetAddress o_conv = *(LDKNetAddress*)(o_ptr);
- o_conv = NetAddress_clone((LDKNetAddress*)(((uint64_t)o) & ~1));
- LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
- *ret_conv = CResult_NetAddressDecodeErrorZ_ok(o_conv);
- return (uint64_t)ret_conv;
-}
-
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_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);
- e_conv = DecodeError_clone(&e_conv);
- LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
- *ret_conv = CResult_NetAddressDecodeErrorZ_err(e_conv);
- return (uint64_t)ret_conv;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_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_NetAddressDecodeErrorZ _res_conv = *(LDKCResult_NetAddressDecodeErrorZ*)(_res_ptr);
- FREE((void*)_res);
- CResult_NetAddressDecodeErrorZ_free(_res_conv);
-}
-
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
- LDKCResult_NetAddressDecodeErrorZ* orig_conv = (LDKCResult_NetAddressDecodeErrorZ*)(orig & ~1);
- LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
- *ret_conv = CResult_NetAddressDecodeErrorZ_clone(orig_conv);
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKCResult_NetAddressDecodeErrorZ* orig_conv = (LDKCResult_NetAddressDecodeErrorZ*)(orig & ~1);
+ LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
+ *ret_conv = CResult_NetAddressDecodeErrorZ_clone(orig_conv);
return (uint64_t)ret_conv;
}
return ret_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1sent(JNIEnv *env, jclass clz, int8_tArray payment_preimage, int8_tArray payment_hash) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1sent(JNIEnv *env, jclass clz, int8_tArray payment_id, int8_tArray payment_preimage, int8_tArray payment_hash, int64_t fee_paid_msat) {
+ LDKThirtyTwoBytes payment_id_ref;
+ CHECK((*env)->GetArrayLength(env, payment_id) == 32);
+ (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
LDKThirtyTwoBytes payment_preimage_ref;
CHECK((*env)->GetArrayLength(env, payment_preimage) == 32);
(*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data);
LDKThirtyTwoBytes payment_hash_ref;
CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
(*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
+ void* fee_paid_msat_ptr = (void*)(((uint64_t)fee_paid_msat) & ~1);
+ CHECK_ACCESS(fee_paid_msat_ptr);
+ LDKCOption_u64Z fee_paid_msat_conv = *(LDKCOption_u64Z*)(fee_paid_msat_ptr);
+ fee_paid_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)fee_paid_msat) & ~1));
LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
- *ret_copy = Event_payment_sent(payment_preimage_ref, payment_hash_ref);
+ *ret_copy = Event_payment_sent(payment_id_ref, payment_preimage_ref, payment_hash_ref, fee_paid_msat_conv);
uint64_t ret_ref = (uint64_t)ret_copy;
return ret_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1path_1failed(JNIEnv *env, jclass clz, int8_tArray payment_hash, jboolean rejected_by_dest, int64_t network_update, jboolean all_paths_failed, int64_tArray path, int64_t short_channel_id) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1path_1failed(JNIEnv *env, jclass clz, int8_tArray payment_id, int8_tArray payment_hash, jboolean rejected_by_dest, int64_t network_update, jboolean all_paths_failed, int64_tArray path, int64_t short_channel_id, int64_t retry) {
+ 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);
CHECK_ACCESS(short_channel_id_ptr);
LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(short_channel_id_ptr);
short_channel_id_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)short_channel_id) & ~1));
+ LDKRouteParameters retry_conv;
+ retry_conv.inner = (void*)(retry & (~1));
+ retry_conv.is_owned = (retry & 1) || (retry == 0);
+ retry_conv = RouteParameters_clone(&retry_conv);
LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
- *ret_copy = Event_payment_path_failed(payment_hash_ref, rejected_by_dest, network_update_conv, all_paths_failed, path_constr, short_channel_id_conv);
+ *ret_copy = Event_payment_path_failed(payment_id_ref, payment_hash_ref, rejected_by_dest, network_update_conv, all_paths_failed, path_constr, short_channel_id_conv, retry_conv);
uint64_t ret_ref = (uint64_t)ret_copy;
return ret_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1new(JNIEnv *env, jclass clz, int32_t minimum_depth_arg, int16_t our_to_self_delay_arg, int64_t our_htlc_minimum_msat_arg) {
LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1default(JNIEnv *env, jclass clz) {
LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_default();
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1new(JNIEnv *env, jclass clz, int64_t min_funding_satoshis_arg, int64_t max_htlc_minimum_msat_arg, int64_t min_max_htlc_value_in_flight_msat_arg, int64_t max_channel_reserve_satoshis_arg, int16_t min_max_accepted_htlcs_arg, int32_t max_minimum_depth_arg, jboolean force_announced_channel_preference_arg, int16_t their_to_self_delay_arg) {
LDKChannelHandshakeLimits ret_var = 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);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1default(JNIEnv *env, jclass clz) {
LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_default();
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1new(JNIEnv *env, jclass clz, int32_t forwarding_fee_proportional_millionths_arg, int32_t forwarding_fee_base_msat_arg, int16_t cltv_expiry_delta_arg, jboolean announced_channel_arg, jboolean commit_upfront_shutdown_pubkey_arg, int64_t max_dust_htlc_exposure_msat_arg, int64_t force_close_avoidance_max_fee_satoshis_arg) {
LDKChannelConfig ret_var = 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);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelConfig ret_var = ChannelConfig_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1default(JNIEnv *env, jclass clz) {
LDKChannelConfig ret_var = ChannelConfig_default();
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKChannelHandshakeConfig ret_var = UserConfig_get_own_channel_config(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKChannelHandshakeLimits ret_var = UserConfig_get_peer_channel_config_limits(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKChannelConfig ret_var = UserConfig_get_channel_options(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
channel_options_arg_conv.is_owned = (channel_options_arg & 1) || (channel_options_arg == 0);
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);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKUserConfig ret_var = UserConfig_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1default(JNIEnv *env, jclass clz) {
LDKUserConfig ret_var = UserConfig_default();
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKBestBlock ret_var = BestBlock_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1from_1genesis(JNIEnv *env, jclass clz, jclass network) {
LDKNetwork network_conv = LDKNetwork_from_java(env, network);
LDKBestBlock ret_var = BestBlock_from_genesis(network_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK((*env)->GetArrayLength(env, block_hash) == 32);
(*env)->GetByteArrayRegion(env, block_hash, 0, 32, block_hash_ref.data);
LDKBestBlock ret_var = BestBlock_new(block_hash_ref, height);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKOutPoint ret_var = WatchedOutput_get_outpoint(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
script_pubkey_arg_ref.data = MALLOC(script_pubkey_arg_ref.datalen, "LDKCVec_u8Z Bytes");
(*env)->GetByteArrayRegion(env, script_pubkey_arg, 0, script_pubkey_arg_ref.datalen, script_pubkey_arg_ref.data);
LDKWatchedOutput ret_var = WatchedOutput_new(block_hash_arg_ref, outpoint_arg_conv, script_pubkey_arg_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKWatchedOutput ret_var = WatchedOutput_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
FeeEstimator_free(this_ptr_conv);
}
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
+ LDKMonitorUpdateId this_obj_conv;
+ this_obj_conv.inner = (void*)(this_obj & (~1));
+ this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+ MonitorUpdateId_free(this_obj_conv);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKMonitorUpdateId orig_conv;
+ orig_conv.inner = (void*)(orig & (~1));
+ orig_conv.is_owned = false;
+ LDKMonitorUpdateId ret_var = MonitorUpdateId_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.
+ 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_MonitorUpdateId_1hash(JNIEnv *env, jclass clz, int64_t o) {
+ LDKMonitorUpdateId o_conv;
+ o_conv.inner = (void*)(o & (~1));
+ o_conv.is_owned = false;
+ int64_t ret_val = MonitorUpdateId_hash(&o_conv);
+ return ret_val;
+}
+
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKMonitorUpdateId a_conv;
+ a_conv.inner = (void*)(a & (~1));
+ a_conv.is_owned = false;
+ LDKMonitorUpdateId b_conv;
+ b_conv.inner = (void*)(b & (~1));
+ b_conv.is_owned = false;
+ jboolean ret_val = MonitorUpdateId_eq(&a_conv, &b_conv);
+ return ret_val;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Persist_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);
LDKPersist_JCalls_cloned(&persister_conv);
}
LDKChainMonitor ret_var = ChainMonitor_new(chain_source_conv, broadcaster_conv, logger_conv, feeest_conv, persister_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
}
(*env)->ReleaseLongArrayElements(env, ignored_channels, ignored_channels_vals, 0);
LDKCVec_BalanceZ ret_var = ChainMonitor_get_claimable_balances(&this_arg_conv, ignored_channels_constr);
- int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t j = 0; j < ret_var.datalen; j++) {
LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCVec_OutPointZ ret_var = ChainMonitor_list_monitors(&this_arg_conv);
- int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t k = 0; k < ret_var.datalen; k++) {
LDKOutPoint ret_conv_10_var = ret_var.data[k];
+ uint64_t ret_conv_10_ref = 0;
CHECK((((uint64_t)ret_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t ret_conv_10_ref = (uint64_t)ret_conv_10_var.inner;
+ ret_conv_10_ref = (uint64_t)ret_conv_10_var.inner;
if (ret_conv_10_var.is_owned) {
ret_conv_10_ref |= 1;
}
return ret_arr;
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1channel_1monitor_1updated(JNIEnv *env, jclass clz, int64_t this_arg, int64_t funding_txo, int64_t completed_update_id) {
+ LDKChainMonitor this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ LDKOutPoint funding_txo_conv;
+ funding_txo_conv.inner = (void*)(funding_txo & (~1));
+ funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0);
+ funding_txo_conv = OutPoint_clone(&funding_txo_conv);
+ LDKMonitorUpdateId completed_update_id_conv;
+ completed_update_id_conv.inner = (void*)(completed_update_id & (~1));
+ completed_update_id_conv.is_owned = (completed_update_id & 1) || (completed_update_id == 0);
+ completed_update_id_conv = MonitorUpdateId_clone(&completed_update_id_conv);
+ LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
+ *ret_conv = ChainMonitor_channel_monitor_updated(&this_arg_conv, funding_txo_conv, completed_update_id_conv);
+ return (uint64_t)ret_conv;
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1Listen(JNIEnv *env, jclass clz, int64_t this_arg) {
LDKChainMonitor this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKListen* ret_ret =MALLOC(sizeof(LDKListen), "LDKListen");
+ LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen");
*ret_ret = ChainMonitor_as_Listen(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKChainMonitor this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKConfirm* ret_ret =MALLOC(sizeof(LDKConfirm), "LDKConfirm");
+ LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm");
*ret_ret = ChainMonitor_as_Confirm(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKChainMonitor this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKWatch* ret_ret =MALLOC(sizeof(LDKWatch), "LDKWatch");
+ LDKWatch* ret_ret = MALLOC(sizeof(LDKWatch), "LDKWatch");
*ret_ret = ChainMonitor_as_Watch(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKChainMonitor this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKEventsProvider* ret_ret =MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
+ LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
*ret_ret = ChainMonitor_as_EventsProvider(&this_arg_conv);
return (uint64_t)ret_ret;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
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;
+ 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;
+ 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.
+ 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(JNIEnv *env, jclass clz, int64_t orig) {
LDKMonitorUpdateError orig_conv;
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ 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_MonitorEvent_1update_1completed(JNIEnv *env, jclass clz, int64_t funding_txo, int64_t monitor_update_id) {
+ LDKOutPoint funding_txo_conv;
+ funding_txo_conv.inner = (void*)(funding_txo & (~1));
+ funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0);
+ funding_txo_conv = OutPoint_clone(&funding_txo_conv);
+ LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
+ *ret_copy = MonitorEvent_update_completed(funding_txo_conv, monitor_update_id);
+ uint64_t ret_ref = (uint64_t)ret_copy;
+ return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1update_1failed(JNIEnv *env, jclass clz, int64_t a) {
+ LDKOutPoint a_conv;
+ a_conv.inner = (void*)(a & (~1));
+ a_conv.is_owned = (a & 1) || (a == 0);
+ a_conv = OutPoint_clone(&a_conv);
+ LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
+ *ret_copy = MonitorEvent_update_failed(a_conv);
+ uint64_t ret_ref = (uint64_t)ret_copy;
+ return ret_ref;
+}
+
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1write(JNIEnv *env, jclass clz, int64_t obj) {
+ LDKMonitorEvent* obj_conv = (LDKMonitorEvent*)obj;
+ LDKCVec_u8Z ret_var = MonitorEvent_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_HTLCUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKHTLCUpdate this_obj_conv;
this_obj_conv.inner = (void*)(this_obj & (~1));
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKHTLCUpdate ret_var = HTLCUpdate_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelMonitor ret_var = ChannelMonitor_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ret_var = ChannelMonitor_get_outputs_to_watch(&this_arg_conv);
- int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t o = 0; o < ret_var.datalen; o++) {
LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv_40_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ");
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCVec_MonitorEventZ ret_var = ChannelMonitor_get_and_clear_pending_monitor_events(&this_arg_conv);
- int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t o = 0; o < ret_var.datalen; o++) {
LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCVec_EventZ ret_var = ChannelMonitor_get_and_clear_pending_events(&this_arg_conv);
- int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t h = 0; h < ret_var.datalen; h++) {
LDKEvent *ret_conv_7_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
if (!(logger & 1)) { CHECK_ACCESS(logger_ptr); }
LDKLogger* logger_conv = (LDKLogger*)logger_ptr;
LDKCVec_TransactionZ ret_var = ChannelMonitor_get_latest_holder_commitment_txn(&this_arg_conv, logger_conv);
- jobjectArray ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
+ jobjectArray ret_arr = NULL;
+ ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
;
for (size_t i = 0; i < ret_var.datalen; i++) {
LDKTransaction ret_conv_8_var = ret_var.data[i];
Transaction_free(ret_conv_8_var);
(*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr);
}
+
FREE(ret_var.data);
return ret_arr;
}
LDKLogger_JCalls_cloned(&logger_conv);
}
LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_block_connected(&this_arg_conv, header_ref, txdata_constr, height, broadcaster_conv, fee_estimator_conv, logger_conv);
- int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t n = 0; n < ret_var.datalen; n++) {
LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
LDKLogger_JCalls_cloned(&logger_conv);
}
LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_transactions_confirmed(&this_arg_conv, header_ref, txdata_constr, height, broadcaster_conv, fee_estimator_conv, logger_conv);
- int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t n = 0; n < ret_var.datalen; n++) {
LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
LDKLogger_JCalls_cloned(&logger_conv);
}
LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_best_block_updated(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv);
- int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t n = 0; n < ret_var.datalen; n++) {
LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCVec_TxidZ ret_var = ChannelMonitor_get_relevant_txids(&this_arg_conv);
- jobjectArray ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
+ jobjectArray ret_arr = NULL;
+ ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
;
for (size_t i = 0; i < ret_var.datalen; i++) {
int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 32);
(*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 32, ret_var.data[i].data);
(*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr);
}
+
FREE(ret_var.data);
return ret_arr;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKBestBlock ret_var = ChannelMonitor_current_best_block(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCVec_BalanceZ ret_var = ChannelMonitor_get_claimable_balances(&this_arg_conv);
- int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t j = 0; j < ret_var.datalen; j++) {
LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
CHECK((*env)->GetArrayLength(env, txid_arg) == 32);
(*env)->GetByteArrayRegion(env, txid_arg, 0, 32, txid_arg_ref.data);
LDKOutPoint ret_var = OutPoint_new(txid_arg_ref, index_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKOutPoint ret_var = OutPoint_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKOutPoint ret_var = DelayedPaymentOutputDescriptor_get_outpoint(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK((*env)->GetArrayLength(env, channel_keys_id_arg) == 32);
(*env)->GetByteArrayRegion(env, channel_keys_id_arg, 0, 32, channel_keys_id_arg_ref.data);
LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_new(outpoint_arg_conv, per_commitment_point_arg_ref, to_self_delay_arg, output_arg_conv, revocation_pubkey_arg_ref, channel_keys_id_arg_ref, channel_value_satoshis_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKOutPoint ret_var = StaticPaymentOutputDescriptor_get_outpoint(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK((*env)->GetArrayLength(env, channel_keys_id_arg) == 32);
(*env)->GetByteArrayRegion(env, channel_keys_id_arg, 0, 32, channel_keys_id_arg_ref.data);
LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_new(outpoint_arg_conv, output_arg_conv, channel_keys_id_arg_ref, channel_value_satoshis_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
void* orig_ptr = (void*)(((uint64_t)orig) & ~1);
if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); }
LDKSign* orig_conv = (LDKSign*)orig_ptr;
- LDKSign* ret_ret =MALLOC(sizeof(LDKSign), "LDKSign");
+ LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
*ret_ret = Sign_clone(orig_conv);
return (uint64_t)ret_ret;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKInMemorySigner ret_var = InMemorySigner_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK((*env)->GetArrayLength(env, channel_keys_id) == 32);
(*env)->GetByteArrayRegion(env, channel_keys_id, 0, 32, channel_keys_id_ref.data);
LDKInMemorySigner ret_var = InMemorySigner_new(funding_key_ref, revocation_base_key_ref, payment_key_ref, delayed_payment_base_key_ref, htlc_base_key_ref, commitment_seed_ref, channel_value_satoshis, channel_keys_id_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKChannelPublicKeys ret_var = InMemorySigner_counterparty_pubkeys(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKOutPoint ret_var = InMemorySigner_funding_outpoint(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKChannelTransactionParameters ret_var = InMemorySigner_get_channel_parameters(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKInMemorySigner this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKBaseSign* ret_ret =MALLOC(sizeof(LDKBaseSign), "LDKBaseSign");
+ LDKBaseSign* ret_ret = MALLOC(sizeof(LDKBaseSign), "LDKBaseSign");
*ret_ret = InMemorySigner_as_BaseSign(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKInMemorySigner this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKSign* ret_ret =MALLOC(sizeof(LDKSign), "LDKSign");
+ LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
*ret_ret = InMemorySigner_as_Sign(&this_arg_conv);
return (uint64_t)ret_ret;
}
(*env)->GetByteArrayRegion(env, seed, 0, 32, seed_arr);
unsigned char (*seed_ref)[32] = &seed_arr;
LDKKeysManager ret_var = KeysManager_new(seed_ref, starting_time_secs, starting_time_nanos);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
(*env)->GetByteArrayRegion(env, params, 0, 32, params_arr);
unsigned char (*params_ref)[32] = ¶ms_arr;
LDKInMemorySigner ret_var = KeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKKeysManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKKeysInterface* ret_ret =MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface");
+ LDKKeysInterface* ret_ret = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface");
*ret_ret = KeysManager_as_KeysInterface(&this_arg_conv);
return (uint64_t)ret_ret;
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentId_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
- LDKPaymentId this_obj_conv;
- this_obj_conv.inner = (void*)(this_obj & (~1));
- this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
- PaymentId_free(this_obj_conv);
-}
-
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentId_1hash(JNIEnv *env, jclass clz, int64_t o) {
- LDKPaymentId o_conv;
- o_conv.inner = (void*)(o & (~1));
- o_conv.is_owned = false;
- int64_t ret_val = PaymentId_hash(&o_conv);
- return ret_val;
-}
-
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentId_1clone(JNIEnv *env, jclass clz, int64_t orig) {
- LDKPaymentId orig_conv;
- orig_conv.inner = (void*)(orig & (~1));
- orig_conv.is_owned = false;
- LDKPaymentId ret_var = PaymentId_clone(&orig_conv);
- 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.
- uint64_t 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_PaymentId_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
- LDKPaymentId a_conv;
- a_conv.inner = (void*)(a & (~1));
- a_conv.is_owned = false;
- LDKPaymentId b_conv;
- b_conv.inner = (void*)(b & (~1));
- b_conv.is_owned = false;
- jboolean ret_val = PaymentId_eq(&a_conv, &b_conv);
- return ret_val;
-}
-
-JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PaymentId_1write(JNIEnv *env, jclass clz, int64_t obj) {
- LDKPaymentId obj_conv;
- obj_conv.inner = (void*)(obj & (~1));
- obj_conv.is_owned = false;
- LDKCVec_u8Z ret_var = PaymentId_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_PaymentId_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_PaymentIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdDecodeErrorZ), "LDKCResult_PaymentIdDecodeErrorZ");
- *ret_conv = PaymentId_read(ser_ref);
- (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
- return (uint64_t)ret_conv;
-}
-
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKChannelManager this_obj_conv;
this_obj_conv.inner = (void*)(this_obj & (~1));
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKBestBlock ret_var = ChainParameters_get_best_block(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
best_block_arg_conv.is_owned = (best_block_arg & 1) || (best_block_arg == 0);
best_block_arg_conv = BestBlock_clone(&best_block_arg_conv);
LDKChainParameters ret_var = ChainParameters_new(network_arg_conv, best_block_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChainParameters ret_var = ChainParameters_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1new(JNIEnv *env, jclass clz, int32_t fee_base_msat_arg, int32_t fee_proportional_millionths_arg, int16_t cltv_expiry_delta_arg) {
LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_new(fee_base_msat_arg, fee_proportional_millionths_arg, cltv_expiry_delta_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKInitFeatures ret_var = ChannelCounterparty_get_features(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKCounterpartyForwardingInfo ret_var = ChannelCounterparty_get_forwarding_info(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
forwarding_info_arg_conv.is_owned = (forwarding_info_arg & 1) || (forwarding_info_arg == 0);
forwarding_info_arg_conv = CounterpartyForwardingInfo_clone(&forwarding_info_arg_conv);
LDKChannelCounterparty ret_var = ChannelCounterparty_new(node_id_arg_ref, features_arg_conv, unspendable_punishment_reserve_arg, forwarding_info_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelCounterparty ret_var = ChannelCounterparty_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKChannelCounterparty ret_var = ChannelDetails_get_counterparty(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKOutPoint ret_var = ChannelDetails_get_funding_txo(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
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);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelDetails ret_var = ChannelDetails_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ 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_PaymentSendFailure_1partial_1failure(JNIEnv *env, jclass clz, int64_tArray a) {
- LDKCVec_CResult_NoneAPIErrorZZ a_constr;
- a_constr.datalen = (*env)->GetArrayLength(env, a);
- if (a_constr.datalen > 0)
- a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1partial_1failure(JNIEnv *env, jclass clz, int64_tArray results, int64_t failed_paths_retry, int8_tArray payment_id) {
+ LDKCVec_CResult_NoneAPIErrorZZ results_constr;
+ results_constr.datalen = (*env)->GetArrayLength(env, results);
+ if (results_constr.datalen > 0)
+ results_constr.data = MALLOC(results_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
else
- a_constr.data = NULL;
- int64_t* a_vals = (*env)->GetLongArrayElements (env, a, NULL);
- for (size_t w = 0; w < a_constr.datalen; w++) {
- int64_t a_conv_22 = a_vals[w];
- void* a_conv_22_ptr = (void*)(((uint64_t)a_conv_22) & ~1);
- CHECK_ACCESS(a_conv_22_ptr);
- LDKCResult_NoneAPIErrorZ a_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(a_conv_22_ptr);
- a_conv_22_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)(((uint64_t)a_conv_22) & ~1));
- a_constr.data[w] = a_conv_22_conv;
- }
- (*env)->ReleaseLongArrayElements(env, a, a_vals, 0);
+ results_constr.data = NULL;
+ int64_t* results_vals = (*env)->GetLongArrayElements (env, results, NULL);
+ for (size_t w = 0; w < results_constr.datalen; w++) {
+ int64_t results_conv_22 = results_vals[w];
+ void* results_conv_22_ptr = (void*)(((uint64_t)results_conv_22) & ~1);
+ CHECK_ACCESS(results_conv_22_ptr);
+ LDKCResult_NoneAPIErrorZ results_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(results_conv_22_ptr);
+ results_constr.data[w] = results_conv_22_conv;
+ }
+ (*env)->ReleaseLongArrayElements(env, results, results_vals, 0);
+ LDKRouteParameters failed_paths_retry_conv;
+ failed_paths_retry_conv.inner = (void*)(failed_paths_retry & (~1));
+ failed_paths_retry_conv.is_owned = (failed_paths_retry & 1) || (failed_paths_retry == 0);
+ failed_paths_retry_conv = RouteParameters_clone(&failed_paths_retry_conv);
+ LDKThirtyTwoBytes payment_id_ref;
+ CHECK((*env)->GetArrayLength(env, payment_id) == 32);
+ (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
- *ret_copy = PaymentSendFailure_partial_failure(a_constr);
+ *ret_copy = PaymentSendFailure_partial_failure(results_constr, failed_paths_retry_conv, payment_id_ref);
uint64_t ret_ref = (uint64_t)ret_copy;
return ret_ref;
}
params_conv.is_owned = (params & 1) || (params == 0);
params_conv = ChainParameters_clone(¶ms_conv);
LDKChannelManager ret_var = ChannelManager_new(fee_est_conv, chain_monitor_conv, tx_broadcaster_conv, logger_conv, keys_manager_conv, config_conv, params_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKUserConfig ret_var = ChannelManager_get_current_default_configuration(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_channels(&this_arg_conv);
- int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t q = 0; q < ret_var.datalen; q++) {
LDKChannelDetails ret_conv_16_var = ret_var.data[q];
+ uint64_t ret_conv_16_ref = 0;
CHECK((((uint64_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner;
+ ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner;
if (ret_conv_16_var.is_owned) {
ret_conv_16_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_usable_channels(&this_arg_conv);
- int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t q = 0; q < ret_var.datalen; q++) {
LDKChannelDetails ret_conv_16_var = ret_var.data[q];
+ uint64_t ret_conv_16_ref = 0;
CHECK((((uint64_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner;
+ ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner;
if (ret_conv_16_var.is_owned) {
ret_conv_16_ref |= 1;
}
return (uint64_t)ret_conv;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1retry_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t route, int64_t payment_id) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1retry_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t route, int8_tArray payment_id) {
LDKChannelManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKRoute route_conv;
route_conv.inner = (void*)(route & (~1));
route_conv.is_owned = false;
- LDKPaymentId payment_id_conv;
- payment_id_conv.inner = (void*)(payment_id & (~1));
- payment_id_conv.is_owned = (payment_id & 1) || (payment_id == 0);
- payment_id_conv = PaymentId_clone(&payment_id_conv);
+ LDKThirtyTwoBytes payment_id_ref;
+ CHECK((*env)->GetArrayLength(env, payment_id) == 32);
+ (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
- *ret_conv = ChannelManager_retry_payment(&this_arg_conv, &route_conv, payment_id_conv);
+ *ret_conv = ChannelManager_retry_payment(&this_arg_conv, &route_conv, payment_id_ref);
return (uint64_t)ret_conv;
}
return ret_arr;
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1channel_1monitor_1updated(JNIEnv *env, jclass clz, int64_t this_arg, int64_t funding_txo, int64_t highest_applied_update_id) {
- LDKChannelManager this_arg_conv;
- this_arg_conv.inner = (void*)(this_arg & (~1));
- this_arg_conv.is_owned = false;
- LDKOutPoint funding_txo_conv;
- funding_txo_conv.inner = (void*)(funding_txo & (~1));
- funding_txo_conv.is_owned = false;
- ChannelManager_channel_monitor_updated(&this_arg_conv, &funding_txo_conv, highest_applied_update_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, int64_t user_payment_id) {
LDKChannelManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
LDKChannelManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKMessageSendEventsProvider* ret_ret =MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
+ LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
*ret_ret = ChannelManager_as_MessageSendEventsProvider(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKChannelManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKEventsProvider* ret_ret =MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
+ LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
*ret_ret = ChannelManager_as_EventsProvider(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKChannelManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKListen* ret_ret =MALLOC(sizeof(LDKListen), "LDKListen");
+ LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen");
*ret_ret = ChannelManager_as_Listen(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKChannelManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKConfirm* ret_ret =MALLOC(sizeof(LDKConfirm), "LDKConfirm");
+ LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm");
*ret_ret = ChannelManager_as_Confirm(&this_arg_conv);
return (uint64_t)ret_ret;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKBestBlock ret_var = ChannelManager_current_best_block(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKChannelManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKChannelMessageHandler* ret_ret =MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
+ LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
*ret_ret = ChannelManager_as_ChannelMessageHandler(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKChannelManagerReadArgs this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- uint64_t ret_ret = (uint64_t)ChannelManagerReadArgs_get_keys_manager(&this_ptr_conv);
+ // WARNING: This object doesn't live past this scope, needs clone!
+ uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_keys_manager(&this_ptr_conv)) | 1;
return ret_ret;
}
LDKChannelManagerReadArgs this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- uint64_t ret_ret = (uint64_t)ChannelManagerReadArgs_get_fee_estimator(&this_ptr_conv);
+ // WARNING: This object doesn't live past this scope, needs clone!
+ uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_fee_estimator(&this_ptr_conv)) | 1;
return ret_ret;
}
LDKChannelManagerReadArgs this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- uint64_t ret_ret = (uint64_t)ChannelManagerReadArgs_get_chain_monitor(&this_ptr_conv);
+ // WARNING: This object doesn't live past this scope, needs clone!
+ uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_chain_monitor(&this_ptr_conv)) | 1;
return ret_ret;
}
LDKChannelManagerReadArgs this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- uint64_t ret_ret = (uint64_t)ChannelManagerReadArgs_get_tx_broadcaster(&this_ptr_conv);
+ // WARNING: This object doesn't live past this scope, needs clone!
+ uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_tx_broadcaster(&this_ptr_conv)) | 1;
return ret_ret;
}
LDKChannelManagerReadArgs this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- uint64_t ret_ret = (uint64_t)ChannelManagerReadArgs_get_logger(&this_ptr_conv);
+ // WARNING: This object doesn't live past this scope, needs clone!
+ uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_logger(&this_ptr_conv)) | 1;
return ret_ret;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKUserConfig ret_var = ChannelManagerReadArgs_get_default_config(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
}
(*env)->ReleaseLongArrayElements(env, channel_monitors, channel_monitors_vals, 0);
LDKChannelManagerReadArgs ret_var = ChannelManagerReadArgs_new(keys_manager_conv, fee_estimator_conv, chain_monitor_conv, tx_broadcaster_conv, logger_conv, default_config_conv, channel_monitors_constr);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKDecodeError ret_var = DecodeError_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKInitFeatures ret_var = Init_get_features(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0);
features_arg_conv = InitFeatures_clone(&features_arg_conv);
LDKInit ret_var = Init_new(features_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKInit ret_var = Init_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
(*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
LDKStr data_arg_conv = java_to_owned_str(env, data_arg);
LDKErrorMessage ret_var = ErrorMessage_new(channel_id_arg_ref, data_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKErrorMessage ret_var = ErrorMessage_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1new(JNIEnv *env, jclass clz, int16_t ponglen_arg, int16_t byteslen_arg) {
LDKPing ret_var = Ping_new(ponglen_arg, byteslen_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKPing ret_var = Ping_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1new(JNIEnv *env, jclass clz, int16_t byteslen_arg) {
LDKPong ret_var = Pong_new(byteslen_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKPong ret_var = Pong_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKOpenChannel ret_var = OpenChannel_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKAcceptChannel ret_var = AcceptChannel_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK((*env)->GetArrayLength(env, signature_arg) == 64);
(*env)->GetByteArrayRegion(env, signature_arg, 0, 64, signature_arg_ref.compact_form);
LDKFundingCreated ret_var = FundingCreated_new(temporary_channel_id_arg_ref, funding_txid_arg_ref, funding_output_index_arg, signature_arg_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKFundingCreated ret_var = FundingCreated_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK((*env)->GetArrayLength(env, signature_arg) == 64);
(*env)->GetByteArrayRegion(env, signature_arg, 0, 64, signature_arg_ref.compact_form);
LDKFundingSigned ret_var = FundingSigned_new(channel_id_arg_ref, signature_arg_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKFundingSigned ret_var = FundingSigned_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK((*env)->GetArrayLength(env, next_per_commitment_point_arg) == 33);
(*env)->GetByteArrayRegion(env, next_per_commitment_point_arg, 0, 33, next_per_commitment_point_arg_ref.compressed_form);
LDKFundingLocked ret_var = FundingLocked_new(channel_id_arg_ref, next_per_commitment_point_arg_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKFundingLocked ret_var = FundingLocked_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
scriptpubkey_arg_ref.data = MALLOC(scriptpubkey_arg_ref.datalen, "LDKCVec_u8Z Bytes");
(*env)->GetByteArrayRegion(env, scriptpubkey_arg, 0, scriptpubkey_arg_ref.datalen, scriptpubkey_arg_ref.data);
LDKShutdown ret_var = Shutdown_new(channel_id_arg_ref, scriptpubkey_arg_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKShutdown ret_var = Shutdown_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1new(JNIEnv *env, jclass clz, int64_t min_fee_satoshis_arg, int64_t max_fee_satoshis_arg) {
LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_new(min_fee_satoshis_arg, max_fee_satoshis_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKClosingSignedFeeRange ret_var = ClosingSigned_get_fee_range(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
fee_range_arg_conv.is_owned = (fee_range_arg & 1) || (fee_range_arg == 0);
fee_range_arg_conv = ClosingSignedFeeRange_clone(&fee_range_arg_conv);
LDKClosingSigned ret_var = ClosingSigned_new(channel_id_arg_ref, fee_satoshis_arg, signature_arg_ref, fee_range_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKClosingSigned ret_var = ClosingSigned_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKUpdateAddHTLC ret_var = UpdateAddHTLC_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK((*env)->GetArrayLength(env, payment_preimage_arg) == 32);
(*env)->GetByteArrayRegion(env, payment_preimage_arg, 0, 32, payment_preimage_arg_ref.data);
LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_new(channel_id_arg_ref, htlc_id_arg, payment_preimage_arg_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKUpdateFailHTLC ret_var = UpdateFailHTLC_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKUpdateFailMalformedHTLC ret_var = UpdateFailMalformedHTLC_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
htlc_signatures_arg_constr.data[i] = htlc_signatures_arg_conv_8_ref;
}
LDKCommitmentSigned ret_var = CommitmentSigned_new(channel_id_arg_ref, signature_arg_ref, htlc_signatures_arg_constr);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKCommitmentSigned ret_var = CommitmentSigned_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK((*env)->GetArrayLength(env, next_per_commitment_point_arg) == 33);
(*env)->GetByteArrayRegion(env, next_per_commitment_point_arg, 0, 33, next_per_commitment_point_arg_ref.compressed_form);
LDKRevokeAndACK ret_var = RevokeAndACK_new(channel_id_arg_ref, per_commitment_secret_arg_ref, next_per_commitment_point_arg_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKRevokeAndACK ret_var = RevokeAndACK_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32);
(*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
LDKUpdateFee ret_var = UpdateFee_new(channel_id_arg_ref, feerate_per_kw_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKUpdateFee ret_var = UpdateFee_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK((*env)->GetArrayLength(env, my_current_per_commitment_point_arg) == 33);
(*env)->GetByteArrayRegion(env, my_current_per_commitment_point_arg, 0, 33, my_current_per_commitment_point_arg_ref.compressed_form);
LDKDataLossProtect ret_var = DataLossProtect_new(your_last_per_commitment_secret_arg_ref, my_current_per_commitment_point_arg_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKDataLossProtect ret_var = DataLossProtect_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelReestablish ret_var = ChannelReestablish_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK((*env)->GetArrayLength(env, bitcoin_signature_arg) == 64);
(*env)->GetByteArrayRegion(env, bitcoin_signature_arg, 0, 64, bitcoin_signature_arg_ref.compact_form);
LDKAnnouncementSignatures ret_var = AnnouncementSignatures_new(channel_id_arg_ref, short_channel_id_arg, node_signature_arg_ref, bitcoin_signature_arg_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKAnnouncementSignatures ret_var = AnnouncementSignatures_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
return ret_arr;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Result_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_CResult_NetAddressu8ZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CResult_NetAddressu8ZDecodeErrorZ), "LDKCResult_CResult_NetAddressu8ZDecodeErrorZ");
- *ret_conv = Result_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_NetAddress_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = (*env)->GetArrayLength(env, ser);
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKNodeFeatures ret_var = UnsignedNodeAnnouncement_get_features(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKUnsignedNodeAnnouncement ret_var = NodeAnnouncement_get_contents(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
contents_arg_conv.is_owned = (contents_arg & 1) || (contents_arg == 0);
contents_arg_conv = UnsignedNodeAnnouncement_clone(&contents_arg_conv);
LDKNodeAnnouncement ret_var = NodeAnnouncement_new(signature_arg_ref, contents_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKNodeAnnouncement ret_var = NodeAnnouncement_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKChannelFeatures ret_var = UnsignedChannelAnnouncement_get_features(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKUnsignedChannelAnnouncement ret_var = UnsignedChannelAnnouncement_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKUnsignedChannelAnnouncement ret_var = ChannelAnnouncement_get_contents(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
contents_arg_conv.is_owned = (contents_arg & 1) || (contents_arg == 0);
contents_arg_conv = UnsignedChannelAnnouncement_clone(&contents_arg_conv);
LDKChannelAnnouncement ret_var = ChannelAnnouncement_new(node_signature_1_arg_ref, node_signature_2_arg_ref, bitcoin_signature_1_arg_ref, bitcoin_signature_2_arg_ref, contents_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelAnnouncement ret_var = ChannelAnnouncement_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKUnsignedChannelUpdate ret_var = ChannelUpdate_get_contents(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
contents_arg_conv.is_owned = (contents_arg & 1) || (contents_arg == 0);
contents_arg_conv = UnsignedChannelUpdate_clone(&contents_arg_conv);
LDKChannelUpdate ret_var = ChannelUpdate_new(signature_arg_ref, contents_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelUpdate ret_var = ChannelUpdate_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32);
(*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data);
LDKQueryChannelRange ret_var = QueryChannelRange_new(chain_hash_arg_ref, first_blocknum_arg, number_of_blocks_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKQueryChannelRange ret_var = QueryChannelRange_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
}
(*env)->ReleaseLongArrayElements(env, short_channel_ids_arg, short_channel_ids_arg_vals, 0);
LDKReplyChannelRange ret_var = ReplyChannelRange_new(chain_hash_arg_ref, first_blocknum_arg, number_of_blocks_arg, sync_complete_arg, short_channel_ids_arg_constr);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKReplyChannelRange ret_var = ReplyChannelRange_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
}
(*env)->ReleaseLongArrayElements(env, short_channel_ids_arg, short_channel_ids_arg_vals, 0);
LDKQueryShortChannelIds ret_var = QueryShortChannelIds_new(chain_hash_arg_ref, short_channel_ids_arg_constr);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKQueryShortChannelIds ret_var = QueryShortChannelIds_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32);
(*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data);
LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_new(chain_hash_arg_ref, full_information_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32);
(*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data);
LDKGossipTimestampFilter ret_var = GossipTimestampFilter_new(chain_hash_arg_ref, first_timestamp_arg, timestamp_range_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKGossipTimestampFilter ret_var = GossipTimestampFilter_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKErrorAction action_arg_conv = *(LDKErrorAction*)(action_arg_ptr);
action_arg_conv = ErrorAction_clone((LDKErrorAction*)(((uint64_t)action_arg) & ~1));
LDKLightningError ret_var = LightningError_new(err_arg_conv, action_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKLightningError ret_var = LightningError_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKCVec_UpdateAddHTLCZ ret_var = CommitmentUpdate_get_update_add_htlcs(&this_ptr_conv);
- int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t p = 0; p < ret_var.datalen; p++) {
LDKUpdateAddHTLC ret_conv_15_var = ret_var.data[p];
+ uint64_t ret_conv_15_ref = 0;
CHECK((((uint64_t)ret_conv_15_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_conv_15_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t ret_conv_15_ref = (uint64_t)ret_conv_15_var.inner;
+ ret_conv_15_ref = (uint64_t)ret_conv_15_var.inner;
if (ret_conv_15_var.is_owned) {
ret_conv_15_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKCVec_UpdateFulfillHTLCZ ret_var = CommitmentUpdate_get_update_fulfill_htlcs(&this_ptr_conv);
- int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t t = 0; t < ret_var.datalen; t++) {
LDKUpdateFulfillHTLC ret_conv_19_var = ret_var.data[t];
+ uint64_t ret_conv_19_ref = 0;
CHECK((((uint64_t)ret_conv_19_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_conv_19_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t ret_conv_19_ref = (uint64_t)ret_conv_19_var.inner;
+ ret_conv_19_ref = (uint64_t)ret_conv_19_var.inner;
if (ret_conv_19_var.is_owned) {
ret_conv_19_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKCVec_UpdateFailHTLCZ ret_var = CommitmentUpdate_get_update_fail_htlcs(&this_ptr_conv);
- int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t q = 0; q < ret_var.datalen; q++) {
LDKUpdateFailHTLC ret_conv_16_var = ret_var.data[q];
+ uint64_t ret_conv_16_ref = 0;
CHECK((((uint64_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner;
+ ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner;
if (ret_conv_16_var.is_owned) {
ret_conv_16_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKCVec_UpdateFailMalformedHTLCZ ret_var = CommitmentUpdate_get_update_fail_malformed_htlcs(&this_ptr_conv);
- int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t z = 0; z < ret_var.datalen; z++) {
LDKUpdateFailMalformedHTLC ret_conv_25_var = ret_var.data[z];
+ uint64_t ret_conv_25_ref = 0;
CHECK((((uint64_t)ret_conv_25_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_conv_25_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t ret_conv_25_ref = (uint64_t)ret_conv_25_var.inner;
+ ret_conv_25_ref = (uint64_t)ret_conv_25_var.inner;
if (ret_conv_25_var.is_owned) {
ret_conv_25_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKUpdateFee ret_var = CommitmentUpdate_get_update_fee(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKCommitmentSigned ret_var = CommitmentUpdate_get_commitment_signed(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
commitment_signed_arg_conv.is_owned = (commitment_signed_arg & 1) || (commitment_signed_arg == 0);
commitment_signed_arg_conv = CommitmentSigned_clone(&commitment_signed_arg_conv);
LDKCommitmentUpdate ret_var = CommitmentUpdate_new(update_add_htlcs_arg_constr, update_fulfill_htlcs_arg_constr, update_fail_htlcs_arg_constr, update_fail_malformed_htlcs_arg_constr, update_fee_arg_conv, commitment_signed_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKCommitmentUpdate ret_var = CommitmentUpdate_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1new(JNIEnv *env, jclass clz) {
LDKIgnoringMessageHandler ret_var = IgnoringMessageHandler_new();
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKIgnoringMessageHandler this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKMessageSendEventsProvider* ret_ret =MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
+ LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
*ret_ret = IgnoringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKIgnoringMessageHandler this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKRoutingMessageHandler* ret_ret =MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
+ LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
*ret_ret = IgnoringMessageHandler_as_RoutingMessageHandler(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKIgnoringMessageHandler this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKCustomMessageReader* ret_ret =MALLOC(sizeof(LDKCustomMessageReader), "LDKCustomMessageReader");
+ LDKCustomMessageReader* ret_ret = MALLOC(sizeof(LDKCustomMessageReader), "LDKCustomMessageReader");
*ret_ret = IgnoringMessageHandler_as_CustomMessageReader(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKIgnoringMessageHandler this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKCustomMessageHandler* ret_ret =MALLOC(sizeof(LDKCustomMessageHandler), "LDKCustomMessageHandler");
+ LDKCustomMessageHandler* ret_ret = MALLOC(sizeof(LDKCustomMessageHandler), "LDKCustomMessageHandler");
*ret_ret = IgnoringMessageHandler_as_CustomMessageHandler(&this_arg_conv);
return (uint64_t)ret_ret;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroringMessageHandler_1new(JNIEnv *env, jclass clz) {
LDKErroringMessageHandler ret_var = ErroringMessageHandler_new();
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKErroringMessageHandler this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKMessageSendEventsProvider* ret_ret =MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
+ LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
*ret_ret = ErroringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKErroringMessageHandler this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKChannelMessageHandler* ret_ret =MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
+ LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
*ret_ret = ErroringMessageHandler_as_ChannelMessageHandler(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKMessageHandler this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- uint64_t ret_ret = (uint64_t)MessageHandler_get_chan_handler(&this_ptr_conv);
+ // WARNING: This object doesn't live past this scope, needs clone!
+ uint64_t ret_ret = ((uint64_t)MessageHandler_get_chan_handler(&this_ptr_conv)) | 1;
return ret_ret;
}
LDKMessageHandler this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- uint64_t ret_ret = (uint64_t)MessageHandler_get_route_handler(&this_ptr_conv);
+ // WARNING: This object doesn't live past this scope, needs clone!
+ uint64_t ret_ret = ((uint64_t)MessageHandler_get_route_handler(&this_ptr_conv)) | 1;
return ret_ret;
}
LDKRoutingMessageHandler_JCalls_cloned(&route_handler_arg_conv);
}
LDKMessageHandler ret_var = MessageHandler_new(chan_handler_arg_conv, route_handler_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
void* orig_ptr = (void*)(((uint64_t)orig) & ~1);
if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); }
LDKSocketDescriptor* orig_conv = (LDKSocketDescriptor*)orig_ptr;
- LDKSocketDescriptor* ret_ret =MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
+ LDKSocketDescriptor* ret_ret = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
*ret_ret = SocketDescriptor_clone(orig_conv);
return (uint64_t)ret_ret;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1new(JNIEnv *env, jclass clz, jboolean no_connection_possible_arg) {
LDKPeerHandleError ret_var = PeerHandleError_new(no_connection_possible_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKPeerHandleError ret_var = PeerHandleError_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKCustomMessageHandler_JCalls_cloned(&custom_message_handler_conv);
}
LDKPeerManager ret_var = PeerManager_new(message_handler_conv, our_node_secret_ref, ephemeral_random_data_ref, logger_conv, custom_message_handler_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCVec_PublicKeyZ ret_var = PeerManager_get_peer_node_ids(&this_arg_conv);
- jobjectArray ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
+ jobjectArray ret_arr = NULL;
+ ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
;
for (size_t i = 0; i < ret_var.datalen; i++) {
int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 33, ret_var.data[i].compressed_form);
(*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr);
}
+
FREE(ret_var.data);
return ret_arr;
}
PeerManager_disconnect_by_node_id(&this_arg_conv, node_id_ref, no_connection_possible);
}
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1disconnect_1all_1peers(JNIEnv *env, jclass clz, int64_t this_arg) {
+ LDKPeerManager this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ PeerManager_disconnect_all_peers(&this_arg_conv);
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1timer_1tick_1occurred(JNIEnv *env, jclass clz, int64_t this_arg) {
LDKPeerManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
CHECK((*env)->GetArrayLength(env, broadcaster_delayed_payment_key_arg) == 33);
(*env)->GetByteArrayRegion(env, broadcaster_delayed_payment_key_arg, 0, 33, broadcaster_delayed_payment_key_arg_ref.compressed_form);
LDKTxCreationKeys ret_var = TxCreationKeys_new(per_commitment_point_arg_ref, revocation_key_arg_ref, broadcaster_htlc_key_arg_ref, countersignatory_htlc_key_arg_ref, broadcaster_delayed_payment_key_arg_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKTxCreationKeys ret_var = TxCreationKeys_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK((*env)->GetArrayLength(env, htlc_basepoint_arg) == 33);
(*env)->GetByteArrayRegion(env, htlc_basepoint_arg, 0, 33, htlc_basepoint_arg_ref.compressed_form);
LDKChannelPublicKeys ret_var = ChannelPublicKeys_new(funding_pubkey_arg_ref, revocation_basepoint_arg_ref, payment_point_arg_ref, delayed_payment_basepoint_arg_ref, htlc_basepoint_arg_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelPublicKeys ret_var = ChannelPublicKeys_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKCOption_u32Z transaction_output_index_arg_conv = *(LDKCOption_u32Z*)(transaction_output_index_arg_ptr);
transaction_output_index_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)(((uint64_t)transaction_output_index_arg) & ~1));
LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_new(offered_arg, amount_msat_arg, cltv_expiry_arg, payment_hash_arg_ref, transaction_output_index_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKChannelPublicKeys ret_var = ChannelTransactionParameters_get_holder_pubkeys(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKCounterpartyChannelTransactionParameters ret_var = ChannelTransactionParameters_get_counterparty_parameters(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKOutPoint ret_var = ChannelTransactionParameters_get_funding_outpoint(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
funding_outpoint_arg_conv.is_owned = (funding_outpoint_arg & 1) || (funding_outpoint_arg == 0);
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);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKChannelPublicKeys ret_var = CounterpartyChannelTransactionParameters_get_pubkeys(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
pubkeys_arg_conv.is_owned = (pubkeys_arg & 1) || (pubkeys_arg == 0);
pubkeys_arg_conv = ChannelPublicKeys_clone(&pubkeys_arg_conv);
LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_new(pubkeys_arg_conv, selected_contest_delay_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_holder_broadcastable(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_counterparty_broadcastable(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_broadcaster_pubkeys(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_countersignatory_pubkeys(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKOutPoint ret_var = DirectedChannelTransactionParameters_funding_outpoint(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK((*env)->GetArrayLength(env, counterparty_funding_key) == 33);
(*env)->GetByteArrayRegion(env, counterparty_funding_key, 0, 33, counterparty_funding_key_ref.compressed_form);
LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_new(commitment_tx_conv, counterparty_sig_ref, counterparty_htlc_sigs_constr, holder_funding_key_ref, counterparty_funding_key_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK((*env)->GetArrayLength(env, txid_arg) == 32);
(*env)->GetByteArrayRegion(env, txid_arg, 0, 32, txid_arg_ref.data);
LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_new(transaction_arg_ref, txid_arg_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKClosingTransaction ret_var = ClosingTransaction_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
funding_outpoint_conv.is_owned = (funding_outpoint & 1) || (funding_outpoint == 0);
funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv);
LDKClosingTransaction ret_var = ClosingTransaction_new(to_holder_value_sat, to_counterparty_value_sat, to_holder_script_ref, to_counterparty_script_ref, funding_outpoint_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKTrustedClosingTransaction ret_var = ClosingTransaction_trust(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKCommitmentTransaction ret_var = CommitmentTransaction_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKTrustedCommitmentTransaction ret_var = CommitmentTransaction_trust(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKBuiltCommitmentTransaction ret_var = TrustedCommitmentTransaction_built_transaction(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKTxCreationKeys ret_var = TrustedCommitmentTransaction_keys(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKInitFeatures ret_var = InitFeatures_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKNodeFeatures ret_var = NodeFeatures_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelFeatures ret_var = ChannelFeatures_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKInvoiceFeatures ret_var = InvoiceFeatures_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
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;
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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1known(JNIEnv *env, jclass clz) {
LDKInitFeatures ret_var = InitFeatures_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1empty(JNIEnv *env, jclass clz) {
LDKNodeFeatures ret_var = NodeFeatures_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1known(JNIEnv *env, jclass clz) {
LDKNodeFeatures ret_var = NodeFeatures_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1empty(JNIEnv *env, jclass clz) {
LDKChannelFeatures ret_var = ChannelFeatures_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1known(JNIEnv *env, jclass clz) {
LDKChannelFeatures ret_var = ChannelFeatures_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1empty(JNIEnv *env, jclass clz) {
LDKInvoiceFeatures ret_var = InvoiceFeatures_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1known(JNIEnv *env, jclass clz) {
LDKInvoiceFeatures ret_var = InvoiceFeatures_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKShutdownScript ret_var = ShutdownScript_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
script_arg_ref.data = MALLOC(script_arg_ref.datalen, "LDKCVec_u8Z Bytes");
(*env)->GetByteArrayRegion(env, script_arg, 0, script_arg_ref.datalen, script_arg_ref.data);
LDKInvalidShutdownScript ret_var = InvalidShutdownScript_new(script_arg_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKInvalidShutdownScript ret_var = InvalidShutdownScript_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
(*env)->GetByteArrayRegion(env, pubkey_hash, 0, 20, pubkey_hash_arr);
unsigned char (*pubkey_hash_ref)[20] = &pubkey_hash_arr;
LDKShutdownScript ret_var = ShutdownScript_new_p2wpkh(pubkey_hash_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
(*env)->GetByteArrayRegion(env, script_hash, 0, 32, script_hash_arr);
unsigned char (*script_hash_ref)[32] = &script_hash_arr;
LDKShutdownScript ret_var = ShutdownScript_new_p2wsh(script_hash_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
void* orig_ptr = (void*)(((uint64_t)orig) & ~1);
if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); }
LDKType* orig_conv = (LDKType*)orig_ptr;
- LDKType* ret_ret =MALLOC(sizeof(LDKType), "LDKType");
+ LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType");
*ret_ret = Type_clone(orig_conv);
return (uint64_t)ret_ret;
}
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);
+ 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.
+ 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;
+ 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));
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKNodeId ret_var = NodeId_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK((*env)->GetArrayLength(env, pubkey) == 33);
(*env)->GetByteArrayRegion(env, pubkey, 0, 33, pubkey_ref.compressed_form);
LDKNodeId ret_var = NodeId_from_pubkey(pubkey_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKNetworkGraph ret_var = NetworkGraph_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKNetGraphMsgHandler this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKEventHandler* ret_ret =MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
+ LDKEventHandler* ret_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
*ret_ret = NetGraphMsgHandler_as_EventHandler(&this_arg_conv);
return (uint64_t)ret_ret;
}
NetGraphMsgHandler_free(this_obj_conv);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1get_1network_1graph(JNIEnv *env, jclass clz, int64_t this_ptr) {
- LDKNetGraphMsgHandler this_ptr_conv;
- this_ptr_conv.inner = (void*)(this_ptr & (~1));
- this_ptr_conv.is_owned = false;
- LDKNetworkGraph ret_var = NetGraphMsgHandler_get_network_graph(&this_ptr_conv);
- 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.
- uint64_t 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_NetGraphMsgHandler_1set_1network_1graph(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
- LDKNetGraphMsgHandler this_ptr_conv;
- this_ptr_conv.inner = (void*)(this_ptr & (~1));
- this_ptr_conv.is_owned = false;
- LDKNetworkGraph val_conv;
- val_conv.inner = (void*)(val & (~1));
- val_conv.is_owned = (val & 1) || (val == 0);
- val_conv = NetworkGraph_clone(&val_conv);
- NetGraphMsgHandler_set_network_graph(&this_ptr_conv, val_conv);
-}
-
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1new(JNIEnv *env, jclass clz, int64_t network_graph, int64_t chain_access, int64_t logger) {
LDKNetworkGraph network_graph_conv;
network_graph_conv.inner = (void*)(network_graph & (~1));
- network_graph_conv.is_owned = (network_graph & 1) || (network_graph == 0);
- network_graph_conv = NetworkGraph_clone(&network_graph_conv);
+ network_graph_conv.is_owned = false;
void* chain_access_ptr = (void*)(((uint64_t)chain_access) & ~1);
CHECK_ACCESS(chain_access_ptr);
LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKLogger_JCalls_cloned(&logger_conv);
}
- LDKNetGraphMsgHandler ret_var = NetGraphMsgHandler_new(network_graph_conv, chain_access_conv, logger_conv);
+ LDKNetGraphMsgHandler ret_var = NetGraphMsgHandler_new(&network_graph_conv, chain_access_conv, logger_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKNetGraphMsgHandler this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKRoutingMessageHandler* ret_ret =MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
+ LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
*ret_ret = NetGraphMsgHandler_as_RoutingMessageHandler(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKNetGraphMsgHandler this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKMessageSendEventsProvider* ret_ret =MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
+ LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
*ret_ret = NetGraphMsgHandler_as_MessageSendEventsProvider(&this_arg_conv);
return (uint64_t)ret_ret;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKRoutingFees ret_var = DirectionalChannelInfo_get_fees(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKChannelUpdate ret_var = DirectionalChannelInfo_get_last_update_message(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
last_update_message_arg_conv.is_owned = (last_update_message_arg & 1) || (last_update_message_arg == 0);
last_update_message_arg_conv = ChannelUpdate_clone(&last_update_message_arg_conv);
LDKDirectionalChannelInfo ret_var = DirectionalChannelInfo_new(last_update_arg, enabled_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg_conv, fees_arg_conv, last_update_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKDirectionalChannelInfo ret_var = DirectionalChannelInfo_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKChannelFeatures ret_var = ChannelInfo_get_features(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKNodeId ret_var = ChannelInfo_get_node_one(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKDirectionalChannelInfo ret_var = ChannelInfo_get_one_to_two(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKNodeId ret_var = ChannelInfo_get_node_two(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKDirectionalChannelInfo ret_var = ChannelInfo_get_two_to_one(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKChannelAnnouncement ret_var = ChannelInfo_get_announcement_message(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
announcement_message_arg_conv.is_owned = (announcement_message_arg & 1) || (announcement_message_arg == 0);
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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelInfo ret_var = ChannelInfo_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1new(JNIEnv *env, jclass clz, int32_t base_msat_arg, int32_t proportional_millionths_arg) {
LDKRoutingFees ret_var = RoutingFees_new(base_msat_arg, proportional_millionths_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKRoutingFees ret_var = RoutingFees_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKNodeFeatures ret_var = NodeAnnouncementInfo_get_features(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKNodeAnnouncement ret_var = NodeAnnouncementInfo_get_announcement_message(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
announcement_message_arg_conv.is_owned = (announcement_message_arg & 1) || (announcement_message_arg == 0);
announcement_message_arg_conv = NodeAnnouncement_clone(&announcement_message_arg_conv);
LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_new(features_arg_conv, last_update_arg, rgb_arg_ref, alias_arg_ref, addresses_arg_constr, 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKRoutingFees ret_var = NodeInfo_get_lowest_inbound_channel_fees(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKNodeAnnouncementInfo ret_var = NodeInfo_get_announcement_info(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
announcement_info_arg_conv.is_owned = (announcement_info_arg & 1) || (announcement_info_arg == 0);
announcement_info_arg_conv = NodeAnnouncementInfo_clone(&announcement_info_arg_conv);
LDKNodeInfo ret_var = NodeInfo_new(channels_arg_constr, lowest_inbound_channel_fees_arg_conv, announcement_info_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKNodeInfo ret_var = NodeInfo_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK((*env)->GetArrayLength(env, genesis_hash) == 32);
(*env)->GetByteArrayRegion(env, genesis_hash, 0, 32, genesis_hash_ref.data);
LDKNetworkGraph ret_var = NetworkGraph_new(genesis_hash_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKReadOnlyNetworkGraph ret_var = NetworkGraph_read_only(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKNodeFeatures ret_var = RouteHop_get_node_features(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKChannelFeatures ret_var = RouteHop_get_channel_features(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
channel_features_arg_conv.is_owned = (channel_features_arg & 1) || (channel_features_arg == 0);
channel_features_arg_conv = ChannelFeatures_clone(&channel_features_arg_conv);
LDKRouteHop ret_var = RouteHop_new(pubkey_arg_ref, node_features_arg_conv, short_channel_id_arg, channel_features_arg_conv, fee_msat_arg, cltv_expiry_delta_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKRouteHop ret_var = RouteHop_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKCVec_CVec_RouteHopZZ ret_var = Route_get_paths(&this_ptr_conv);
- jobjectArray ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_J_clz, NULL);
+ jobjectArray ret_arr = NULL;
+ ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_J_clz, NULL);
;
for (size_t m = 0; m < ret_var.datalen; m++) {
LDKCVec_RouteHopZ ret_conv_12_var = ret_var.data[m];
- int64_tArray ret_conv_12_arr = (*env)->NewLongArray(env, ret_conv_12_var.datalen);
+ int64_tArray ret_conv_12_arr = NULL;
+ ret_conv_12_arr = (*env)->NewLongArray(env, ret_conv_12_var.datalen);
int64_t *ret_conv_12_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_conv_12_arr, NULL);
for (size_t k = 0; k < ret_conv_12_var.datalen; k++) {
LDKRouteHop ret_conv_12_conv_10_var = ret_conv_12_var.data[k];
+ uint64_t ret_conv_12_conv_10_ref = 0;
CHECK((((uint64_t)ret_conv_12_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_conv_12_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t ret_conv_12_conv_10_ref = (uint64_t)ret_conv_12_conv_10_var.inner;
+ ret_conv_12_conv_10_ref = (uint64_t)ret_conv_12_conv_10_var.inner;
if (ret_conv_12_conv_10_var.is_owned) {
ret_conv_12_conv_10_ref |= 1;
}
FREE(ret_conv_12_var.data);
(*env)->SetObjectArrayElement(env, ret_arr, m, ret_conv_12_arr);
}
+
FREE(ret_var.data);
return ret_arr;
}
Route_set_paths(&this_ptr_conv, val_constr);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1new(JNIEnv *env, jclass clz, jobjectArray paths_arg) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1get_1payee(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKRoute this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKPayee ret_var = Route_get_payee(&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.
+ 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_Route_1set_1payee(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
+ LDKRoute this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKPayee val_conv;
+ val_conv.inner = (void*)(val & (~1));
+ val_conv.is_owned = (val & 1) || (val == 0);
+ val_conv = Payee_clone(&val_conv);
+ Route_set_payee(&this_ptr_conv, val_conv);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1new(JNIEnv *env, jclass clz, jobjectArray paths_arg, int64_t payee_arg) {
LDKCVec_CVec_RouteHopZZ paths_arg_constr;
paths_arg_constr.datalen = (*env)->GetArrayLength(env, paths_arg);
if (paths_arg_constr.datalen > 0)
paths_arg_constr.data = MALLOC(paths_arg_constr.datalen * sizeof(LDKCVec_RouteHopZ), "LDKCVec_CVec_RouteHopZZ Elements");
else
- paths_arg_constr.data = NULL;
- for (size_t m = 0; m < paths_arg_constr.datalen; m++) {
- int64_tArray paths_arg_conv_12 = (*env)->GetObjectArrayElement(env, paths_arg, m);
- LDKCVec_RouteHopZ paths_arg_conv_12_constr;
- paths_arg_conv_12_constr.datalen = (*env)->GetArrayLength(env, paths_arg_conv_12);
- if (paths_arg_conv_12_constr.datalen > 0)
- paths_arg_conv_12_constr.data = MALLOC(paths_arg_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
- else
- paths_arg_conv_12_constr.data = NULL;
- int64_t* paths_arg_conv_12_vals = (*env)->GetLongArrayElements (env, paths_arg_conv_12, NULL);
- for (size_t k = 0; k < paths_arg_conv_12_constr.datalen; k++) {
- int64_t paths_arg_conv_12_conv_10 = paths_arg_conv_12_vals[k];
- LDKRouteHop paths_arg_conv_12_conv_10_conv;
- paths_arg_conv_12_conv_10_conv.inner = (void*)(paths_arg_conv_12_conv_10 & (~1));
- paths_arg_conv_12_conv_10_conv.is_owned = (paths_arg_conv_12_conv_10 & 1) || (paths_arg_conv_12_conv_10 == 0);
- paths_arg_conv_12_conv_10_conv = RouteHop_clone(&paths_arg_conv_12_conv_10_conv);
- paths_arg_conv_12_constr.data[k] = paths_arg_conv_12_conv_10_conv;
- }
- (*env)->ReleaseLongArrayElements(env, paths_arg_conv_12, paths_arg_conv_12_vals, 0);
- paths_arg_constr.data[m] = paths_arg_conv_12_constr;
+ paths_arg_constr.data = NULL;
+ for (size_t m = 0; m < paths_arg_constr.datalen; m++) {
+ int64_tArray paths_arg_conv_12 = (*env)->GetObjectArrayElement(env, paths_arg, m);
+ LDKCVec_RouteHopZ paths_arg_conv_12_constr;
+ paths_arg_conv_12_constr.datalen = (*env)->GetArrayLength(env, paths_arg_conv_12);
+ if (paths_arg_conv_12_constr.datalen > 0)
+ paths_arg_conv_12_constr.data = MALLOC(paths_arg_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
+ else
+ paths_arg_conv_12_constr.data = NULL;
+ int64_t* paths_arg_conv_12_vals = (*env)->GetLongArrayElements (env, paths_arg_conv_12, NULL);
+ for (size_t k = 0; k < paths_arg_conv_12_constr.datalen; k++) {
+ int64_t paths_arg_conv_12_conv_10 = paths_arg_conv_12_vals[k];
+ LDKRouteHop paths_arg_conv_12_conv_10_conv;
+ paths_arg_conv_12_conv_10_conv.inner = (void*)(paths_arg_conv_12_conv_10 & (~1));
+ paths_arg_conv_12_conv_10_conv.is_owned = (paths_arg_conv_12_conv_10 & 1) || (paths_arg_conv_12_conv_10 == 0);
+ paths_arg_conv_12_conv_10_conv = RouteHop_clone(&paths_arg_conv_12_conv_10_conv);
+ paths_arg_conv_12_constr.data[k] = paths_arg_conv_12_conv_10_conv;
+ }
+ (*env)->ReleaseLongArrayElements(env, paths_arg_conv_12, paths_arg_conv_12_vals, 0);
+ paths_arg_constr.data[m] = paths_arg_conv_12_constr;
+ }
+ LDKPayee payee_arg_conv;
+ payee_arg_conv.inner = (void*)(payee_arg & (~1));
+ payee_arg_conv.is_owned = (payee_arg & 1) || (payee_arg == 0);
+ payee_arg_conv = Payee_clone(&payee_arg_conv);
+ LDKRoute ret_var = Route_new(paths_arg_constr, payee_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.
+ 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_Route_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKRoute orig_conv;
+ orig_conv.inner = (void*)(orig & (~1));
+ orig_conv.is_owned = false;
+ LDKRoute ret_var = Route_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.
+ 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_Route_1hash(JNIEnv *env, jclass clz, int64_t o) {
+ LDKRoute o_conv;
+ o_conv.inner = (void*)(o & (~1));
+ o_conv.is_owned = false;
+ int64_t ret_val = Route_hash(&o_conv);
+ return ret_val;
+}
+
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Route_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKRoute a_conv;
+ a_conv.inner = (void*)(a & (~1));
+ a_conv.is_owned = false;
+ LDKRoute b_conv;
+ b_conv.inner = (void*)(b & (~1));
+ b_conv.is_owned = false;
+ jboolean ret_val = Route_eq(&a_conv, &b_conv);
+ return ret_val;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1get_1total_1fees(JNIEnv *env, jclass clz, int64_t this_arg) {
+ LDKRoute this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ int64_t ret_val = Route_get_total_fees(&this_arg_conv);
+ return ret_val;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1get_1total_1amount(JNIEnv *env, jclass clz, int64_t this_arg) {
+ LDKRoute this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ int64_t ret_val = Route_get_total_amount(&this_arg_conv);
+ return ret_val;
+}
+
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Route_1write(JNIEnv *env, jclass clz, int64_t obj) {
+ LDKRoute obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z ret_var = Route_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_Route_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_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
+ *ret_conv = Route_read(ser_ref);
+ (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
+ LDKRouteParameters this_obj_conv;
+ this_obj_conv.inner = (void*)(this_obj & (~1));
+ this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+ RouteParameters_free(this_obj_conv);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1get_1payee(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKRouteParameters this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKPayee ret_var = RouteParameters_get_payee(&this_ptr_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.
+ 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_RouteParameters_1set_1payee(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
+ LDKRouteParameters this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKPayee val_conv;
+ val_conv.inner = (void*)(val & (~1));
+ val_conv.is_owned = (val & 1) || (val == 0);
+ val_conv = Payee_clone(&val_conv);
+ RouteParameters_set_payee(&this_ptr_conv, val_conv);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1get_1final_1value_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKRouteParameters this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ int64_t ret_val = RouteParameters_get_final_value_msat(&this_ptr_conv);
+ return ret_val;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1set_1final_1value_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
+ LDKRouteParameters this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ RouteParameters_set_final_value_msat(&this_ptr_conv, val);
+}
+
+JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1get_1final_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKRouteParameters this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ int32_t ret_val = RouteParameters_get_final_cltv_expiry_delta(&this_ptr_conv);
+ return ret_val;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1set_1final_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
+ LDKRouteParameters this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ RouteParameters_set_final_cltv_expiry_delta(&this_ptr_conv, val);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1new(JNIEnv *env, jclass clz, int64_t payee_arg, int64_t final_value_msat_arg, int32_t final_cltv_expiry_delta_arg) {
+ LDKPayee payee_arg_conv;
+ payee_arg_conv.inner = (void*)(payee_arg & (~1));
+ payee_arg_conv.is_owned = (payee_arg & 1) || (payee_arg == 0);
+ payee_arg_conv = Payee_clone(&payee_arg_conv);
+ LDKRouteParameters ret_var = RouteParameters_new(payee_arg_conv, final_value_msat_arg, final_cltv_expiry_delta_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.
+ 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_RouteParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKRouteParameters orig_conv;
+ orig_conv.inner = (void*)(orig & (~1));
+ orig_conv.is_owned = false;
+ LDKRouteParameters ret_var = RouteParameters_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.
+ 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_RouteParameters_1write(JNIEnv *env, jclass clz, int64_t obj) {
+ LDKRouteParameters obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z ret_var = RouteParameters_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_RouteParameters_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_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
+ *ret_conv = RouteParameters_read(ser_ref);
+ (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payee_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
+ LDKPayee this_obj_conv;
+ this_obj_conv.inner = (void*)(this_obj & (~1));
+ this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+ Payee_free(this_obj_conv);
+}
+
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Payee_1get_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKPayee this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, Payee_get_pubkey(&this_ptr_conv).compressed_form);
+ return ret_arr;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payee_1set_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
+ LDKPayee this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKPublicKey val_ref;
+ CHECK((*env)->GetArrayLength(env, val) == 33);
+ (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
+ Payee_set_pubkey(&this_ptr_conv, val_ref);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKPayee this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKInvoiceFeatures ret_var = Payee_get_features(&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.
+ 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_Payee_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
+ LDKPayee this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKInvoiceFeatures val_conv;
+ val_conv.inner = (void*)(val & (~1));
+ val_conv.is_owned = (val & 1) || (val == 0);
+ val_conv = InvoiceFeatures_clone(&val_conv);
+ Payee_set_features(&this_ptr_conv, val_conv);
+}
+
+JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Payee_1get_1route_1hints(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKPayee this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKCVec_RouteHintZ ret_var = Payee_get_route_hints(&this_ptr_conv);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
+ for (size_t l = 0; l < ret_var.datalen; l++) {
+ LDKRouteHint ret_conv_11_var = ret_var.data[l];
+ uint64_t ret_conv_11_ref = 0;
+ CHECK((((uint64_t)ret_conv_11_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&ret_conv_11_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ ret_conv_11_ref = (uint64_t)ret_conv_11_var.inner;
+ if (ret_conv_11_var.is_owned) {
+ ret_conv_11_ref |= 1;
+ }
+ ret_arr_ptr[l] = ret_conv_11_ref;
+ }
+ (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
+ FREE(ret_var.data);
+ return ret_arr;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payee_1set_1route_1hints(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
+ LDKPayee this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKCVec_RouteHintZ val_constr;
+ val_constr.datalen = (*env)->GetArrayLength(env, val);
+ if (val_constr.datalen > 0)
+ val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
+ else
+ val_constr.data = NULL;
+ int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
+ for (size_t l = 0; l < val_constr.datalen; l++) {
+ int64_t val_conv_11 = val_vals[l];
+ LDKRouteHint val_conv_11_conv;
+ val_conv_11_conv.inner = (void*)(val_conv_11 & (~1));
+ val_conv_11_conv.is_owned = (val_conv_11 & 1) || (val_conv_11 == 0);
+ val_conv_11_conv = RouteHint_clone(&val_conv_11_conv);
+ val_constr.data[l] = val_conv_11_conv;
+ }
+ (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
+ Payee_set_route_hints(&this_ptr_conv, val_constr);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1get_1expiry_1time(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKPayee this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
+ *ret_copy = Payee_get_expiry_time(&this_ptr_conv);
+ uint64_t ret_ref = (uint64_t)ret_copy;
+ return ret_ref;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payee_1set_1expiry_1time(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
+ LDKPayee this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
+ val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)val) & ~1));
+ Payee_set_expiry_time(&this_ptr_conv, val_conv);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1new(JNIEnv *env, jclass clz, int8_tArray pubkey_arg, int64_t features_arg, int64_tArray route_hints_arg, int64_t expiry_time_arg) {
+ LDKPublicKey pubkey_arg_ref;
+ CHECK((*env)->GetArrayLength(env, pubkey_arg) == 33);
+ (*env)->GetByteArrayRegion(env, pubkey_arg, 0, 33, pubkey_arg_ref.compressed_form);
+ LDKInvoiceFeatures features_arg_conv;
+ features_arg_conv.inner = (void*)(features_arg & (~1));
+ features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0);
+ features_arg_conv = InvoiceFeatures_clone(&features_arg_conv);
+ LDKCVec_RouteHintZ route_hints_arg_constr;
+ route_hints_arg_constr.datalen = (*env)->GetArrayLength(env, route_hints_arg);
+ if (route_hints_arg_constr.datalen > 0)
+ route_hints_arg_constr.data = MALLOC(route_hints_arg_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
+ else
+ route_hints_arg_constr.data = NULL;
+ int64_t* route_hints_arg_vals = (*env)->GetLongArrayElements (env, route_hints_arg, NULL);
+ for (size_t l = 0; l < route_hints_arg_constr.datalen; l++) {
+ int64_t route_hints_arg_conv_11 = route_hints_arg_vals[l];
+ LDKRouteHint route_hints_arg_conv_11_conv;
+ route_hints_arg_conv_11_conv.inner = (void*)(route_hints_arg_conv_11 & (~1));
+ route_hints_arg_conv_11_conv.is_owned = (route_hints_arg_conv_11 & 1) || (route_hints_arg_conv_11 == 0);
+ route_hints_arg_conv_11_conv = RouteHint_clone(&route_hints_arg_conv_11_conv);
+ route_hints_arg_constr.data[l] = route_hints_arg_conv_11_conv;
}
- LDKRoute ret_var = Route_new(paths_arg_constr);
+ (*env)->ReleaseLongArrayElements(env, route_hints_arg, route_hints_arg_vals, 0);
+ void* expiry_time_arg_ptr = (void*)(((uint64_t)expiry_time_arg) & ~1);
+ CHECK_ACCESS(expiry_time_arg_ptr);
+ LDKCOption_u64Z expiry_time_arg_conv = *(LDKCOption_u64Z*)(expiry_time_arg_ptr);
+ expiry_time_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)expiry_time_arg) & ~1));
+ LDKPayee ret_var = Payee_new(pubkey_arg_ref, features_arg_conv, route_hints_arg_constr, expiry_time_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ 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_Route_1clone(JNIEnv *env, jclass clz, int64_t orig) {
- LDKRoute orig_conv;
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKPayee orig_conv;
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
- LDKRoute ret_var = Route_clone(&orig_conv);
+ LDKPayee ret_var = Payee_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ 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_Route_1hash(JNIEnv *env, jclass clz, int64_t o) {
- LDKRoute o_conv;
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1hash(JNIEnv *env, jclass clz, int64_t o) {
+ LDKPayee o_conv;
o_conv.inner = (void*)(o & (~1));
o_conv.is_owned = false;
- int64_t ret_val = Route_hash(&o_conv);
+ int64_t ret_val = Payee_hash(&o_conv);
return ret_val;
}
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Route_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
- LDKRoute a_conv;
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Payee_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKPayee a_conv;
a_conv.inner = (void*)(a & (~1));
a_conv.is_owned = false;
- LDKRoute b_conv;
+ LDKPayee b_conv;
b_conv.inner = (void*)(b & (~1));
b_conv.is_owned = false;
- jboolean ret_val = Route_eq(&a_conv, &b_conv);
- return ret_val;
-}
-
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1get_1total_1fees(JNIEnv *env, jclass clz, int64_t this_arg) {
- LDKRoute this_arg_conv;
- this_arg_conv.inner = (void*)(this_arg & (~1));
- this_arg_conv.is_owned = false;
- int64_t ret_val = Route_get_total_fees(&this_arg_conv);
- return ret_val;
-}
-
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1get_1total_1amount(JNIEnv *env, jclass clz, int64_t this_arg) {
- LDKRoute this_arg_conv;
- this_arg_conv.inner = (void*)(this_arg & (~1));
- this_arg_conv.is_owned = false;
- int64_t ret_val = Route_get_total_amount(&this_arg_conv);
+ jboolean ret_val = Payee_eq(&a_conv, &b_conv);
return ret_val;
}
-JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Route_1write(JNIEnv *env, jclass clz, int64_t obj) {
- LDKRoute obj_conv;
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Payee_1write(JNIEnv *env, jclass clz, int64_t obj) {
+ LDKPayee obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z ret_var = Route_write(&obj_conv);
+ LDKCVec_u8Z ret_var = Payee_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_Route_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_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_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
- *ret_conv = Route_read(ser_ref);
+ LDKCResult_PayeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeeDecodeErrorZ), "LDKCResult_PayeeDecodeErrorZ");
+ *ret_conv = Payee_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_Payee_1from_1node_1id(JNIEnv *env, jclass clz, int8_tArray pubkey) {
+ LDKPublicKey pubkey_ref;
+ CHECK((*env)->GetArrayLength(env, pubkey) == 33);
+ (*env)->GetByteArrayRegion(env, pubkey, 0, 33, pubkey_ref.compressed_form);
+ LDKPayee ret_var = Payee_from_node_id(pubkey_ref);
+ 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.
+ 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_Payee_1for_1keysend(JNIEnv *env, jclass clz, int8_tArray pubkey) {
+ LDKPublicKey pubkey_ref;
+ CHECK((*env)->GetArrayLength(env, pubkey) == 33);
+ (*env)->GetByteArrayRegion(env, pubkey, 0, 33, pubkey_ref.compressed_form);
+ LDKPayee ret_var = Payee_for_keysend(pubkey_ref);
+ 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.
+ 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_RouteHint_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKRouteHint this_obj_conv;
this_obj_conv.inner = (void*)(this_obj & (~1));
RouteHint_free(this_obj_conv);
}
+JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKRouteHint this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKCVec_RouteHintHopZ ret_var = RouteHint_get_a(&this_ptr_conv);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
+ for (size_t o = 0; o < ret_var.datalen; o++) {
+ LDKRouteHintHop ret_conv_14_var = ret_var.data[o];
+ uint64_t ret_conv_14_ref = 0;
+ CHECK((((uint64_t)ret_conv_14_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&ret_conv_14_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ ret_conv_14_ref = (uint64_t)ret_conv_14_var.inner;
+ if (ret_conv_14_var.is_owned) {
+ ret_conv_14_ref |= 1;
+ }
+ ret_arr_ptr[o] = ret_conv_14_ref;
+ }
+ (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
+ FREE(ret_var.data);
+ return ret_arr;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
+ LDKRouteHint this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKCVec_RouteHintHopZ val_constr;
+ val_constr.datalen = (*env)->GetArrayLength(env, val);
+ if (val_constr.datalen > 0)
+ val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements");
+ else
+ val_constr.data = NULL;
+ int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
+ for (size_t o = 0; o < val_constr.datalen; o++) {
+ int64_t val_conv_14 = val_vals[o];
+ LDKRouteHintHop val_conv_14_conv;
+ val_conv_14_conv.inner = (void*)(val_conv_14 & (~1));
+ val_conv_14_conv.is_owned = (val_conv_14 & 1) || (val_conv_14 == 0);
+ val_conv_14_conv = RouteHintHop_clone(&val_conv_14_conv);
+ val_constr.data[o] = val_conv_14_conv;
+ }
+ (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
+ RouteHint_set_a(&this_ptr_conv, val_constr);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1new(JNIEnv *env, jclass clz, int64_tArray a_arg) {
+ LDKCVec_RouteHintHopZ a_arg_constr;
+ a_arg_constr.datalen = (*env)->GetArrayLength(env, a_arg);
+ if (a_arg_constr.datalen > 0)
+ a_arg_constr.data = MALLOC(a_arg_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements");
+ else
+ a_arg_constr.data = NULL;
+ int64_t* a_arg_vals = (*env)->GetLongArrayElements (env, a_arg, NULL);
+ for (size_t o = 0; o < a_arg_constr.datalen; o++) {
+ int64_t a_arg_conv_14 = a_arg_vals[o];
+ LDKRouteHintHop a_arg_conv_14_conv;
+ a_arg_conv_14_conv.inner = (void*)(a_arg_conv_14 & (~1));
+ a_arg_conv_14_conv.is_owned = (a_arg_conv_14 & 1) || (a_arg_conv_14 == 0);
+ a_arg_conv_14_conv = RouteHintHop_clone(&a_arg_conv_14_conv);
+ a_arg_constr.data[o] = a_arg_conv_14_conv;
+ }
+ (*env)->ReleaseLongArrayElements(env, a_arg, a_arg_vals, 0);
+ LDKRouteHint ret_var = RouteHint_new(a_arg_constr);
+ 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.
+ 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_RouteHint_1clone(JNIEnv *env, jclass clz, int64_t orig) {
LDKRouteHint orig_conv;
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKRouteHint ret_var = RouteHint_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
return ret_val;
}
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHint_1write(JNIEnv *env, jclass clz, int64_t obj) {
+ LDKRouteHint obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z ret_var = RouteHint_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_RouteHint_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_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
+ *ret_conv = RouteHint_read(ser_ref);
+ (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
+ return (uint64_t)ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKRouteHintHop this_obj_conv;
this_obj_conv.inner = (void*)(this_obj & (~1));
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKRoutingFees ret_var = RouteHintHop_get_fees(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKCOption_u64Z htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_maximum_msat_arg_ptr);
htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)htlc_maximum_msat_arg) & ~1));
LDKRouteHintHop ret_var = RouteHintHop_new(src_node_id_arg_ref, short_channel_id_arg, fees_arg_conv, cltv_expiry_delta_arg, htlc_minimum_msat_arg_conv, htlc_maximum_msat_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKRouteHintHop ret_var = RouteHintHop_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
return ret_val;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_get_1keysend_1route(JNIEnv *env, jclass clz, int8_tArray our_node_pubkey, int64_t network, int8_tArray payee, int64_tArray first_hops, int64_tArray last_hops, int64_t final_value_msat, int32_t final_cltv, int64_t logger, int64_t scorer) {
- LDKPublicKey our_node_pubkey_ref;
- CHECK((*env)->GetArrayLength(env, our_node_pubkey) == 33);
- (*env)->GetByteArrayRegion(env, our_node_pubkey, 0, 33, our_node_pubkey_ref.compressed_form);
- LDKNetworkGraph network_conv;
- network_conv.inner = (void*)(network & (~1));
- network_conv.is_owned = false;
- LDKPublicKey payee_ref;
- CHECK((*env)->GetArrayLength(env, payee) == 33);
- (*env)->GetByteArrayRegion(env, payee, 0, 33, payee_ref.compressed_form);
- LDKCVec_ChannelDetailsZ first_hops_constr;
- LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL;
- if (first_hops != NULL) {
- first_hops_constr.datalen = (*env)->GetArrayLength(env, first_hops);
- if (first_hops_constr.datalen > 0)
- first_hops_constr.data = MALLOC(first_hops_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
- else
- first_hops_constr.data = NULL;
- int64_t* first_hops_vals = (*env)->GetLongArrayElements (env, first_hops, NULL);
- for (size_t q = 0; q < first_hops_constr.datalen; q++) {
- int64_t first_hops_conv_16 = first_hops_vals[q];
- LDKChannelDetails first_hops_conv_16_conv;
- first_hops_conv_16_conv.inner = (void*)(first_hops_conv_16 & (~1));
- first_hops_conv_16_conv.is_owned = (first_hops_conv_16 & 1) || (first_hops_conv_16 == 0);
- first_hops_constr.data[q] = first_hops_conv_16_conv;
- }
- (*env)->ReleaseLongArrayElements(env, first_hops, first_hops_vals, 0);
- first_hops_ptr = &first_hops_constr;
- }
- LDKCVec_RouteHintZ last_hops_constr;
- last_hops_constr.datalen = (*env)->GetArrayLength(env, last_hops);
- if (last_hops_constr.datalen > 0)
- last_hops_constr.data = MALLOC(last_hops_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
- else
- last_hops_constr.data = NULL;
- int64_t* last_hops_vals = (*env)->GetLongArrayElements (env, last_hops, NULL);
- for (size_t l = 0; l < last_hops_constr.datalen; l++) {
- int64_t last_hops_conv_11 = last_hops_vals[l];
- LDKRouteHint last_hops_conv_11_conv;
- last_hops_conv_11_conv.inner = (void*)(last_hops_conv_11 & (~1));
- last_hops_conv_11_conv.is_owned = (last_hops_conv_11 & 1) || (last_hops_conv_11 == 0);
- last_hops_conv_11_conv = RouteHint_clone(&last_hops_conv_11_conv);
- last_hops_constr.data[l] = last_hops_conv_11_conv;
- }
- (*env)->ReleaseLongArrayElements(env, last_hops, last_hops_vals, 0);
- void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
- CHECK_ACCESS(logger_ptr);
- LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
- if (logger_conv.free == LDKLogger_JCalls_free) {
- // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
- LDKLogger_JCalls_cloned(&logger_conv);
- }
- void* scorer_ptr = (void*)(((uint64_t)scorer) & ~1);
- 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 = get_keysend_route(our_node_pubkey_ref, &network_conv, payee_ref, first_hops_ptr, last_hops_constr, final_value_msat, final_cltv, logger_conv, scorer_conv);
- if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1write(JNIEnv *env, jclass clz, int64_t obj) {
+ LDKRouteHintHop obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z ret_var = RouteHintHop_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_RouteHintHop_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_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
+ *ret_conv = RouteHintHop_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_get_1route(JNIEnv *env, jclass clz, int8_tArray our_node_pubkey, int64_t network, int8_tArray payee, int64_t payee_features, int64_tArray first_hops, int64_tArray last_hops, int64_t final_value_msat, int32_t final_cltv, int64_t logger, int64_t scorer) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_find_1route(JNIEnv *env, jclass clz, int8_tArray our_node_pubkey, int64_t params, int64_t network, int64_tArray first_hops, int64_t logger, int64_t scorer) {
LDKPublicKey our_node_pubkey_ref;
CHECK((*env)->GetArrayLength(env, our_node_pubkey) == 33);
(*env)->GetByteArrayRegion(env, our_node_pubkey, 0, 33, our_node_pubkey_ref.compressed_form);
+ LDKRouteParameters params_conv;
+ params_conv.inner = (void*)(params & (~1));
+ params_conv.is_owned = false;
LDKNetworkGraph network_conv;
network_conv.inner = (void*)(network & (~1));
network_conv.is_owned = false;
- LDKPublicKey payee_ref;
- CHECK((*env)->GetArrayLength(env, payee) == 33);
- (*env)->GetByteArrayRegion(env, payee, 0, 33, payee_ref.compressed_form);
- LDKInvoiceFeatures payee_features_conv;
- payee_features_conv.inner = (void*)(payee_features & (~1));
- payee_features_conv.is_owned = (payee_features & 1) || (payee_features == 0);
- payee_features_conv = InvoiceFeatures_clone(&payee_features_conv);
LDKCVec_ChannelDetailsZ first_hops_constr;
LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL;
if (first_hops != NULL) {
(*env)->ReleaseLongArrayElements(env, first_hops, first_hops_vals, 0);
first_hops_ptr = &first_hops_constr;
}
- LDKCVec_RouteHintZ last_hops_constr;
- last_hops_constr.datalen = (*env)->GetArrayLength(env, last_hops);
- if (last_hops_constr.datalen > 0)
- last_hops_constr.data = MALLOC(last_hops_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
- else
- last_hops_constr.data = NULL;
- int64_t* last_hops_vals = (*env)->GetLongArrayElements (env, last_hops, NULL);
- for (size_t l = 0; l < last_hops_constr.datalen; l++) {
- int64_t last_hops_conv_11 = last_hops_vals[l];
- LDKRouteHint last_hops_conv_11_conv;
- last_hops_conv_11_conv.inner = (void*)(last_hops_conv_11 & (~1));
- last_hops_conv_11_conv.is_owned = (last_hops_conv_11 & 1) || (last_hops_conv_11 == 0);
- last_hops_conv_11_conv = RouteHint_clone(&last_hops_conv_11_conv);
- last_hops_constr.data[l] = last_hops_conv_11_conv;
- }
- (*env)->ReleaseLongArrayElements(env, last_hops, last_hops_vals, 0);
void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
CHECK_ACCESS(logger_ptr);
LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
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 = get_route(our_node_pubkey_ref, &network_conv, payee_ref, payee_features_conv, first_hops_ptr, last_hops_constr, final_value_msat, final_cltv, logger_conv, scorer_conv);
+ *ret_conv = find_route(our_node_pubkey_ref, ¶ms_conv, &network_conv, first_hops_ptr, logger_conv, scorer_conv);
if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
return (uint64_t)ret_conv;
}
Scorer_free(this_obj_conv);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Scorer_1new(JNIEnv *env, jclass clz, int64_t base_penalty_msat) {
- LDKScorer ret_var = Scorer_new(base_penalty_msat);
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
+ LDKScoringParameters this_obj_conv;
+ this_obj_conv.inner = (void*)(this_obj & (~1));
+ this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+ ScoringParameters_free(this_obj_conv);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1get_1base_1penalty_1msat(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;
+ int64_t ret_val = ScoringParameters_get_base_penalty_msat(&this_ptr_conv);
+ return ret_val;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1set_1base_1penalty_1msat(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;
+ ScoringParameters_set_base_penalty_msat(&this_ptr_conv, val);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1get_1failure_1penalty_1msat(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;
+ int64_t ret_val = ScoringParameters_get_failure_penalty_msat(&this_ptr_conv);
+ return ret_val;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1set_1failure_1penalty_1msat(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;
+ ScoringParameters_set_failure_penalty_msat(&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));
+ this_ptr_conv.is_owned = false;
+ int64_t ret_val = ScoringParameters_get_failure_penalty_half_life(&this_ptr_conv);
+ return ret_val;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1set_1failure_1penalty_1half_1life(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;
+ 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);
+ 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.
+ 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_ScoringParameters_1write(JNIEnv *env, jclass clz, int64_t obj) {
+ LDKScoringParameters obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z ret_var = ScoringParameters_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_ScoringParameters_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_ScoringParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScoringParametersDecodeErrorZ), "LDKCResult_ScoringParametersDecodeErrorZ");
+ *ret_conv = ScoringParameters_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_Scorer_1new(JNIEnv *env, jclass clz, int64_t params) {
+ LDKScoringParameters params_conv;
+ params_conv.inner = (void*)(params & (~1));
+ params_conv.is_owned = (params & 1) || (params == 0);
+ // Warning: we need a move here but no clone is available for LDKScoringParameters
+ LDKScorer ret_var = Scorer_new(params_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Scorer_1default(JNIEnv *env, jclass clz) {
LDKScorer ret_var = Scorer_default();
+ 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.
+ 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_ScoringParameters_1default(JNIEnv *env, jclass clz) {
+ LDKScoringParameters ret_var = ScoringParameters_default();
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKScorer this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKScore* ret_ret =MALLOC(sizeof(LDKScore), "LDKScore");
+ LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore");
*ret_ret = Scorer_as_Score(&this_arg_conv);
return (uint64_t)ret_ret;
}
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Scorer_1write(JNIEnv *env, jclass clz, int64_t obj) {
+ LDKScorer obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z ret_var = Scorer_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_Scorer_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_ScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScorerDecodeErrorZ), "LDKCResult_ScorerDecodeErrorZ");
+ *ret_conv = Scorer_read(ser_ref);
+ (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
+ return (uint64_t)ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKFilesystemPersister this_obj_conv;
this_obj_conv.inner = (void*)(this_obj & (~1));
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1new(JNIEnv *env, jclass clz, jstring path_to_channel_data) {
LDKStr path_to_channel_data_conv = java_to_owned_str(env, path_to_channel_data);
LDKFilesystemPersister ret_var = FilesystemPersister_new(path_to_channel_data_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKFilesystemPersister this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKPersist* ret_ret =MALLOC(sizeof(LDKPersist), "LDKPersist");
+ LDKPersist* ret_ret = MALLOC(sizeof(LDKPersist), "LDKPersist");
*ret_ret = FilesystemPersister_as_Persist(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKLogger_JCalls_cloned(&logger_conv);
}
LDKBackgroundProcessor ret_var = BackgroundProcessor_start(persister_conv, event_handler_conv, &chain_monitor_conv, &channel_manager_conv, net_graph_msg_handler_conv, &peer_manager_conv, logger_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKInvoice ret_var = Invoice_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKSignedRawInvoice ret_var = SignedRawInvoice_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKRawDataPart ret_var = RawInvoice_get_data(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKRawInvoice ret_var = RawInvoice_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKPositiveTimestamp ret_var = RawDataPart_get_timestamp(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKRawDataPart ret_var = RawDataPart_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKPositiveTimestamp ret_var = PositiveTimestamp_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKSha256 ret_var = Sha256_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKDescription ret_var = Description_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
PayeePubKey_free(this_obj_conv);
}
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKPayeePubKey this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, PayeePubKey_get_a(&this_ptr_conv).compressed_form);
+ return ret_arr;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
+ LDKPayeePubKey this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKPublicKey val_ref;
+ CHECK((*env)->GetArrayLength(env, val) == 33);
+ (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
+ PayeePubKey_set_a(&this_ptr_conv, val_ref);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1new(JNIEnv *env, jclass clz, int8_tArray a_arg) {
+ LDKPublicKey a_arg_ref;
+ CHECK((*env)->GetArrayLength(env, a_arg) == 33);
+ (*env)->GetByteArrayRegion(env, a_arg, 0, 33, a_arg_ref.compressed_form);
+ LDKPayeePubKey ret_var = PayeePubKey_new(a_arg_ref);
+ 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.
+ 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_PayeePubKey_1clone(JNIEnv *env, jclass clz, int64_t orig) {
LDKPayeePubKey orig_conv;
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKPayeePubKey ret_var = PayeePubKey_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKExpiryTime ret_var = ExpiryTime_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
MinFinalCltvExpiry_free(this_obj_conv);
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKMinFinalCltvExpiry this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ int64_t ret_val = MinFinalCltvExpiry_get_a(&this_ptr_conv);
+ return ret_val;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
+ LDKMinFinalCltvExpiry this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ MinFinalCltvExpiry_set_a(&this_ptr_conv, val);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1new(JNIEnv *env, jclass clz, int64_t a_arg) {
+ LDKMinFinalCltvExpiry ret_var = MinFinalCltvExpiry_new(a_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.
+ 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_MinFinalCltvExpiry_1clone(JNIEnv *env, jclass clz, int64_t orig) {
LDKMinFinalCltvExpiry orig_conv;
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKMinFinalCltvExpiry ret_var = MinFinalCltvExpiry_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKInvoiceSignature ret_var = InvoiceSignature_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKPrivateRoute ret_var = PrivateRoute_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKRawInvoice ret_var = SignedRawInvoice_raw_invoice(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKInvoiceSignature ret_var = SignedRawInvoice_signature(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKSha256 ret_var = RawInvoice_payment_hash(&this_arg_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKDescription ret_var = RawInvoice_description(&this_arg_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKPayeePubKey ret_var = RawInvoice_payee_pub_key(&this_arg_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKSha256 ret_var = RawInvoice_description_hash(&this_arg_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKExpiryTime ret_var = RawInvoice_expiry_time(&this_arg_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKMinFinalCltvExpiry ret_var = RawInvoice_min_final_cltv_expiry(&this_arg_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKInvoiceFeatures ret_var = RawInvoice_features(&this_arg_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCVec_PrivateRouteZ ret_var = RawInvoice_private_routes(&this_arg_conv);
- int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t o = 0; o < ret_var.datalen; o++) {
LDKPrivateRoute ret_conv_14_var = ret_var.data[o];
+ uint64_t ret_conv_14_ref = 0;
CHECK((((uint64_t)ret_conv_14_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_conv_14_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t ret_conv_14_ref = (uint64_t)ret_conv_14_var.inner;
+ ret_conv_14_ref = (uint64_t)ret_conv_14_var.inner;
if (ret_conv_14_var.is_owned) {
ret_conv_14_ref |= 1;
}
this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
this_arg_conv = Invoice_clone(&this_arg_conv);
LDKSignedRawInvoice ret_var = Invoice_into_signed_raw(this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
- (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, Invoice_payment_secret(&this_arg_conv).data);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *Invoice_payment_secret(&this_arg_conv));
return ret_arr;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKInvoiceFeatures ret_var = Invoice_features(&this_arg_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
return ret_val;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Invoice_1is_1expired(JNIEnv *env, jclass clz, int64_t this_arg) {
+ LDKInvoice this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ jboolean ret_val = Invoice_is_expired(&this_arg_conv);
+ return ret_val;
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1min_1final_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_arg) {
LDKInvoice this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCVec_PrivateRouteZ ret_var = Invoice_private_routes(&this_arg_conv);
- int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t o = 0; o < ret_var.datalen; o++) {
LDKPrivateRoute ret_conv_14_var = ret_var.data[o];
+ uint64_t ret_conv_14_ref = 0;
CHECK((((uint64_t)ret_conv_14_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_conv_14_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t ret_conv_14_ref = (uint64_t)ret_conv_14_var.inner;
+ ret_conv_14_ref = (uint64_t)ret_conv_14_var.inner;
if (ret_conv_14_var.is_owned) {
ret_conv_14_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCVec_RouteHintZ ret_var = Invoice_route_hints(&this_arg_conv);
- int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
+ int64_tArray ret_arr = NULL;
+ ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t l = 0; l < ret_var.datalen; l++) {
LDKRouteHint ret_conv_11_var = ret_var.data[l];
+ uint64_t ret_conv_11_ref = 0;
CHECK((((uint64_t)ret_conv_11_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_conv_11_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t ret_conv_11_ref = (uint64_t)ret_conv_11_var.inner;
+ ret_conv_11_ref = (uint64_t)ret_conv_11_var.inner;
if (ret_conv_11_var.is_owned) {
ret_conv_11_ref |= 1;
}
return ret_conv;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1amount_1pico_1btc(JNIEnv *env, jclass clz, int64_t this_arg) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1amount_1milli_1satoshis(JNIEnv *env, jclass clz, int64_t this_arg) {
LDKInvoice this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
- *ret_copy = Invoice_amount_pico_btc(&this_arg_conv);
+ *ret_copy = Invoice_amount_milli_satoshis(&this_arg_conv);
uint64_t ret_ref = (uint64_t)ret_copy;
return ret_ref;
}
this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
this_arg_conv = PrivateRoute_clone(&this_arg_conv);
LDKRouteHint ret_var = PrivateRoute_into_inner(this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
return ret_conv;
}
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
+ LDKInvoicePayer this_obj_conv;
+ this_obj_conv.inner = (void*)(this_obj & (~1));
+ this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+ InvoicePayer_free(this_obj_conv);
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payer_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);
+ LDKPayer this_ptr_conv = *(LDKPayer*)(this_ptr_ptr);
+ FREE((void*)this_ptr);
+ Payer_free(this_ptr_conv);
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Router_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);
+ LDKRouter this_ptr_conv = *(LDKRouter*)(this_ptr_ptr);
+ FREE((void*)this_ptr);
+ Router_free(this_ptr_conv);
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
+ LDKRetryAttempts this_obj_conv;
+ this_obj_conv.inner = (void*)(this_obj & (~1));
+ this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+ RetryAttempts_free(this_obj_conv);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKRetryAttempts this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ int64_t ret_val = RetryAttempts_get_a(&this_ptr_conv);
+ return ret_val;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
+ LDKRetryAttempts this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ RetryAttempts_set_a(&this_ptr_conv, val);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1new(JNIEnv *env, jclass clz, int64_t a_arg) {
+ LDKRetryAttempts ret_var = RetryAttempts_new(a_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.
+ 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_RetryAttempts_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKRetryAttempts orig_conv;
+ orig_conv.inner = (void*)(orig & (~1));
+ orig_conv.is_owned = false;
+ LDKRetryAttempts ret_var = RetryAttempts_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.
+ 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_RetryAttempts_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKRetryAttempts a_conv;
+ a_conv.inner = (void*)(a & (~1));
+ a_conv.is_owned = false;
+ LDKRetryAttempts b_conv;
+ b_conv.inner = (void*)(b & (~1));
+ b_conv.is_owned = false;
+ jboolean ret_val = RetryAttempts_eq(&a_conv, &b_conv);
+ return ret_val;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1hash(JNIEnv *env, jclass clz, int64_t o) {
+ LDKRetryAttempts o_conv;
+ o_conv.inner = (void*)(o & (~1));
+ o_conv.is_owned = false;
+ int64_t ret_val = RetryAttempts_hash(&o_conv);
+ return ret_val;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentError_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);
+ LDKPaymentError this_ptr_conv = *(LDKPaymentError*)(this_ptr_ptr);
+ FREE((void*)this_ptr);
+ PaymentError_free(this_ptr_conv);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKPaymentError* orig_conv = (LDKPaymentError*)orig;
+ LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
+ *ret_copy = PaymentError_clone(orig_conv);
+ uint64_t ret_ref = (uint64_t)ret_copy;
+ return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentError_1invoice(JNIEnv *env, jclass clz, jstring a) {
+ LDKStr a_conv = java_to_owned_str(env, a);
+ LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
+ *ret_copy = PaymentError_invoice(a_conv);
+ uint64_t ret_ref = (uint64_t)ret_copy;
+ return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentError_1routing(JNIEnv *env, jclass clz, int64_t a) {
+ LDKLightningError a_conv;
+ a_conv.inner = (void*)(a & (~1));
+ a_conv.is_owned = (a & 1) || (a == 0);
+ a_conv = LightningError_clone(&a_conv);
+ LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
+ *ret_copy = PaymentError_routing(a_conv);
+ uint64_t ret_ref = (uint64_t)ret_copy;
+ return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentError_1sending(JNIEnv *env, jclass clz, int64_t a) {
+ void* a_ptr = (void*)(((uint64_t)a) & ~1);
+ CHECK_ACCESS(a_ptr);
+ LDKPaymentSendFailure a_conv = *(LDKPaymentSendFailure*)(a_ptr);
+ a_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)(((uint64_t)a) & ~1));
+ LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
+ *ret_copy = PaymentError_sending(a_conv);
+ uint64_t ret_ref = (uint64_t)ret_copy;
+ return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1new(JNIEnv *env, jclass clz, int64_t payer, int64_t router, int64_t scorer, int64_t logger, int64_t event_handler, int64_t retry_attempts) {
+ void* payer_ptr = (void*)(((uint64_t)payer) & ~1);
+ CHECK_ACCESS(payer_ptr);
+ LDKPayer payer_conv = *(LDKPayer*)(payer_ptr);
+ if (payer_conv.free == LDKPayer_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKPayer_JCalls_cloned(&payer_conv);
+ }
+ void* router_ptr = (void*)(((uint64_t)router) & ~1);
+ CHECK_ACCESS(router_ptr);
+ LDKRouter router_conv = *(LDKRouter*)(router_ptr);
+ if (router_conv.free == LDKRouter_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKRouter_JCalls_cloned(&router_conv);
+ }
+ LDKLockableScore scorer_conv;
+ scorer_conv.inner = (void*)(scorer & (~1));
+ scorer_conv.is_owned = false;
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
+ if (logger_conv.free == LDKLogger_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKLogger_JCalls_cloned(&logger_conv);
+ }
+ void* event_handler_ptr = (void*)(((uint64_t)event_handler) & ~1);
+ CHECK_ACCESS(event_handler_ptr);
+ LDKEventHandler event_handler_conv = *(LDKEventHandler*)(event_handler_ptr);
+ if (event_handler_conv.free == LDKEventHandler_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKEventHandler_JCalls_cloned(&event_handler_conv);
+ }
+ LDKRetryAttempts retry_attempts_conv;
+ retry_attempts_conv.inner = (void*)(retry_attempts & (~1));
+ retry_attempts_conv.is_owned = (retry_attempts & 1) || (retry_attempts == 0);
+ retry_attempts_conv = RetryAttempts_clone(&retry_attempts_conv);
+ LDKInvoicePayer ret_var = InvoicePayer_new(payer_conv, router_conv, &scorer_conv, logger_conv, event_handler_conv, retry_attempts_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.
+ 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_InvoicePayer_1pay_1invoice(JNIEnv *env, jclass clz, int64_t this_arg, int64_t invoice) {
+ LDKInvoicePayer this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ LDKInvoice invoice_conv;
+ invoice_conv.inner = (void*)(invoice & (~1));
+ invoice_conv.is_owned = false;
+ LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
+ *ret_conv = InvoicePayer_pay_invoice(&this_arg_conv, &invoice_conv);
+ return (uint64_t)ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1pay_1zero_1value_1invoice(JNIEnv *env, jclass clz, int64_t this_arg, int64_t invoice, int64_t amount_msats) {
+ LDKInvoicePayer this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ LDKInvoice invoice_conv;
+ invoice_conv.inner = (void*)(invoice & (~1));
+ invoice_conv.is_owned = false;
+ LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
+ *ret_conv = InvoicePayer_pay_zero_value_invoice(&this_arg_conv, &invoice_conv, amount_msats);
+ 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));
+ this_arg_conv.is_owned = false;
+ 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;
+ InvoicePayer_remove_cached_payment(&this_arg_conv, payment_hash_ref);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1as_1EventHandler(JNIEnv *env, jclass clz, int64_t this_arg) {
+ LDKInvoicePayer this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ LDKEventHandler* ret_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
+ *ret_ret = InvoicePayer_as_EventHandler(&this_arg_conv);
+ return (uint64_t)ret_ret;
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t keys_manager, jclass network, int64_t amt_msat, jstring description) {
LDKChannelManager channelmanager_conv;
channelmanager_conv.inner = (void*)(channelmanager & (~1));
return (uint64_t)ret_conv;
}
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
+ LDKDefaultRouter this_obj_conv;
+ this_obj_conv.inner = (void*)(this_obj & (~1));
+ this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+ DefaultRouter_free(this_obj_conv);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1new(JNIEnv *env, jclass clz, int64_t network_graph, int64_t logger) {
+ LDKNetworkGraph network_graph_conv;
+ network_graph_conv.inner = (void*)(network_graph & (~1));
+ network_graph_conv.is_owned = false;
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
+ if (logger_conv.free == LDKLogger_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKLogger_JCalls_cloned(&logger_conv);
+ }
+ LDKDefaultRouter ret_var = DefaultRouter_new(&network_graph_conv, logger_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.
+ 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_DefaultRouter_1as_1Router(JNIEnv *env, jclass clz, int64_t this_arg) {
+ LDKDefaultRouter this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ LDKRouter* ret_ret = MALLOC(sizeof(LDKRouter), "LDKRouter");
+ *ret_ret = DefaultRouter_as_Router(&this_arg_conv);
+ return (uint64_t)ret_ret;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1Payer(JNIEnv *env, jclass clz, int64_t this_arg) {
+ LDKChannelManager this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ LDKPayer* ret_ret = MALLOC(sizeof(LDKPayer), "LDKPayer");
+ *ret_ret = ChannelManager_as_Payer(&this_arg_conv);
+ return (uint64_t)ret_ret;
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SiPrefix_1from_1str(JNIEnv *env, jclass clz, jstring s) {
LDKStr s_conv = java_to_owned_str(env, s);
LDKCResult_SiPrefixNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixNoneZ), "LDKCResult_SiPrefixNoneZ");
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteDecodeErrorZ_1get_1err
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKCResult_RouteParametersDecodeErrorZ_result_ok
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteParametersDecodeErrorZ_1result_1ok
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKCResult_RouteParametersDecodeErrorZ_get_ok
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteParametersDecodeErrorZ_1get_1ok
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKCResult_RouteParametersDecodeErrorZ_get_err
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteParametersDecodeErrorZ_1get_1err
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKCVec_RouteHintZ_new
+ * Signature: ([J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1RouteHintZ_1new
+ (JNIEnv *, jclass, jlongArray);
+
/*
* Class: org_ldk_impl_bindings
* Method: LDKCOption_u64Z_ref_from_ptr
/*
* Class: org_ldk_impl_bindings
- * Method: LDKCVec_ChannelDetailsZ_new
+ * Method: LDKCResult_PayeeDecodeErrorZ_result_ok
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PayeeDecodeErrorZ_1result_1ok
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKCResult_PayeeDecodeErrorZ_get_ok
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PayeeDecodeErrorZ_1get_1ok
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKCResult_PayeeDecodeErrorZ_get_err
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PayeeDecodeErrorZ_1get_1err
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKCVec_RouteHintHopZ_new
* Signature: ([J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1ChannelDetailsZ_1new
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1RouteHintHopZ_1new
(JNIEnv *, jclass, jlongArray);
/*
* Class: org_ldk_impl_bindings
- * Method: LDKCVec_RouteHintZ_new
+ * Method: LDKCResult_RouteHintDecodeErrorZ_result_ok
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHintDecodeErrorZ_1result_1ok
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKCResult_RouteHintDecodeErrorZ_get_ok
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHintDecodeErrorZ_1get_1ok
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKCResult_RouteHintDecodeErrorZ_get_err
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHintDecodeErrorZ_1get_1err
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKCResult_RouteHintHopDecodeErrorZ_result_ok
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHintHopDecodeErrorZ_1result_1ok
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKCResult_RouteHintHopDecodeErrorZ_get_ok
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHintHopDecodeErrorZ_1get_1ok
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKCResult_RouteHintHopDecodeErrorZ_get_err
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHintHopDecodeErrorZ_1get_1err
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKCVec_ChannelDetailsZ_new
* Signature: ([J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1RouteHintZ_1new
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1ChannelDetailsZ_1new
(JNIEnv *, jclass, jlongArray);
/*
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceFeaturesDecodeErrorZ_1get_1err
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKCResult_ScoringParametersDecodeErrorZ_result_ok
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScoringParametersDecodeErrorZ_1result_1ok
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKCResult_ScoringParametersDecodeErrorZ_get_ok
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScoringParametersDecodeErrorZ_1get_1ok
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKCResult_ScoringParametersDecodeErrorZ_get_err
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScoringParametersDecodeErrorZ_1get_1err
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKCResult_ScorerDecodeErrorZ_result_ok
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScorerDecodeErrorZ_1result_1ok
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKCResult_ScorerDecodeErrorZ_get_ok
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScorerDecodeErrorZ_1get_1ok
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKCResult_ScorerDecodeErrorZ_get_err
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScorerDecodeErrorZ_1get_1err
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ_result_ok
JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1get_1err
(JNIEnv *, jclass, jlong);
-/*
- * Class: org_ldk_impl_bindings
- * Method: LDKCResult_PaymentIdDecodeErrorZ_result_ok
- * Signature: (J)Z
- */
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdDecodeErrorZ_1result_1ok
- (JNIEnv *, jclass, jlong);
-
-/*
- * Class: org_ldk_impl_bindings
- * Method: LDKCResult_PaymentIdDecodeErrorZ_get_ok
- * Signature: (J)J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdDecodeErrorZ_1get_1ok
- (JNIEnv *, jclass, jlong);
-
-/*
- * Class: org_ldk_impl_bindings
- * Method: LDKCResult_PaymentIdDecodeErrorZ_get_err
- * Signature: (J)J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdDecodeErrorZ_1get_1err
- (JNIEnv *, jclass, jlong);
-
/*
* Class: org_ldk_impl_bindings
* Method: LDKCOption_u16Z_ref_from_ptr
/*
* Class: org_ldk_impl_bindings
* Method: LDKCResult_PaymentIdPaymentSendFailureZ_get_ok
- * Signature: (J)J
+ * Signature: (J)[B
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdPaymentSendFailureZ_1get_1ok
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdPaymentSendFailureZ_1get_1ok
(JNIEnv *, jclass, jlong);
/*
/*
* Class: org_ldk_impl_bindings
* Method: C2Tuple_PaymentHashPaymentIdZ_get_b
- * Signature: (J)J
+ * Signature: (J)[B
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1get_1b
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1get_1b
(JNIEnv *, jclass, jlong);
/*
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1TypeZDecodeErrorZ_1get_1err
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKPaymentError_ref_from_ptr
+ * Signature: (J)Lorg/ldk/impl/bindings/LDKPaymentError;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentError_1ref_1from_1ptr
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKCResult_PaymentIdPaymentErrorZ_result_ok
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdPaymentErrorZ_1result_1ok
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKCResult_PaymentIdPaymentErrorZ_get_ok
+ * Signature: (J)[B
+ */
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdPaymentErrorZ_1get_1ok
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKCResult_PaymentIdPaymentErrorZ_get_err
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdPaymentErrorZ_1get_1err
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: LDKCResult_SiPrefixNoneZ_result_ok
JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1CVec_1NetAddressZZ_1ref_1from_1ptr
(JNIEnv *, jclass, jlong);
-/*
- * Class: org_ldk_impl_bindings
- * Method: LDKCResult_NetAddressu8Z_result_ok
- * Signature: (J)Z
- */
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetAddressu8Z_1result_1ok
- (JNIEnv *, jclass, jlong);
-
-/*
- * Class: org_ldk_impl_bindings
- * Method: LDKCResult_NetAddressu8Z_get_ok
- * Signature: (J)J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetAddressu8Z_1get_1ok
- (JNIEnv *, jclass, jlong);
-
-/*
- * Class: org_ldk_impl_bindings
- * Method: LDKCResult_NetAddressu8Z_get_err
- * Signature: (J)B
- */
-JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetAddressu8Z_1get_1err
- (JNIEnv *, jclass, jlong);
-
-/*
- * Class: org_ldk_impl_bindings
- * Method: LDKCResult_CResult_NetAddressu8ZDecodeErrorZ_result_ok
- * Signature: (J)Z
- */
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CResult_1NetAddressu8ZDecodeErrorZ_1result_1ok
- (JNIEnv *, jclass, jlong);
-
-/*
- * Class: org_ldk_impl_bindings
- * Method: LDKCResult_CResult_NetAddressu8ZDecodeErrorZ_get_ok
- * Signature: (J)J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CResult_1NetAddressu8ZDecodeErrorZ_1get_1ok
- (JNIEnv *, jclass, jlong);
-
-/*
- * Class: org_ldk_impl_bindings
- * Method: LDKCResult_CResult_NetAddressu8ZDecodeErrorZ_get_err
- * Signature: (J)J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CResult_1NetAddressu8ZDecodeErrorZ_1get_1err
- (JNIEnv *, jclass, jlong);
-
/*
* Class: org_ldk_impl_bindings
* Method: LDKCResult_NetAddressDecodeErrorZ_result_ok
/*
* Class: org_ldk_impl_bindings
* Method: Persist_persist_new_channel
- * Signature: (JJJ)J
+ * Signature: (JJJJ)J
*/
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Persist_1persist_1new_1channel
- (JNIEnv *, jclass, jlong, jlong, jlong);
+ (JNIEnv *, jclass, jlong, jlong, jlong, jlong);
/*
* Class: org_ldk_impl_bindings
* Method: Persist_update_persisted_channel
- * Signature: (JJJJ)J
+ * Signature: (JJJJJ)J
*/
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Persist_1update_1persisted_1channel
- (JNIEnv *, jclass, jlong, jlong, jlong, jlong);
+ (JNIEnv *, jclass, jlong, jlong, jlong, jlong, jlong);
/*
* Class: org_ldk_impl_bindings
/*
* Class: org_ldk_impl_bindings
* Method: Score_channel_penalty_msat
- * Signature: (JJ)J
+ * Signature: (JJJJ)J
*/
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Score_1channel_1penalty_1msat
- (JNIEnv *, jclass, jlong, jlong);
+ (JNIEnv *, jclass, jlong, jlong, jlong, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: Score_payment_path_failed
+ * Signature: (J[JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1payment_1path_1failed
+ (JNIEnv *, jclass, jlong, jlongArray, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: Score_write
+ * Signature: (J)[B
+ */
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Score_1write
+ (JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
/*
* Class: org_ldk_impl_bindings
- * Method: _ldk_get_compiled_version
- * Signature: ()Ljava/lang/String;
+ * Method: LDKPayer_new
+ * Signature: (Lorg/ldk/impl/bindings/LDKPayer;)J
*/
-JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings__1ldk_1get_1compiled_1version
- (JNIEnv *, jclass);
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKPayer_1new
+ (JNIEnv *, jclass, jobject);
/*
* Class: org_ldk_impl_bindings
- * Method: _ldk_c_bindings_get_compiled_version
- * Signature: ()Ljava/lang/String;
+ * Method: Payer_node_id
+ * Signature: (J)[B
*/
-JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings__1ldk_1c_1bindings_1get_1compiled_1version
- (JNIEnv *, jclass);
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Payer_1node_1id
+ (JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: Transaction_free
- * Signature: ([B)V
+ * Method: Payer_first_hops
+ * Signature: (J)[J
*/
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Transaction_1free
- (JNIEnv *, jclass, jbyteArray);
+JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_Payer_1first_1hops
+ (JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: TxOut_new
- * Signature: ([BJ)J
+ * Method: Payer_send_payment
+ * Signature: (JJ[B[B)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxOut_1new
- (JNIEnv *, jclass, jbyteArray, jlong);
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Payer_1send_1payment
+ (JNIEnv *, jclass, jlong, jlong, jbyteArray, jbyteArray);
/*
* Class: org_ldk_impl_bindings
- * Method: TxOut_free
- * Signature: (J)V
+ * Method: Payer_retry_payment
+ * Signature: (JJ[B)J
*/
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxOut_1free
- (JNIEnv *, jclass, jlong);
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Payer_1retry_1payment
+ (JNIEnv *, jclass, jlong, jlong, jbyteArray);
/*
* Class: org_ldk_impl_bindings
- * Method: TxOut_clone
- * Signature: (J)J
+ * Method: LDKRouter_new
+ * Signature: (Lorg/ldk/impl/bindings/LDKRouter;)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRouter_1new
+ (JNIEnv *, jclass, jobject);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: Router_find_route
+ * Signature: (J[BJ[JJ)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Router_1find_1route
+ (JNIEnv *, jclass, jlong, jbyteArray, jlong, jlongArray, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: _ldk_get_compiled_version
+ * Signature: ()Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings__1ldk_1get_1compiled_1version
+ (JNIEnv *, jclass);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: _ldk_c_bindings_get_compiled_version
+ * Signature: ()Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings__1ldk_1c_1bindings_1get_1compiled_1version
+ (JNIEnv *, jclass);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: Transaction_free
+ * Signature: ([B)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Transaction_1free
+ (JNIEnv *, jclass, jbyteArray);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: TxOut_new
+ * Signature: ([BJ)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxOut_1new
+ (JNIEnv *, jclass, jbyteArray, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: TxOut_free
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxOut_1free
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: TxOut_clone
+ * Signature: (J)J
*/
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxOut_1clone
(JNIEnv *, jclass, jlong);
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_RouteParametersDecodeErrorZ_ok
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1ok
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_RouteParametersDecodeErrorZ_err
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1err
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_RouteParametersDecodeErrorZ_free
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1free
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_RouteParametersDecodeErrorZ_clone
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1clone
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CVec_RouteHintZ_free
+ * Signature: ([J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHintZ_1free
+ (JNIEnv *, jclass, jlongArray);
+
/*
* Class: org_ldk_impl_bindings
* Method: COption_u64Z_some
/*
* Class: org_ldk_impl_bindings
- * Method: CVec_ChannelDetailsZ_free
+ * Method: CResult_PayeeDecodeErrorZ_ok
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PayeeDecodeErrorZ_1ok
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_PayeeDecodeErrorZ_err
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PayeeDecodeErrorZ_1err
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_PayeeDecodeErrorZ_free
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PayeeDecodeErrorZ_1free
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_PayeeDecodeErrorZ_clone
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PayeeDecodeErrorZ_1clone
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CVec_RouteHintHopZ_free
* Signature: ([J)V
*/
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelDetailsZ_1free
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHintHopZ_1free
(JNIEnv *, jclass, jlongArray);
/*
* Class: org_ldk_impl_bindings
- * Method: CVec_RouteHintZ_free
+ * Method: CResult_RouteHintDecodeErrorZ_ok
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1ok
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_RouteHintDecodeErrorZ_err
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1err
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_RouteHintDecodeErrorZ_free
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1free
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_RouteHintDecodeErrorZ_clone
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1clone
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_RouteHintHopDecodeErrorZ_ok
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1ok
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_RouteHintHopDecodeErrorZ_err
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1err
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_RouteHintHopDecodeErrorZ_free
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1free
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_RouteHintHopDecodeErrorZ_clone
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1clone
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CVec_ChannelDetailsZ_free
* Signature: ([J)V
*/
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHintZ_1free
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelDetailsZ_1free
(JNIEnv *, jclass, jlongArray);
/*
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1free
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_ScoringParametersDecodeErrorZ_ok
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1ok
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_ScoringParametersDecodeErrorZ_err
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1err
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_ScoringParametersDecodeErrorZ_free
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1free
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_ScorerDecodeErrorZ_ok
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1ok
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_ScorerDecodeErrorZ_err
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1err
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_ScorerDecodeErrorZ_free
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1free
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1clone
(JNIEnv *, jclass, jlong);
-/*
- * Class: org_ldk_impl_bindings
- * Method: CResult_PaymentIdDecodeErrorZ_ok
- * Signature: (J)J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdDecodeErrorZ_1ok
- (JNIEnv *, jclass, jlong);
-
-/*
- * Class: org_ldk_impl_bindings
- * Method: CResult_PaymentIdDecodeErrorZ_err
- * Signature: (J)J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdDecodeErrorZ_1err
- (JNIEnv *, jclass, jlong);
-
-/*
- * Class: org_ldk_impl_bindings
- * Method: CResult_PaymentIdDecodeErrorZ_free
- * Signature: (J)V
- */
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdDecodeErrorZ_1free
- (JNIEnv *, jclass, jlong);
-
-/*
- * Class: org_ldk_impl_bindings
- * Method: CResult_PaymentIdDecodeErrorZ_clone
- * Signature: (J)J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdDecodeErrorZ_1clone
- (JNIEnv *, jclass, jlong);
-
/*
* Class: org_ldk_impl_bindings
* Method: COption_u16Z_some
/*
* Class: org_ldk_impl_bindings
* Method: CResult_PaymentIdPaymentSendFailureZ_ok
- * Signature: (J)J
+ * Signature: ([B)J
*/
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1ok
- (JNIEnv *, jclass, jlong);
+ (JNIEnv *, jclass, jbyteArray);
/*
* Class: org_ldk_impl_bindings
/*
* Class: org_ldk_impl_bindings
* Method: C2Tuple_PaymentHashPaymentIdZ_new
- * Signature: ([BJ)J
+ * Signature: ([B[B)J
*/
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1new
- (JNIEnv *, jclass, jbyteArray, jlong);
+ (JNIEnv *, jclass, jbyteArray, jbyteArray);
/*
* Class: org_ldk_impl_bindings
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_PaymentIdPaymentErrorZ_ok
+ * Signature: ([B)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1ok
+ (JNIEnv *, jclass, jbyteArray);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_PaymentIdPaymentErrorZ_err
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1err
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_PaymentIdPaymentErrorZ_free
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1free
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_PaymentIdPaymentErrorZ_clone
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1clone
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: CResult_SiPrefixNoneZ_ok
/*
* Class: org_ldk_impl_bindings
- * Method: CResult_NetAddressu8Z_ok
+ * Method: CResult_NetAddressDecodeErrorZ_ok
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressu8Z_1ok
- (JNIEnv *, jclass, jlong);
-
-/*
- * Class: org_ldk_impl_bindings
- * Method: CResult_NetAddressu8Z_err
- * Signature: (B)J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressu8Z_1err
- (JNIEnv *, jclass, jbyte);
-
-/*
- * Class: org_ldk_impl_bindings
- * Method: CResult_NetAddressu8Z_free
- * Signature: (J)V
- */
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressu8Z_1free
- (JNIEnv *, jclass, jlong);
-
-/*
- * Class: org_ldk_impl_bindings
- * Method: CResult_NetAddressu8Z_clone
- * Signature: (J)J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressu8Z_1clone
- (JNIEnv *, jclass, jlong);
-
-/*
- * Class: org_ldk_impl_bindings
- * Method: CResult_CResult_NetAddressu8ZDecodeErrorZ_ok
- * Signature: (J)J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CResult_1NetAddressu8ZDecodeErrorZ_1ok
- (JNIEnv *, jclass, jlong);
-
-/*
- * Class: org_ldk_impl_bindings
- * Method: CResult_CResult_NetAddressu8ZDecodeErrorZ_err
- * Signature: (J)J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CResult_1NetAddressu8ZDecodeErrorZ_1err
- (JNIEnv *, jclass, jlong);
-
-/*
- * Class: org_ldk_impl_bindings
- * Method: CResult_CResult_NetAddressu8ZDecodeErrorZ_free
- * Signature: (J)V
- */
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CResult_1NetAddressu8ZDecodeErrorZ_1free
- (JNIEnv *, jclass, jlong);
-
-/*
- * Class: org_ldk_impl_bindings
- * Method: CResult_CResult_NetAddressu8ZDecodeErrorZ_clone
- * Signature: (J)J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CResult_1NetAddressu8ZDecodeErrorZ_1clone
- (JNIEnv *, jclass, jlong);
-
-/*
- * Class: org_ldk_impl_bindings
- * Method: CResult_NetAddressDecodeErrorZ_ok
- * Signature: (J)J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1ok
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1ok
(JNIEnv *, jclass, jlong);
/*
/*
* Class: org_ldk_impl_bindings
* Method: Event_payment_sent
- * Signature: ([B[B)J
+ * Signature: ([B[B[BJ)J
*/
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1payment_1sent
- (JNIEnv *, jclass, jbyteArray, jbyteArray);
+ (JNIEnv *, jclass, jbyteArray, jbyteArray, jbyteArray, jlong);
/*
* Class: org_ldk_impl_bindings
* Method: Event_payment_path_failed
- * Signature: ([BZJZ[JJ)J
+ * Signature: ([B[BZJZ[JJJ)J
*/
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1payment_1path_1failed
- (JNIEnv *, jclass, jbyteArray, jboolean, jlong, jboolean, jlongArray, jlong);
+ (JNIEnv *, jclass, jbyteArray, jbyteArray, jboolean, jlong, jboolean, jlongArray, jlong, jlong);
/*
* Class: org_ldk_impl_bindings
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FeeEstimator_1free
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: MonitorUpdateId_free
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1free
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: MonitorUpdateId_clone
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1clone
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: MonitorUpdateId_hash
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1hash
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: MonitorUpdateId_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: Persist_free
JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1list_1monitors
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ChainMonitor_channel_monitor_updated
+ * Signature: (JJJ)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1channel_1monitor_1updated
+ (JNIEnv *, jclass, jlong, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: ChainMonitor_as_Listen
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
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1commitment_1tx_1confirmed
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: MonitorEvent_update_completed
+ * Signature: (JJ)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1update_1completed
+ (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: MonitorEvent_update_failed
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1update_1failed
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: MonitorEvent_write
+ * Signature: (J)[B
+ */
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1write
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: HTLCUpdate_free
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1KeysInterface
(JNIEnv *, jclass, jlong);
-/*
- * Class: org_ldk_impl_bindings
- * Method: PaymentId_free
- * Signature: (J)V
- */
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentId_1free
- (JNIEnv *, jclass, jlong);
-
-/*
- * Class: org_ldk_impl_bindings
- * Method: PaymentId_hash
- * Signature: (J)J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentId_1hash
- (JNIEnv *, jclass, jlong);
-
-/*
- * Class: org_ldk_impl_bindings
- * Method: PaymentId_clone
- * Signature: (J)J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentId_1clone
- (JNIEnv *, jclass, jlong);
-
-/*
- * Class: org_ldk_impl_bindings
- * Method: PaymentId_eq
- * Signature: (JJ)Z
- */
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PaymentId_1eq
- (JNIEnv *, jclass, jlong, jlong);
-
-/*
- * Class: org_ldk_impl_bindings
- * Method: PaymentId_write
- * Signature: (J)[B
- */
-JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_PaymentId_1write
- (JNIEnv *, jclass, jlong);
-
-/*
- * Class: org_ldk_impl_bindings
- * Method: PaymentId_read
- * Signature: ([B)J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentId_1read
- (JNIEnv *, jclass, jbyteArray);
-
/*
* Class: org_ldk_impl_bindings
* Method: ChannelManager_free
/*
* Class: org_ldk_impl_bindings
* Method: PaymentSendFailure_partial_failure
- * Signature: ([J)J
+ * Signature: ([JJ[B)J
*/
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1partial_1failure
- (JNIEnv *, jclass, jlongArray);
+ (JNIEnv *, jclass, jlongArray, jlong, jbyteArray);
/*
* Class: org_ldk_impl_bindings
/*
* Class: org_ldk_impl_bindings
* Method: ChannelManager_retry_payment
- * Signature: (JJJ)J
+ * Signature: (JJ[B)J
*/
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1retry_1payment
- (JNIEnv *, jclass, jlong, jlong, jlong);
+ (JNIEnv *, jclass, jlong, jlong, jbyteArray);
/*
* Class: org_ldk_impl_bindings
JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1our_1node_1id
(JNIEnv *, jclass, jlong);
-/*
- * Class: org_ldk_impl_bindings
- * Method: ChannelManager_channel_monitor_updated
- * Signature: (JJJ)V
- */
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1channel_1monitor_1updated
- (JNIEnv *, jclass, jlong, jlong, jlong);
-
/*
* Class: org_ldk_impl_bindings
* Method: ChannelManager_create_inbound_payment
JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NetAddress_1write
(JNIEnv *, jclass, jlong);
-/*
- * Class: org_ldk_impl_bindings
- * Method: Result_read
- * Signature: ([B)J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Result_1read
- (JNIEnv *, jclass, jbyteArray);
-
/*
* Class: org_ldk_impl_bindings
* Method: NetAddress_read
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1disconnect_1by_1node_1id
(JNIEnv *, jclass, jlong, jbyteArray, jboolean);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: PeerManager_disconnect_all_peers
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1disconnect_1all_1peers
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: PeerManager_timer_tick_occurred
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_NetGraphMsgHandler_1free
(JNIEnv *, jclass, jlong);
-/*
- * Class: org_ldk_impl_bindings
- * Method: NetGraphMsgHandler_get_network_graph
- * Signature: (J)J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1get_1network_1graph
- (JNIEnv *, jclass, jlong);
-
-/*
- * Class: org_ldk_impl_bindings
- * Method: NetGraphMsgHandler_set_network_graph
- * Signature: (JJ)V
- */
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1set_1network_1graph
- (JNIEnv *, jclass, jlong, jlong);
-
/*
* Class: org_ldk_impl_bindings
* Method: NetGraphMsgHandler_new
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1set_1paths
(JNIEnv *, jclass, jlong, jobjectArray);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: Route_get_payee
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1get_1payee
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: Route_set_payee
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1set_1payee
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: Route_new
- * Signature: ([[J)J
+ * Signature: ([[JJ)J
*/
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1new
- (JNIEnv *, jclass, jobjectArray);
+ (JNIEnv *, jclass, jobjectArray, jlong);
/*
* Class: org_ldk_impl_bindings
/*
* Class: org_ldk_impl_bindings
- * Method: RouteHint_free
+ * Method: RouteParameters_free
* Signature: (J)V
*/
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1free
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1free
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: RouteHint_clone
+ * Method: RouteParameters_get_payee
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1clone
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteParameters_1get_1payee
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: RouteHint_hash
+ * Method: RouteParameters_set_payee
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1set_1payee
+ (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: RouteParameters_get_final_value_msat
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1hash
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteParameters_1get_1final_1value_1msat
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: RouteHint_eq
- * Signature: (JJ)Z
+ * Method: RouteParameters_set_final_value_msat
+ * Signature: (JJ)V
*/
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteHint_1eq
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1set_1final_1value_1msat
(JNIEnv *, jclass, jlong, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: RouteHintHop_free
- * Signature: (J)V
+ * Method: RouteParameters_get_final_cltv_expiry_delta
+ * Signature: (J)I
*/
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1free
+JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_RouteParameters_1get_1final_1cltv_1expiry_1delta
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: RouteHintHop_get_src_node_id
- * Signature: (J)[B
+ * Method: RouteParameters_set_final_cltv_expiry_delta
+ * Signature: (JI)V
*/
-JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1src_1node_1id
- (JNIEnv *, jclass, jlong);
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1set_1final_1cltv_1expiry_1delta
+ (JNIEnv *, jclass, jlong, jint);
/*
* Class: org_ldk_impl_bindings
- * Method: RouteHintHop_set_src_node_id
- * Signature: (J[B)V
+ * Method: RouteParameters_new
+ * Signature: (JJI)J
*/
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1src_1node_1id
- (JNIEnv *, jclass, jlong, jbyteArray);
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteParameters_1new
+ (JNIEnv *, jclass, jlong, jlong, jint);
/*
* Class: org_ldk_impl_bindings
- * Method: RouteHintHop_get_short_channel_id
+ * Method: RouteParameters_clone
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1short_1channel_1id
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteParameters_1clone
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: RouteHintHop_set_short_channel_id
- * Signature: (JJ)V
+ * Method: RouteParameters_write
+ * Signature: (J)[B
*/
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1short_1channel_1id
- (JNIEnv *, jclass, jlong, jlong);
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RouteParameters_1write
+ (JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: RouteHintHop_get_fees
+ * Method: RouteParameters_read
+ * Signature: ([B)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteParameters_1read
+ (JNIEnv *, jclass, jbyteArray);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: Payee_free
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payee_1free
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: Payee_get_pubkey
+ * Signature: (J)[B
+ */
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Payee_1get_1pubkey
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: Payee_set_pubkey
+ * Signature: (J[B)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payee_1set_1pubkey
+ (JNIEnv *, jclass, jlong, jbyteArray);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: Payee_get_features
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Payee_1get_1features
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: Payee_set_features
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payee_1set_1features
+ (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: Payee_get_route_hints
+ * Signature: (J)[J
+ */
+JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_Payee_1get_1route_1hints
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: Payee_set_route_hints
+ * Signature: (J[J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payee_1set_1route_1hints
+ (JNIEnv *, jclass, jlong, jlongArray);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: Payee_get_expiry_time
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Payee_1get_1expiry_1time
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: Payee_set_expiry_time
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payee_1set_1expiry_1time
+ (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: Payee_new
+ * Signature: ([BJ[JJ)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Payee_1new
+ (JNIEnv *, jclass, jbyteArray, jlong, jlongArray, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: Payee_clone
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Payee_1clone
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: Payee_hash
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Payee_1hash
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: Payee_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Payee_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: Payee_write
+ * Signature: (J)[B
+ */
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Payee_1write
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: Payee_read
+ * Signature: ([B)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Payee_1read
+ (JNIEnv *, jclass, jbyteArray);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: Payee_from_node_id
+ * Signature: ([B)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Payee_1from_1node_1id
+ (JNIEnv *, jclass, jbyteArray);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: Payee_for_keysend
+ * Signature: ([B)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Payee_1for_1keysend
+ (JNIEnv *, jclass, jbyteArray);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: RouteHint_free
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1free
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: RouteHint_get_a
+ * Signature: (J)[J
+ */
+JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1a
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: RouteHint_set_a
+ * Signature: (J[J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1a
+ (JNIEnv *, jclass, jlong, jlongArray);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: RouteHint_new
+ * Signature: ([J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1new
+ (JNIEnv *, jclass, jlongArray);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: RouteHint_clone
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1clone
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: RouteHint_hash
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1hash
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: RouteHint_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteHint_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: RouteHint_write
+ * Signature: (J)[B
+ */
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RouteHint_1write
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: RouteHint_read
+ * Signature: ([B)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1read
+ (JNIEnv *, jclass, jbyteArray);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: RouteHintHop_free
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1free
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: RouteHintHop_get_src_node_id
+ * Signature: (J)[B
+ */
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1src_1node_1id
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: RouteHintHop_set_src_node_id
+ * Signature: (J[B)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1src_1node_1id
+ (JNIEnv *, jclass, jlong, jbyteArray);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: RouteHintHop_get_short_channel_id
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1short_1channel_1id
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: RouteHintHop_set_short_channel_id
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1short_1channel_1id
+ (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: RouteHintHop_get_fees
* Signature: (J)J
*/
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1fees
/*
* Class: org_ldk_impl_bindings
- * Method: get_keysend_route
- * Signature: ([BJ[B[J[JJIJJ)J
+ * Method: RouteHintHop_write
+ * Signature: (J)[B
+ */
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1write
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: RouteHintHop_read
+ * Signature: ([B)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_get_1keysend_1route
- (JNIEnv *, jclass, jbyteArray, jlong, jbyteArray, jlongArray, jlongArray, jlong, jint, jlong, jlong);
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1read
+ (JNIEnv *, jclass, jbyteArray);
/*
* Class: org_ldk_impl_bindings
- * Method: get_route
- * Signature: ([BJ[BJ[J[JJIJJ)J
+ * Method: find_route
+ * Signature: ([BJJ[JJJ)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_get_1route
- (JNIEnv *, jclass, jbyteArray, jlong, jbyteArray, jlong, jlongArray, jlongArray, jlong, jint, jlong, jlong);
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_find_1route
+ (JNIEnv *, jclass, jbyteArray, jlong, jlong, jlongArray, jlong, jlong);
/*
* Class: org_ldk_impl_bindings
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Scorer_1free
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ScoringParameters_free
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1free
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ScoringParameters_get_base_penalty_msat
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1get_1base_1penalty_1msat
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ScoringParameters_set_base_penalty_msat
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1set_1base_1penalty_1msat
+ (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ScoringParameters_get_failure_penalty_msat
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1get_1failure_1penalty_1msat
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ScoringParameters_set_failure_penalty_msat
+ * Signature: (JJ)V
+ */
+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_failure_penalty_half_life
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1get_1failure_1penalty_1half_1life
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ScoringParameters_set_failure_penalty_half_life
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1set_1failure_1penalty_1half_1life
+ (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ScoringParameters_new
+ * Signature: (JJJ)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1new
+ (JNIEnv *, jclass, jlong, jlong, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ScoringParameters_write
+ * Signature: (J)[B
+ */
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1write
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ScoringParameters_read
+ * Signature: ([B)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1read
+ (JNIEnv *, jclass, jbyteArray);
+
/*
* Class: org_ldk_impl_bindings
* Method: Scorer_new
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Scorer_1default
(JNIEnv *, jclass);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ScoringParameters_default
+ * Signature: ()J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1default
+ (JNIEnv *, jclass);
+
/*
* Class: org_ldk_impl_bindings
* Method: Scorer_as_Score
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Scorer_1as_1Score
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: Scorer_write
+ * Signature: (J)[B
+ */
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Scorer_1write
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: Scorer_read
+ * Signature: ([B)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Scorer_1read
+ (JNIEnv *, jclass, jbyteArray);
+
/*
* Class: org_ldk_impl_bindings
* Method: FilesystemPersister_free
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1free
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: PayeePubKey_get_a
+ * Signature: (J)[B
+ */
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1get_1a
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: PayeePubKey_set_a
+ * Signature: (J[B)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1set_1a
+ (JNIEnv *, jclass, jlong, jbyteArray);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: PayeePubKey_new
+ * Signature: ([B)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1new
+ (JNIEnv *, jclass, jbyteArray);
+
/*
* Class: org_ldk_impl_bindings
* Method: PayeePubKey_clone
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1free
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: MinFinalCltvExpiry_get_a
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1get_1a
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: MinFinalCltvExpiry_set_a
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1set_1a
+ (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: MinFinalCltvExpiry_new
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1new
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: MinFinalCltvExpiry_clone
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Invoice_1expiry_1time
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: Invoice_is_expired
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Invoice_1is_1expired
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: Invoice_min_final_cltv_expiry
/*
* Class: org_ldk_impl_bindings
- * Method: Invoice_amount_pico_btc
+ * Method: Invoice_amount_milli_satoshis
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Invoice_1amount_1pico_1btc
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Invoice_1amount_1milli_1satoshis
(JNIEnv *, jclass, jlong);
/*
JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1to_1str
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: InvoicePayer_free
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1free
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: Payer_free
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payer_1free
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: Router_free
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Router_1free
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: RetryAttempts_free
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1free
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: RetryAttempts_get_a
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1get_1a
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: RetryAttempts_set_a
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1set_1a
+ (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: RetryAttempts_new
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1new
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: RetryAttempts_clone
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1clone
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: RetryAttempts_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: RetryAttempts_hash
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1hash
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: PaymentError_free
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentError_1free
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: PaymentError_clone
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentError_1clone
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: PaymentError_invoice
+ * Signature: (Ljava/lang/String;)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentError_1invoice
+ (JNIEnv *, jclass, jstring);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: PaymentError_routing
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentError_1routing
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: PaymentError_sending
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentError_1sending
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: InvoicePayer_new
+ * Signature: (JJJJJJ)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1new
+ (JNIEnv *, jclass, jlong, jlong, jlong, jlong, jlong, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: InvoicePayer_pay_invoice
+ * Signature: (JJ)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1pay_1invoice
+ (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: InvoicePayer_pay_zero_value_invoice
+ * Signature: (JJJ)J
+ */
+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_remove_cached_payment
+ * Signature: (J[B)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1remove_1cached_1payment
+ (JNIEnv *, jclass, jlong, jbyteArray);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: InvoicePayer_as_EventHandler
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1as_1EventHandler
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: create_invoice_from_channelmanager
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager
(JNIEnv *, jclass, jlong, jlong, jobject, jlong, jstring);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: DefaultRouter_free
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1free
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: DefaultRouter_new
+ * Signature: (JJ)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1new
+ (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: DefaultRouter_as_Router
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1as_1Router
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ChannelManager_as_Payer
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1Payer
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: SiPrefix_from_str
--- /dev/null
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class org_ldk_impl_bindings_LDKPaymentError */
+
+#ifndef _Included_org_ldk_impl_bindings_LDKPaymentError
+#define _Included_org_ldk_impl_bindings_LDKPaymentError
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class: org_ldk_impl_bindings_LDKPaymentError
+ * Method: init
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPaymentError_init
+ (JNIEnv *, jclass);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
void free(void *ptr);
#define MALLOC(a, _) malloc(a)
-#define FREE(p) if ((unsigned long)(p) > 1024) { free(p); }
+#define FREE(p) if ((unsigned long)(p) > 4096) { free(p); }
#define DO_ASSERT(a) (void)(a)
#define CHECK(a)
#define CHECK_ACCESS(p)
LDKCResult_TxCreationKeysDecodeErrorZ *val = (LDKCResult_TxCreationKeysDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKTxCreationKeys 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_TxCreationKeysDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_TxCreationKeysDecodeErrorZ *val = (LDKCResult_TxCreationKeysDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_ChannelPublicKeysDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_ChannelPublicKeysDecodeErrorZ *val = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKChannelPublicKeys 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelPublicKeysDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_ChannelPublicKeysDecodeErrorZ *val = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_TxCreationKeysErrorZ_result_ok(uint32_t arg) {
LDKCResult_TxCreationKeysErrorZ *val = (LDKCResult_TxCreationKeysErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKTxCreationKeys 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_TxCreationKeysErrorZ_get_err(uint32_t arg) {
LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *val = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKHTLCOutputInCommitment 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *val = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *val = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKCounterpartyChannelTransactionParameters 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *val = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_ChannelTransactionParametersDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_ChannelTransactionParametersDecodeErrorZ *val = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKChannelTransactionParameters 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelTransactionParametersDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_ChannelTransactionParametersDecodeErrorZ *val = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_HolderCommitmentTransactionDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_HolderCommitmentTransactionDecodeErrorZ *val = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKHolderCommitmentTransaction 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_HolderCommitmentTransactionDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_HolderCommitmentTransactionDecodeErrorZ *val = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_BuiltCommitmentTransactionDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *val = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKBuiltCommitmentTransaction 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *val = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_TrustedClosingTransactionNoneZ_result_ok(uint32_t arg) {
LDKCResult_TrustedClosingTransactionNoneZ *val = (LDKCResult_TrustedClosingTransactionNoneZ*)(arg & ~1);
CHECK(val->result_ok);
LDKTrustedClosingTransaction 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
void __attribute__((visibility("default"))) TS_LDKCResult_TrustedClosingTransactionNoneZ_get_err(uint32_t arg) {
LDKCResult_CommitmentTransactionDecodeErrorZ *val = (LDKCResult_CommitmentTransactionDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKCommitmentTransaction 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_CommitmentTransactionDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_CommitmentTransactionDecodeErrorZ *val = (LDKCResult_CommitmentTransactionDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_TrustedCommitmentTransactionNoneZ_result_ok(uint32_t arg) {
LDKCResult_TrustedCommitmentTransactionNoneZ *val = (LDKCResult_TrustedCommitmentTransactionNoneZ*)(arg & ~1);
CHECK(val->result_ok);
LDKTrustedCommitmentTransaction 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
void __attribute__((visibility("default"))) TS_LDKCResult_TrustedCommitmentTransactionNoneZ_get_err(uint32_t arg) {
LDKCResult_CVec_SignatureZNoneZ *val = (LDKCResult_CVec_SignatureZNoneZ*)(arg & ~1);
CHECK(val->result_ok);
LDKCVec_SignatureZ res_var = (*val->contents.result);
- ptrArray res_arr = init_arr(res_var.datalen, sizeof(uint32_t), "Native ptrArray Bytes");
+ ptrArray res_arr = NULL;
+ res_arr = init_arr(res_var.datalen, sizeof(uint32_t), "Native ptrArray Bytes");
int8_tArray *res_arr_ptr = (int8_tArray*)(res_arr + 4);
for (size_t m = 0; m < res_var.datalen; m++) {
int8_tArray res_conv_12_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(res_conv_12_arr + 4), res_var.data[m].compact_form, 64);
res_arr_ptr[m] = res_conv_12_arr;
}
+
return res_arr;
}
void __attribute__((visibility("default"))) TS_LDKCResult_CVec_SignatureZNoneZ_get_err(uint32_t arg) {
LDKCResult_ShutdownScriptDecodeErrorZ *val = (LDKCResult_ShutdownScriptDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKShutdownScript 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ShutdownScriptDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_ShutdownScriptDecodeErrorZ *val = (LDKCResult_ShutdownScriptDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_ShutdownScriptInvalidShutdownScriptZ_result_ok(uint32_t arg) {
LDKCResult_ShutdownScriptInvalidShutdownScriptZ *val = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(arg & ~1);
CHECK(val->result_ok);
LDKShutdownScript 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ShutdownScriptInvalidShutdownScriptZ_get_err(uint32_t arg) {
LDKCResult_ShutdownScriptInvalidShutdownScriptZ *val = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(arg & ~1);
CHECK(!val->result_ok);
LDKInvalidShutdownScript 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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_NoneErrorZ_result_ok(uint32_t arg) {
LDKCResult_RouteHopDecodeErrorZ *val = (LDKCResult_RouteHopDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKRouteHop 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RouteHopDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_RouteHopDecodeErrorZ *val = (LDKCResult_RouteHopDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCVec_RouteHopZ_new(uint32_tArray elems) {
LDKCResult_RouteDecodeErrorZ *val = (LDKCResult_RouteDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKRoute 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RouteDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_RouteDecodeErrorZ *val = (LDKCResult_RouteDecodeErrorZ*)(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.
+ err_ref = (uint64_t)err_var.inner & ~1;
+ return err_ref;
+}
+jboolean __attribute__((visibility("default"))) TS_LDKCResult_RouteParametersDecodeErrorZ_result_ok(uint32_t arg) {
+ return ((LDKCResult_RouteParametersDecodeErrorZ*)arg)->result_ok;
+}
+uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RouteParametersDecodeErrorZ_get_ok(uint32_t arg) {
+ LDKCResult_RouteParametersDecodeErrorZ *val = (LDKCResult_RouteParametersDecodeErrorZ*)(arg & ~1);
+ CHECK(val->result_ok);
+ LDKRouteParameters 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_RouteParametersDecodeErrorZ_get_err(uint32_t arg) {
+ LDKCResult_RouteParametersDecodeErrorZ *val = (LDKCResult_RouteParametersDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
+uint32_t __attribute__((visibility("default"))) TS_LDKCVec_RouteHintZ_new(uint32_tArray elems) {
+ LDKCVec_RouteHintZ *ret = MALLOC(sizeof(LDKCVec_RouteHintZ), "LDKCVec_RouteHintZ");
+ ret->datalen = *((uint32_t*)elems);
+ if (ret->datalen == 0) {
+ ret->data = NULL;
+ } else {
+ ret->data = MALLOC(sizeof(LDKRouteHint) * ret->datalen, "LDKCVec_RouteHintZ Data");
+ uint32_t *java_elems = (uint32_t*)(elems + 4);
+ for (size_t i = 0; i < ret->datalen; i++) {
+ uint32_t arr_elem = java_elems[i];
+ LDKRouteHint arr_elem_conv;
+ arr_elem_conv.inner = (void*)(arr_elem & (~1));
+ arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0);
+ arr_elem_conv = RouteHint_clone(&arr_elem_conv);
+ ret->data[i] = arr_elem_conv;
+ }
+ }
+ return (uint64_t)ret;
+}
+static inline LDKCVec_RouteHintZ CVec_RouteHintZ_clone(const LDKCVec_RouteHintZ *orig) {
+ LDKCVec_RouteHintZ ret = { .data = MALLOC(sizeof(LDKRouteHint) * orig->datalen, "LDKCVec_RouteHintZ clone bytes"), .datalen = orig->datalen };
+ for (size_t i = 0; i < ret.datalen; i++) {
+ ret.data[i] = RouteHint_clone(&orig->data[i]);
+ }
+ return ret;
+}
uint32_t __attribute__((visibility("default"))) TS_LDKCOption_u64Z_ref_from_ptr(uint32_t ptr) {
LDKCOption_u64Z *obj = (LDKCOption_u64Z*)(ptr & ~1);
switch(obj->tag) {
default: abort();
}
}
-uint32_t __attribute__((visibility("default"))) TS_LDKCVec_ChannelDetailsZ_new(uint32_tArray elems) {
- LDKCVec_ChannelDetailsZ *ret = MALLOC(sizeof(LDKCVec_ChannelDetailsZ), "LDKCVec_ChannelDetailsZ");
+jboolean __attribute__((visibility("default"))) TS_LDKCResult_PayeeDecodeErrorZ_result_ok(uint32_t arg) {
+ return ((LDKCResult_PayeeDecodeErrorZ*)arg)->result_ok;
+}
+uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PayeeDecodeErrorZ_get_ok(uint32_t arg) {
+ LDKCResult_PayeeDecodeErrorZ *val = (LDKCResult_PayeeDecodeErrorZ*)(arg & ~1);
+ CHECK(val->result_ok);
+ LDKPayee 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_PayeeDecodeErrorZ_get_err(uint32_t arg) {
+ LDKCResult_PayeeDecodeErrorZ *val = (LDKCResult_PayeeDecodeErrorZ*)(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.
+ err_ref = (uint64_t)err_var.inner & ~1;
+ return err_ref;
+}
+uint32_t __attribute__((visibility("default"))) TS_LDKCVec_RouteHintHopZ_new(uint32_tArray elems) {
+ LDKCVec_RouteHintHopZ *ret = MALLOC(sizeof(LDKCVec_RouteHintHopZ), "LDKCVec_RouteHintHopZ");
ret->datalen = *((uint32_t*)elems);
if (ret->datalen == 0) {
ret->data = NULL;
} else {
- ret->data = MALLOC(sizeof(LDKChannelDetails) * ret->datalen, "LDKCVec_ChannelDetailsZ Data");
+ ret->data = MALLOC(sizeof(LDKRouteHintHop) * ret->datalen, "LDKCVec_RouteHintHopZ Data");
uint32_t *java_elems = (uint32_t*)(elems + 4);
for (size_t i = 0; i < ret->datalen; i++) {
uint32_t arr_elem = java_elems[i];
- LDKChannelDetails arr_elem_conv;
+ LDKRouteHintHop arr_elem_conv;
arr_elem_conv.inner = (void*)(arr_elem & (~1));
arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0);
- arr_elem_conv = ChannelDetails_clone(&arr_elem_conv);
+ arr_elem_conv = RouteHintHop_clone(&arr_elem_conv);
ret->data[i] = arr_elem_conv;
}
}
return (uint64_t)ret;
}
-static inline LDKCVec_ChannelDetailsZ CVec_ChannelDetailsZ_clone(const LDKCVec_ChannelDetailsZ *orig) {
- LDKCVec_ChannelDetailsZ ret = { .data = MALLOC(sizeof(LDKChannelDetails) * orig->datalen, "LDKCVec_ChannelDetailsZ clone bytes"), .datalen = orig->datalen };
+static inline LDKCVec_RouteHintHopZ CVec_RouteHintHopZ_clone(const LDKCVec_RouteHintHopZ *orig) {
+ LDKCVec_RouteHintHopZ ret = { .data = MALLOC(sizeof(LDKRouteHintHop) * orig->datalen, "LDKCVec_RouteHintHopZ clone bytes"), .datalen = orig->datalen };
for (size_t i = 0; i < ret.datalen; i++) {
- ret.data[i] = ChannelDetails_clone(&orig->data[i]);
+ ret.data[i] = RouteHintHop_clone(&orig->data[i]);
}
return ret;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKCVec_RouteHintZ_new(uint32_tArray elems) {
- LDKCVec_RouteHintZ *ret = MALLOC(sizeof(LDKCVec_RouteHintZ), "LDKCVec_RouteHintZ");
+jboolean __attribute__((visibility("default"))) TS_LDKCResult_RouteHintDecodeErrorZ_result_ok(uint32_t arg) {
+ return ((LDKCResult_RouteHintDecodeErrorZ*)arg)->result_ok;
+}
+uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RouteHintDecodeErrorZ_get_ok(uint32_t arg) {
+ LDKCResult_RouteHintDecodeErrorZ *val = (LDKCResult_RouteHintDecodeErrorZ*)(arg & ~1);
+ CHECK(val->result_ok);
+ LDKRouteHint 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_RouteHintDecodeErrorZ_get_err(uint32_t arg) {
+ LDKCResult_RouteHintDecodeErrorZ *val = (LDKCResult_RouteHintDecodeErrorZ*)(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.
+ err_ref = (uint64_t)err_var.inner & ~1;
+ return err_ref;
+}
+jboolean __attribute__((visibility("default"))) TS_LDKCResult_RouteHintHopDecodeErrorZ_result_ok(uint32_t arg) {
+ return ((LDKCResult_RouteHintHopDecodeErrorZ*)arg)->result_ok;
+}
+uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RouteHintHopDecodeErrorZ_get_ok(uint32_t arg) {
+ LDKCResult_RouteHintHopDecodeErrorZ *val = (LDKCResult_RouteHintHopDecodeErrorZ*)(arg & ~1);
+ CHECK(val->result_ok);
+ LDKRouteHintHop 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_RouteHintHopDecodeErrorZ_get_err(uint32_t arg) {
+ LDKCResult_RouteHintHopDecodeErrorZ *val = (LDKCResult_RouteHintHopDecodeErrorZ*)(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.
+ err_ref = (uint64_t)err_var.inner & ~1;
+ return err_ref;
+}
+uint32_t __attribute__((visibility("default"))) TS_LDKCVec_ChannelDetailsZ_new(uint32_tArray elems) {
+ LDKCVec_ChannelDetailsZ *ret = MALLOC(sizeof(LDKCVec_ChannelDetailsZ), "LDKCVec_ChannelDetailsZ");
ret->datalen = *((uint32_t*)elems);
if (ret->datalen == 0) {
ret->data = NULL;
} else {
- ret->data = MALLOC(sizeof(LDKRouteHint) * ret->datalen, "LDKCVec_RouteHintZ Data");
+ ret->data = MALLOC(sizeof(LDKChannelDetails) * ret->datalen, "LDKCVec_ChannelDetailsZ Data");
uint32_t *java_elems = (uint32_t*)(elems + 4);
for (size_t i = 0; i < ret->datalen; i++) {
uint32_t arr_elem = java_elems[i];
- LDKRouteHint arr_elem_conv;
+ LDKChannelDetails arr_elem_conv;
arr_elem_conv.inner = (void*)(arr_elem & (~1));
arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0);
- arr_elem_conv = RouteHint_clone(&arr_elem_conv);
+ arr_elem_conv = ChannelDetails_clone(&arr_elem_conv);
ret->data[i] = arr_elem_conv;
}
}
return (uint64_t)ret;
}
-static inline LDKCVec_RouteHintZ CVec_RouteHintZ_clone(const LDKCVec_RouteHintZ *orig) {
- LDKCVec_RouteHintZ ret = { .data = MALLOC(sizeof(LDKRouteHint) * orig->datalen, "LDKCVec_RouteHintZ clone bytes"), .datalen = orig->datalen };
+static inline LDKCVec_ChannelDetailsZ CVec_ChannelDetailsZ_clone(const LDKCVec_ChannelDetailsZ *orig) {
+ LDKCVec_ChannelDetailsZ ret = { .data = MALLOC(sizeof(LDKChannelDetails) * orig->datalen, "LDKCVec_ChannelDetailsZ clone bytes"), .datalen = orig->datalen };
for (size_t i = 0; i < ret.datalen; i++) {
- ret.data[i] = RouteHint_clone(&orig->data[i]);
+ ret.data[i] = ChannelDetails_clone(&orig->data[i]);
}
return ret;
}
LDKCResult_RouteLightningErrorZ *val = (LDKCResult_RouteLightningErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKRoute 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RouteLightningErrorZ_get_err(uint32_t arg) {
LDKCResult_RouteLightningErrorZ *val = (LDKCResult_RouteLightningErrorZ*)(arg & ~1);
CHECK(!val->result_ok);
LDKLightningError 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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_TxOutAccessErrorZ_result_ok(uint32_t arg) {
switch(obj->tag) {
case LDKMonitorEvent_HTLCEvent: {
LDKHTLCUpdate htlc_event_var = obj->htlc_event;
+ uint64_t htlc_event_ref = 0;
CHECK((((uint64_t)htlc_event_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&htlc_event_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t htlc_event_ref = (uint64_t)htlc_event_var.inner & ~1;
+ htlc_event_ref = (uint64_t)htlc_event_var.inner & ~1;
return 0 /* LDKMonitorEvent - HTLCEvent */; (void) htlc_event_ref;
}
case LDKMonitorEvent_CommitmentTxConfirmed: {
LDKOutPoint commitment_tx_confirmed_var = obj->commitment_tx_confirmed;
+ uint64_t commitment_tx_confirmed_ref = 0;
CHECK((((uint64_t)commitment_tx_confirmed_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&commitment_tx_confirmed_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t commitment_tx_confirmed_ref = (uint64_t)commitment_tx_confirmed_var.inner & ~1;
+ commitment_tx_confirmed_ref = (uint64_t)commitment_tx_confirmed_var.inner & ~1;
return 0 /* LDKMonitorEvent - CommitmentTxConfirmed */; (void) commitment_tx_confirmed_ref;
}
+ case LDKMonitorEvent_UpdateCompleted: {
+ LDKOutPoint funding_txo_var = obj->update_completed.funding_txo;
+ uint64_t funding_txo_ref = 0;
+ CHECK((((uint64_t)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&funding_txo_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ funding_txo_ref = (uint64_t)funding_txo_var.inner & ~1;
+ return 0 /* LDKMonitorEvent - UpdateCompleted */; (void) funding_txo_ref; (void) obj->update_completed.monitor_update_id;
+ }
+ case LDKMonitorEvent_UpdateFailed: {
+ LDKOutPoint update_failed_var = obj->update_failed;
+ uint64_t update_failed_ref = 0;
+ CHECK((((uint64_t)update_failed_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&update_failed_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ update_failed_ref = (uint64_t)update_failed_var.inner & ~1;
+ return 0 /* LDKMonitorEvent - UpdateFailed */; (void) update_failed_ref;
+ }
default: abort();
}
}
switch(obj->tag) {
case LDKNetworkUpdate_ChannelUpdateMessage: {
LDKChannelUpdate msg_var = obj->channel_update_message.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return 0 /* LDKNetworkUpdate - ChannelUpdateMessage */; (void) msg_ref;
}
case LDKNetworkUpdate_ChannelClosed: {
switch(obj->tag) {
case LDKSpendableOutputDescriptor_StaticOutput: {
LDKOutPoint outpoint_var = obj->static_output.outpoint;
+ uint64_t outpoint_ref = 0;
CHECK((((uint64_t)outpoint_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&outpoint_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t outpoint_ref = (uint64_t)outpoint_var.inner & ~1;
+ outpoint_ref = (uint64_t)outpoint_var.inner & ~1;
uint64_t output_ref = ((uint64_t)&obj->static_output.output) | 1;
return 0 /* LDKSpendableOutputDescriptor - StaticOutput */; (void) outpoint_ref; (void) (uint64_t)output_ref;
}
case LDKSpendableOutputDescriptor_DelayedPaymentOutput: {
LDKDelayedPaymentOutputDescriptor delayed_payment_output_var = obj->delayed_payment_output;
+ uint64_t delayed_payment_output_ref = 0;
CHECK((((uint64_t)delayed_payment_output_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&delayed_payment_output_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t delayed_payment_output_ref = (uint64_t)delayed_payment_output_var.inner & ~1;
+ delayed_payment_output_ref = (uint64_t)delayed_payment_output_var.inner & ~1;
return 0 /* LDKSpendableOutputDescriptor - DelayedPaymentOutput */; (void) delayed_payment_output_ref;
}
case LDKSpendableOutputDescriptor_StaticPaymentOutput: {
LDKStaticPaymentOutputDescriptor static_payment_output_var = obj->static_payment_output;
+ uint64_t static_payment_output_ref = 0;
CHECK((((uint64_t)static_payment_output_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&static_payment_output_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t static_payment_output_ref = (uint64_t)static_payment_output_var.inner & ~1;
+ static_payment_output_ref = (uint64_t)static_payment_output_var.inner & ~1;
return 0 /* LDKSpendableOutputDescriptor - StaticPaymentOutput */; (void) static_payment_output_ref;
}
default: abort();
switch(obj->tag) {
case LDKErrorAction_DisconnectPeer: {
LDKErrorMessage msg_var = obj->disconnect_peer.msg;
- CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
- CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ uint64_t msg_ref = 0;
+ if ((uint64_t)msg_var.inner > 4096) {
+ CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ msg_ref = (uint64_t)msg_var.inner & ~1;
+ }
return 0 /* LDKErrorAction - DisconnectPeer */; (void) msg_ref;
}
case LDKErrorAction_IgnoreError: {
}
case LDKErrorAction_SendErrorMessage: {
LDKErrorMessage msg_var = obj->send_error_message.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return 0 /* LDKErrorAction - SendErrorMessage */; (void) msg_ref;
}
default: abort();
int8_tArray node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(node_id_arr + 4), obj->send_accept_channel.node_id.compressed_form, 33);
LDKAcceptChannel msg_var = obj->send_accept_channel.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return 0 /* LDKMessageSendEvent - SendAcceptChannel */; (void) node_id_arr; (void) msg_ref;
}
case LDKMessageSendEvent_SendOpenChannel: {
int8_tArray node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(node_id_arr + 4), obj->send_open_channel.node_id.compressed_form, 33);
LDKOpenChannel msg_var = obj->send_open_channel.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return 0 /* LDKMessageSendEvent - SendOpenChannel */; (void) node_id_arr; (void) msg_ref;
}
case LDKMessageSendEvent_SendFundingCreated: {
int8_tArray node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(node_id_arr + 4), obj->send_funding_created.node_id.compressed_form, 33);
LDKFundingCreated msg_var = obj->send_funding_created.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return 0 /* LDKMessageSendEvent - SendFundingCreated */; (void) node_id_arr; (void) msg_ref;
}
case LDKMessageSendEvent_SendFundingSigned: {
int8_tArray node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(node_id_arr + 4), obj->send_funding_signed.node_id.compressed_form, 33);
LDKFundingSigned msg_var = obj->send_funding_signed.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return 0 /* LDKMessageSendEvent - SendFundingSigned */; (void) node_id_arr; (void) msg_ref;
}
case LDKMessageSendEvent_SendFundingLocked: {
int8_tArray node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(node_id_arr + 4), obj->send_funding_locked.node_id.compressed_form, 33);
LDKFundingLocked msg_var = obj->send_funding_locked.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return 0 /* LDKMessageSendEvent - SendFundingLocked */; (void) node_id_arr; (void) msg_ref;
}
case LDKMessageSendEvent_SendAnnouncementSignatures: {
int8_tArray node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(node_id_arr + 4), obj->send_announcement_signatures.node_id.compressed_form, 33);
LDKAnnouncementSignatures msg_var = obj->send_announcement_signatures.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return 0 /* LDKMessageSendEvent - SendAnnouncementSignatures */; (void) node_id_arr; (void) msg_ref;
}
case LDKMessageSendEvent_UpdateHTLCs: {
int8_tArray node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(node_id_arr + 4), obj->update_htl_cs.node_id.compressed_form, 33);
LDKCommitmentUpdate updates_var = obj->update_htl_cs.updates;
+ uint64_t updates_ref = 0;
CHECK((((uint64_t)updates_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&updates_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t updates_ref = (uint64_t)updates_var.inner & ~1;
+ updates_ref = (uint64_t)updates_var.inner & ~1;
return 0 /* LDKMessageSendEvent - UpdateHTLCs */; (void) node_id_arr; (void) updates_ref;
}
case LDKMessageSendEvent_SendRevokeAndACK: {
int8_tArray node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(node_id_arr + 4), obj->send_revoke_and_ack.node_id.compressed_form, 33);
LDKRevokeAndACK msg_var = obj->send_revoke_and_ack.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return 0 /* LDKMessageSendEvent - SendRevokeAndACK */; (void) node_id_arr; (void) msg_ref;
}
case LDKMessageSendEvent_SendClosingSigned: {
int8_tArray node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(node_id_arr + 4), obj->send_closing_signed.node_id.compressed_form, 33);
LDKClosingSigned msg_var = obj->send_closing_signed.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return 0 /* LDKMessageSendEvent - SendClosingSigned */; (void) node_id_arr; (void) msg_ref;
}
case LDKMessageSendEvent_SendShutdown: {
int8_tArray node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(node_id_arr + 4), obj->send_shutdown.node_id.compressed_form, 33);
LDKShutdown msg_var = obj->send_shutdown.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return 0 /* LDKMessageSendEvent - SendShutdown */; (void) node_id_arr; (void) msg_ref;
}
case LDKMessageSendEvent_SendChannelReestablish: {
int8_tArray node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(node_id_arr + 4), obj->send_channel_reestablish.node_id.compressed_form, 33);
LDKChannelReestablish msg_var = obj->send_channel_reestablish.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return 0 /* LDKMessageSendEvent - SendChannelReestablish */; (void) node_id_arr; (void) msg_ref;
}
case LDKMessageSendEvent_BroadcastChannelAnnouncement: {
LDKChannelAnnouncement msg_var = obj->broadcast_channel_announcement.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
LDKChannelUpdate update_msg_var = obj->broadcast_channel_announcement.update_msg;
+ uint64_t update_msg_ref = 0;
CHECK((((uint64_t)update_msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&update_msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t update_msg_ref = (uint64_t)update_msg_var.inner & ~1;
+ update_msg_ref = (uint64_t)update_msg_var.inner & ~1;
return 0 /* LDKMessageSendEvent - BroadcastChannelAnnouncement */; (void) msg_ref; (void) update_msg_ref;
}
case LDKMessageSendEvent_BroadcastNodeAnnouncement: {
LDKNodeAnnouncement msg_var = obj->broadcast_node_announcement.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return 0 /* LDKMessageSendEvent - BroadcastNodeAnnouncement */; (void) msg_ref;
}
case LDKMessageSendEvent_BroadcastChannelUpdate: {
LDKChannelUpdate msg_var = obj->broadcast_channel_update.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return 0 /* LDKMessageSendEvent - BroadcastChannelUpdate */; (void) msg_ref;
}
case LDKMessageSendEvent_SendChannelUpdate: {
int8_tArray node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(node_id_arr + 4), obj->send_channel_update.node_id.compressed_form, 33);
LDKChannelUpdate msg_var = obj->send_channel_update.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return 0 /* LDKMessageSendEvent - SendChannelUpdate */; (void) node_id_arr; (void) msg_ref;
}
case LDKMessageSendEvent_HandleError: {
int8_tArray node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(node_id_arr + 4), obj->send_channel_range_query.node_id.compressed_form, 33);
LDKQueryChannelRange msg_var = obj->send_channel_range_query.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return 0 /* LDKMessageSendEvent - SendChannelRangeQuery */; (void) node_id_arr; (void) msg_ref;
}
case LDKMessageSendEvent_SendShortIdsQuery: {
int8_tArray node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(node_id_arr + 4), obj->send_short_ids_query.node_id.compressed_form, 33);
LDKQueryShortChannelIds msg_var = obj->send_short_ids_query.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return 0 /* LDKMessageSendEvent - SendShortIdsQuery */; (void) node_id_arr; (void) msg_ref;
}
case LDKMessageSendEvent_SendReplyChannelRange: {
int8_tArray node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(node_id_arr + 4), obj->send_reply_channel_range.node_id.compressed_form, 33);
LDKReplyChannelRange msg_var = obj->send_reply_channel_range.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return 0 /* LDKMessageSendEvent - SendReplyChannelRange */; (void) node_id_arr; (void) msg_ref;
}
default: abort();
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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ 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;
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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_NodeFeaturesDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_NodeFeaturesDecodeErrorZ *val = (LDKCResult_NodeFeaturesDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ 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);
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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_ChannelFeaturesDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_ChannelFeaturesDecodeErrorZ *val = (LDKCResult_ChannelFeaturesDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKChannelFeatures 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelFeaturesDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_ChannelFeaturesDecodeErrorZ *val = (LDKCResult_ChannelFeaturesDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_InvoiceFeaturesDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_InvoiceFeaturesDecodeErrorZ *val = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ 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);
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.
+ err_ref = (uint64_t)err_var.inner & ~1;
+ return err_ref;
+}
+jboolean __attribute__((visibility("default"))) TS_LDKCResult_ScoringParametersDecodeErrorZ_result_ok(uint32_t arg) {
+ return ((LDKCResult_ScoringParametersDecodeErrorZ*)arg)->result_ok;
+}
+uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ScoringParametersDecodeErrorZ_get_ok(uint32_t arg) {
+ LDKCResult_ScoringParametersDecodeErrorZ *val = (LDKCResult_ScoringParametersDecodeErrorZ*)(arg & ~1);
+ CHECK(val->result_ok);
+ 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_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;
+ 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.
+ err_ref = (uint64_t)err_var.inner & ~1;
+ return err_ref;
+}
+jboolean __attribute__((visibility("default"))) TS_LDKCResult_ScorerDecodeErrorZ_result_ok(uint32_t arg) {
+ return ((LDKCResult_ScorerDecodeErrorZ*)arg)->result_ok;
+}
+uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ScorerDecodeErrorZ_get_ok(uint32_t arg) {
+ LDKCResult_ScorerDecodeErrorZ *val = (LDKCResult_ScorerDecodeErrorZ*)(arg & ~1);
+ CHECK(val->result_ok);
+ 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_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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *val = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKDelayedPaymentOutputDescriptor 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *val = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *val = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKStaticPaymentOutputDescriptor 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *val = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_SpendableOutputDescriptorDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_SpendableOutputDescriptorDecodeErrorZ *val = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_NoneNoneZ_result_ok(uint32_t arg) {
ptrArray __attribute__((visibility("default"))) TS_C2Tuple_SignatureCVec_SignatureZZ_get_b(uint32_t tuple) {
LDKC2Tuple_SignatureCVec_SignatureZZ* tuple_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)(tuple & ~1);
LDKCVec_SignatureZ ret_var = C2Tuple_SignatureCVec_SignatureZZ_get_b(tuple_conv);
- ptrArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native ptrArray Bytes");
+ ptrArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native ptrArray Bytes");
int8_tArray *ret_arr_ptr = (int8_tArray*)(ret_arr + 4);
for (size_t m = 0; m < ret_var.datalen; m++) {
int8_tArray ret_conv_12_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(ret_conv_12_arr + 4), ret_var.data[m].compact_form, 64);
ret_arr_ptr[m] = ret_conv_12_arr;
}
+
FREE(ret_var.data);
return ret_arr;
}
LDKCResult_NoneNoneZ validate_holder_commitment_LDKBaseSign_jcall(const void* this_arg, const LDKHolderCommitmentTransaction * holder_tx) {
LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
LDKHolderCommitmentTransaction holder_tx_var = *holder_tx;
+ uint64_t holder_tx_ref = 0;
holder_tx_var = HolderCommitmentTransaction_clone(holder_tx);
CHECK((((uint64_t)holder_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&holder_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t holder_tx_ref = (uint64_t)holder_tx_var.inner;
+ holder_tx_ref = (uint64_t)holder_tx_var.inner;
if (holder_tx_var.is_owned) {
holder_tx_ref |= 1;
}
LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment_LDKBaseSign_jcall(const void* this_arg, const LDKCommitmentTransaction * commitment_tx) {
LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
LDKCommitmentTransaction commitment_tx_var = *commitment_tx;
+ uint64_t commitment_tx_ref = 0;
commitment_tx_var = CommitmentTransaction_clone(commitment_tx);
CHECK((((uint64_t)commitment_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&commitment_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t commitment_tx_ref = (uint64_t)commitment_tx_var.inner;
+ commitment_tx_ref = (uint64_t)commitment_tx_var.inner;
if (commitment_tx_var.is_owned) {
commitment_tx_ref |= 1;
}
LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htlcs_LDKBaseSign_jcall(const void* this_arg, const LDKHolderCommitmentTransaction * commitment_tx) {
LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
LDKHolderCommitmentTransaction commitment_tx_var = *commitment_tx;
+ uint64_t commitment_tx_ref = 0;
commitment_tx_var = HolderCommitmentTransaction_clone(commitment_tx);
CHECK((((uint64_t)commitment_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&commitment_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t commitment_tx_ref = (uint64_t)commitment_tx_var.inner;
+ commitment_tx_ref = (uint64_t)commitment_tx_var.inner;
if (commitment_tx_var.is_owned) {
commitment_tx_ref |= 1;
}
int8_tArray per_commitment_key_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(per_commitment_key_arr + 4), *per_commitment_key, 32);
LDKHTLCOutputInCommitment htlc_var = *htlc;
+ uint64_t htlc_ref = 0;
htlc_var = HTLCOutputInCommitment_clone(htlc);
CHECK((((uint64_t)htlc_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&htlc_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t htlc_ref = (uint64_t)htlc_var.inner;
+ htlc_ref = (uint64_t)htlc_var.inner;
if (htlc_var.is_owned) {
htlc_ref |= 1;
}
int8_tArray per_commitment_point_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(per_commitment_point_arr + 4), per_commitment_point.compressed_form, 33);
LDKHTLCOutputInCommitment htlc_var = *htlc;
+ uint64_t htlc_ref = 0;
htlc_var = HTLCOutputInCommitment_clone(htlc);
CHECK((((uint64_t)htlc_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&htlc_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t htlc_ref = (uint64_t)htlc_var.inner;
+ htlc_ref = (uint64_t)htlc_var.inner;
if (htlc_var.is_owned) {
htlc_ref |= 1;
}
LDKCResult_SignatureNoneZ sign_closing_transaction_LDKBaseSign_jcall(const void* this_arg, const LDKClosingTransaction * closing_tx) {
LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
LDKClosingTransaction closing_tx_var = *closing_tx;
+ uint64_t closing_tx_ref = 0;
closing_tx_var = ClosingTransaction_clone(closing_tx);
CHECK((((uint64_t)closing_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&closing_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t closing_tx_ref = (uint64_t)closing_tx_var.inner;
+ closing_tx_ref = (uint64_t)closing_tx_var.inner;
if (closing_tx_var.is_owned) {
closing_tx_ref |= 1;
}
LDKCResult_SignatureNoneZ sign_channel_announcement_LDKBaseSign_jcall(const void* this_arg, const LDKUnsignedChannelAnnouncement * msg) {
LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
LDKUnsignedChannelAnnouncement msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = UnsignedChannelAnnouncement_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
void ready_channel_LDKBaseSign_jcall(void* this_arg, const LDKChannelTransactionParameters * channel_parameters) {
LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
LDKChannelTransactionParameters channel_parameters_var = *channel_parameters;
+ uint64_t channel_parameters_ref = 0;
channel_parameters_var = ChannelTransactionParameters_clone(channel_parameters);
CHECK((((uint64_t)channel_parameters_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&channel_parameters_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t channel_parameters_ref = (uint64_t)channel_parameters_var.inner;
+ channel_parameters_ref = (uint64_t)channel_parameters_var.inner;
if (channel_parameters_var.is_owned) {
channel_parameters_ref |= 1;
}
if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
LDKChannelPublicKeys ret_var = LDKBaseSign_set_get_pubkeys(this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_SignDecodeErrorZ_get_ok(uint32_t arg) {
LDKCResult_SignDecodeErrorZ *val = (LDKCResult_SignDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
- LDKSign* res_ret =MALLOC(sizeof(LDKSign), "LDKSign");
+ LDKSign* res_ret = MALLOC(sizeof(LDKSign), "LDKSign");
*res_ret = Sign_clone(&(*val->contents.result));
return (uint64_t)res_ret;
}
LDKCResult_SignDecodeErrorZ *val = (LDKCResult_SignDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_RecoverableSignatureNoneZ_result_ok(uint32_t arg) {
LDKCResult_CVec_CVec_u8ZZNoneZ *val = (LDKCResult_CVec_CVec_u8ZZNoneZ*)(arg & ~1);
CHECK(val->result_ok);
LDKCVec_CVec_u8ZZ res_var = (*val->contents.result);
- ptrArray res_arr = init_arr(res_var.datalen, sizeof(uint32_t), "Native ptrArray Bytes");
+ ptrArray res_arr = NULL;
+ res_arr = init_arr(res_var.datalen, sizeof(uint32_t), "Native ptrArray Bytes");
int8_tArray *res_arr_ptr = (int8_tArray*)(res_arr + 4);
for (size_t m = 0; m < res_var.datalen; m++) {
LDKCVec_u8Z res_conv_12_var = res_var.data[m];
memcpy((uint8_t*)(res_conv_12_arr + 4), res_conv_12_var.data, res_conv_12_var.datalen);
res_arr_ptr[m] = res_conv_12_arr;
}
+
return res_arr;
}
void __attribute__((visibility("default"))) TS_LDKCResult_CVec_CVec_u8ZZNoneZ_get_err(uint32_t arg) {
LDKCResult_InMemorySignerDecodeErrorZ *val = (LDKCResult_InMemorySignerDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKInMemorySigner 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InMemorySignerDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_InMemorySignerDecodeErrorZ *val = (LDKCResult_InMemorySignerDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCVec_TxOutZ_new(uint32_tArray elems) {
uint32_t __attribute__((visibility("default"))) TS_C2Tuple_BlockHashChannelMonitorZ_get_b(uint32_t tuple) {
LDKC2Tuple_BlockHashChannelMonitorZ* tuple_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)(tuple & ~1);
LDKChannelMonitor ret_var = C2Tuple_BlockHashChannelMonitorZ_get_b(tuple_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *val = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKCVec_C2Tuple_BlockHashChannelMonitorZZ res_var = (*val->contents.result);
- uint32_tArray res_arr = init_arr(res_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray res_arr = NULL;
+ res_arr = init_arr(res_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *res_arr_ptr = (uint32_t*)(res_arr + 4);
for (size_t j = 0; j < res_var.datalen; j++) {
LDKC2Tuple_BlockHashChannelMonitorZ* res_conv_35_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ");
*res_conv_35_conv = C2Tuple_BlockHashChannelMonitorZ_clone(res_conv_35_conv);
res_arr_ptr[j] = ((uint64_t)res_conv_35_conv);
}
+
return res_arr;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_get_err(uint32_t arg) {
uint32_t err_conv = LDKIOError_to_js((*val->contents.err));
return err_conv;
}
-jboolean __attribute__((visibility("default"))) TS_LDKCResult_PaymentIdDecodeErrorZ_result_ok(uint32_t arg) {
- return ((LDKCResult_PaymentIdDecodeErrorZ*)arg)->result_ok;
-}
-uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PaymentIdDecodeErrorZ_get_ok(uint32_t arg) {
- LDKCResult_PaymentIdDecodeErrorZ *val = (LDKCResult_PaymentIdDecodeErrorZ*)(arg & ~1);
- CHECK(val->result_ok);
- LDKPaymentId res_var = (*val->contents.result);
- 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
- return res_ref;
-}
-uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PaymentIdDecodeErrorZ_get_err(uint32_t arg) {
- LDKCResult_PaymentIdDecodeErrorZ *val = (LDKCResult_PaymentIdDecodeErrorZ*)(arg & ~1);
- CHECK(!val->result_ok);
- LDKDecodeError err_var = (*val->contents.err);
- 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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
- return err_ref;
-}
uint32_t __attribute__((visibility("default"))) TS_LDKCOption_u16Z_ref_from_ptr(uint32_t ptr) {
LDKCOption_u16Z *obj = (LDKCOption_u16Z*)(ptr & ~1);
switch(obj->tag) {
}
case LDKAPIError_IncompatibleShutdownScript: {
LDKShutdownScript script_var = obj->incompatible_shutdown_script.script;
+ uint64_t script_ref = 0;
CHECK((((uint64_t)script_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&script_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t script_ref = (uint64_t)script_var.inner & ~1;
+ script_ref = (uint64_t)script_var.inner & ~1;
return 0 /* LDKAPIError - IncompatibleShutdownScript */; (void) script_ref;
}
default: abort();
}
case LDKPaymentSendFailure_PathParameterError: {
LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error_var = obj->path_parameter_error;
- uint32_tArray path_parameter_error_arr = init_arr(path_parameter_error_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray path_parameter_error_arr = NULL;
+ path_parameter_error_arr = init_arr(path_parameter_error_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *path_parameter_error_arr_ptr = (uint32_t*)(path_parameter_error_arr + 4);
for (size_t w = 0; w < path_parameter_error_var.datalen; w++) {
LDKCResult_NoneAPIErrorZ* path_parameter_error_conv_22_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
*path_parameter_error_conv_22_conv = CResult_NoneAPIErrorZ_clone(path_parameter_error_conv_22_conv);
path_parameter_error_arr_ptr[w] = (uint64_t)path_parameter_error_conv_22_conv;
}
+
return 0 /* LDKPaymentSendFailure - PathParameterError */; (void) path_parameter_error_arr;
}
case LDKPaymentSendFailure_AllFailedRetrySafe: {
LDKCVec_APIErrorZ all_failed_retry_safe_var = obj->all_failed_retry_safe;
- uint32_tArray all_failed_retry_safe_arr = init_arr(all_failed_retry_safe_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray all_failed_retry_safe_arr = NULL;
+ all_failed_retry_safe_arr = init_arr(all_failed_retry_safe_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *all_failed_retry_safe_arr_ptr = (uint32_t*)(all_failed_retry_safe_arr + 4);
for (size_t k = 0; k < all_failed_retry_safe_var.datalen; k++) {
uint64_t all_failed_retry_safe_conv_10_ref = ((uint64_t)&all_failed_retry_safe_var.data[k]) | 1;
all_failed_retry_safe_arr_ptr[k] = all_failed_retry_safe_conv_10_ref;
}
+
return 0 /* LDKPaymentSendFailure - AllFailedRetrySafe */; (void) all_failed_retry_safe_arr;
}
case LDKPaymentSendFailure_PartialFailure: {
- LDKCVec_CResult_NoneAPIErrorZZ partial_failure_var = obj->partial_failure;
- uint32_tArray partial_failure_arr = init_arr(partial_failure_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
- uint32_t *partial_failure_arr_ptr = (uint32_t*)(partial_failure_arr + 4);
- for (size_t w = 0; w < partial_failure_var.datalen; w++) {
- LDKCResult_NoneAPIErrorZ* partial_failure_conv_22_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
- *partial_failure_conv_22_conv = partial_failure_var.data[w];
- *partial_failure_conv_22_conv = CResult_NoneAPIErrorZ_clone(partial_failure_conv_22_conv);
- partial_failure_arr_ptr[w] = (uint64_t)partial_failure_conv_22_conv;
+ LDKCVec_CResult_NoneAPIErrorZZ results_var = obj->partial_failure.results;
+ uint32_tArray results_arr = NULL;
+ results_arr = init_arr(results_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_t *results_arr_ptr = (uint32_t*)(results_arr + 4);
+ for (size_t w = 0; w < results_var.datalen; w++) {
+ LDKCResult_NoneAPIErrorZ* results_conv_22_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
+ *results_conv_22_conv = results_var.data[w];
+ *results_conv_22_conv = CResult_NoneAPIErrorZ_clone(results_conv_22_conv);
+ results_arr_ptr[w] = (uint64_t)results_conv_22_conv;
+ }
+
+ LDKRouteParameters failed_paths_retry_var = obj->partial_failure.failed_paths_retry;
+ uint64_t failed_paths_retry_ref = 0;
+ if ((uint64_t)failed_paths_retry_var.inner > 4096) {
+ CHECK((((uint64_t)failed_paths_retry_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&failed_paths_retry_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ failed_paths_retry_ref = (uint64_t)failed_paths_retry_var.inner & ~1;
}
- return 0 /* LDKPaymentSendFailure - PartialFailure */; (void) partial_failure_arr;
+ int8_tArray payment_id_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(payment_id_arr + 4), obj->partial_failure.payment_id.data, 32);
+ return 0 /* LDKPaymentSendFailure - PartialFailure */; (void) results_arr; (void) failed_paths_retry_ref; (void) payment_id_arr;
}
default: abort();
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_PaymentIdPaymentSendFailureZ_result_ok(uint32_t arg) {
return ((LDKCResult_PaymentIdPaymentSendFailureZ*)arg)->result_ok;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PaymentIdPaymentSendFailureZ_get_ok(uint32_t arg) {
+int8_tArray __attribute__((visibility("default"))) TS_LDKCResult_PaymentIdPaymentSendFailureZ_get_ok(uint32_t arg) {
LDKCResult_PaymentIdPaymentSendFailureZ *val = (LDKCResult_PaymentIdPaymentSendFailureZ*)(arg & ~1);
CHECK(val->result_ok);
- LDKPaymentId res_var = (*val->contents.result);
- 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
- return res_ref;
+ 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_PaymentIdPaymentSendFailureZ_get_err(uint32_t arg) {
LDKCResult_PaymentIdPaymentSendFailureZ *val = (LDKCResult_PaymentIdPaymentSendFailureZ*)(arg & ~1);
return ret_arr;
}
-static inline struct LDKPaymentId C2Tuple_PaymentHashPaymentIdZ_get_b(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR tuple){
- return PaymentId_clone(&tuple->b);
+static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentIdZ_get_b(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR tuple){
+ return ThirtyTwoBytes_clone(&tuple->b);
}
-uint32_t __attribute__((visibility("default"))) TS_C2Tuple_PaymentHashPaymentIdZ_get_b(uint32_t tuple) {
+int8_tArray __attribute__((visibility("default"))) TS_C2Tuple_PaymentHashPaymentIdZ_get_b(uint32_t tuple) {
LDKC2Tuple_PaymentHashPaymentIdZ* tuple_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)(tuple & ~1);
- LDKPaymentId ret_var = C2Tuple_PaymentHashPaymentIdZ_get_b(tuple_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
- }
- return ret_ref;
+ int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), C2Tuple_PaymentHashPaymentIdZ_get_b(tuple_conv).data, 32);
+ return ret_arr;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_result_ok(uint32_t arg) {
LDKCResult_NoneChannelMonitorUpdateErrZ watch_channel_LDKWatch_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitor monitor) {
LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
LDKOutPoint funding_txo_var = funding_txo;
+ uint64_t funding_txo_ref = 0;
CHECK((((uint64_t)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&funding_txo_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t funding_txo_ref = (uint64_t)funding_txo_var.inner;
+ funding_txo_ref = (uint64_t)funding_txo_var.inner;
if (funding_txo_var.is_owned) {
funding_txo_ref |= 1;
}
LDKChannelMonitor monitor_var = monitor;
+ uint64_t monitor_ref = 0;
CHECK((((uint64_t)monitor_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&monitor_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t monitor_ref = (uint64_t)monitor_var.inner;
+ monitor_ref = (uint64_t)monitor_var.inner;
if (monitor_var.is_owned) {
monitor_ref |= 1;
}
LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_LDKWatch_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitorUpdate update) {
LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
LDKOutPoint funding_txo_var = funding_txo;
+ uint64_t funding_txo_ref = 0;
CHECK((((uint64_t)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&funding_txo_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t funding_txo_ref = (uint64_t)funding_txo_var.inner;
+ funding_txo_ref = (uint64_t)funding_txo_var.inner;
if (funding_txo_var.is_owned) {
funding_txo_ref |= 1;
}
LDKChannelMonitorUpdate update_var = update;
+ uint64_t update_ref = 0;
CHECK((((uint64_t)update_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&update_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t update_ref = (uint64_t)update_var.inner;
+ update_ref = (uint64_t)update_var.inner;
if (update_var.is_owned) {
update_ref |= 1;
}
if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr;
LDKCVec_MonitorEventZ ret_var = (this_arg_conv->release_pending_monitor_events)(this_arg_conv->this_arg);
- uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t o = 0; o < ret_var.datalen; o++) {
LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
uint64_t ret_conv_14_ref = (uint64_t)ret_conv_14_copy;
ret_arr_ptr[o] = ret_conv_14_ref;
}
+
FREE(ret_var.data);
return ret_arr;
}
if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
LDKShutdownScript ret_var = (this_arg_conv->get_shutdown_scriptpubkey)(this_arg_conv->this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
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;
- LDKSign* ret_ret =MALLOC(sizeof(LDKSign), "LDKSign");
+ LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
*ret_ret = (this_arg_conv->get_channel_signer)(this_arg_conv->this_arg, inbound, channel_value_satoshis);
return (uint64_t)ret_ret;
}
uint32_t __attribute__((visibility("default"))) TS_C2Tuple_BlockHashChannelManagerZ_get_b(uint32_t tuple) {
LDKC2Tuple_BlockHashChannelManagerZ* tuple_conv = (LDKC2Tuple_BlockHashChannelManagerZ*)(tuple & ~1);
LDKChannelManager ret_var = *C2Tuple_BlockHashChannelManagerZ_get_b(tuple_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner & ~1;
+ ret_ref = (uint64_t)ret_var.inner & ~1;
return ret_ref;
}
LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *val = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_ChannelConfigDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_ChannelConfigDecodeErrorZ *val = (LDKCResult_ChannelConfigDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKChannelConfig 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelConfigDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_ChannelConfigDecodeErrorZ *val = (LDKCResult_ChannelConfigDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_OutPointDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_OutPointDecodeErrorZ *val = (LDKCResult_OutPointDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKOutPoint 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_OutPointDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_OutPointDecodeErrorZ *val = (LDKCResult_OutPointDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
typedef struct LDKType_JCalls {
LDKCOption_TypeZ *obj = (LDKCOption_TypeZ*)(ptr & ~1);
switch(obj->tag) {
case LDKCOption_TypeZ_Some: {
- LDKType* some_ret =MALLOC(sizeof(LDKType), "LDKType");
+ LDKType* some_ret = MALLOC(sizeof(LDKType), "LDKType");
*some_ret = Type_clone(&obj->some);
return 0 /* LDKCOption_TypeZ - Some */; (void) (uint64_t)some_ret;
}
LDKCResult_COption_TypeZDecodeErrorZ *val = (LDKCResult_COption_TypeZDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
+ return err_ref;
+}
+uint32_t __attribute__((visibility("default"))) TS_LDKPaymentError_ref_from_ptr(uint32_t ptr) {
+ LDKPaymentError *obj = (LDKPaymentError*)(ptr & ~1);
+ switch(obj->tag) {
+ case LDKPaymentError_Invoice: {
+ LDKStr invoice_str = obj->invoice;
+ jstring invoice_conv = str_ref_to_ts(invoice_str.chars, invoice_str.len);
+ return 0 /* LDKPaymentError - Invoice */; (void) invoice_conv;
+ }
+ case LDKPaymentError_Routing: {
+ LDKLightningError routing_var = obj->routing;
+ uint64_t routing_ref = 0;
+ CHECK((((uint64_t)routing_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&routing_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ routing_ref = (uint64_t)routing_var.inner & ~1;
+ return 0 /* LDKPaymentError - Routing */; (void) routing_ref;
+ }
+ case LDKPaymentError_Sending: {
+ uint64_t sending_ref = ((uint64_t)&obj->sending) | 1;
+ return 0 /* LDKPaymentError - Sending */; (void) sending_ref;
+ }
+ default: abort();
+ }
+}
+jboolean __attribute__((visibility("default"))) TS_LDKCResult_PaymentIdPaymentErrorZ_result_ok(uint32_t arg) {
+ return ((LDKCResult_PaymentIdPaymentErrorZ*)arg)->result_ok;
+}
+int8_tArray __attribute__((visibility("default"))) TS_LDKCResult_PaymentIdPaymentErrorZ_get_ok(uint32_t arg) {
+ LDKCResult_PaymentIdPaymentErrorZ *val = (LDKCResult_PaymentIdPaymentErrorZ*)(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_PaymentIdPaymentErrorZ_get_err(uint32_t arg) {
+ LDKCResult_PaymentIdPaymentErrorZ *val = (LDKCResult_PaymentIdPaymentErrorZ*)(arg & ~1);
+ CHECK(!val->result_ok);
+ uint64_t err_ref = ((uint64_t)&(*val->contents.err)) | 1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_SiPrefixNoneZ_result_ok(uint32_t arg) {
LDKCResult_InvoiceNoneZ *val = (LDKCResult_InvoiceNoneZ*)(arg & ~1);
CHECK(val->result_ok);
LDKInvoice 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
void __attribute__((visibility("default"))) TS_LDKCResult_InvoiceNoneZ_get_err(uint32_t arg) {
LDKCResult_SignedRawInvoiceNoneZ *val = (LDKCResult_SignedRawInvoiceNoneZ*)(arg & ~1);
CHECK(val->result_ok);
LDKSignedRawInvoice 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
void __attribute__((visibility("default"))) TS_LDKCResult_SignedRawInvoiceNoneZ_get_err(uint32_t arg) {
uint32_t __attribute__((visibility("default"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(uint32_t tuple) {
LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* tuple_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(tuple & ~1);
LDKRawInvoice ret_var = C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(tuple_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
uint32_t __attribute__((visibility("default"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(uint32_t tuple) {
LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* tuple_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(tuple & ~1);
LDKInvoiceSignature ret_var = C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(tuple_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKCResult_PayeePubKeyErrorZ *val = (LDKCResult_PayeePubKeyErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKPayeePubKey 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PayeePubKeyErrorZ_get_err(uint32_t arg) {
LDKCResult_PositiveTimestampCreationErrorZ *val = (LDKCResult_PositiveTimestampCreationErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKPositiveTimestamp 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PositiveTimestampCreationErrorZ_get_err(uint32_t arg) {
LDKCResult_InvoiceSemanticErrorZ *val = (LDKCResult_InvoiceSemanticErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKInvoice 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InvoiceSemanticErrorZ_get_err(uint32_t arg) {
LDKCResult_DescriptionCreationErrorZ *val = (LDKCResult_DescriptionCreationErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKDescription 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_DescriptionCreationErrorZ_get_err(uint32_t arg) {
LDKCResult_ExpiryTimeCreationErrorZ *val = (LDKCResult_ExpiryTimeCreationErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKExpiryTime 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ExpiryTimeCreationErrorZ_get_err(uint32_t arg) {
LDKCResult_PrivateRouteCreationErrorZ *val = (LDKCResult_PrivateRouteCreationErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKPrivateRoute 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PrivateRouteCreationErrorZ_get_err(uint32_t arg) {
LDKCResult_ChannelMonitorUpdateDecodeErrorZ *val = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKChannelMonitorUpdate 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelMonitorUpdateDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_ChannelMonitorUpdateDecodeErrorZ *val = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_HTLCUpdateDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_HTLCUpdateDecodeErrorZ *val = (LDKCResult_HTLCUpdateDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKHTLCUpdate 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_HTLCUpdateDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_HTLCUpdateDecodeErrorZ *val = (LDKCResult_HTLCUpdateDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_NoneMonitorUpdateErrorZ_result_ok(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
static inline struct LDKOutPoint C2Tuple_OutPointScriptZ_get_a(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR tuple){
uint32_t __attribute__((visibility("default"))) TS_C2Tuple_OutPointScriptZ_get_a(uint32_t tuple) {
LDKC2Tuple_OutPointScriptZ* tuple_conv = (LDKC2Tuple_OutPointScriptZ*)(tuple & ~1);
LDKOutPoint ret_var = C2Tuple_OutPointScriptZ_get_a(tuple_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
uint32_tArray __attribute__((visibility("default"))) TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(uint32_t tuple) {
LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* tuple_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(tuple & ~1);
LDKCVec_C2Tuple_u32ScriptZZ ret_var = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(tuple_conv);
- uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t v = 0; v < ret_var.datalen; v++) {
LDKC2Tuple_u32ScriptZ* ret_conv_21_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ");
*ret_conv_21_conv = ret_var.data[v];
ret_arr_ptr[v] = ((uint64_t)ret_conv_21_conv);
}
+
FREE(ret_var.data);
return ret_arr;
}
return 0 /* LDKEvent - PaymentReceived */; (void) payment_hash_arr; (void) obj->payment_received.amt; (void) purpose_ref;
}
case LDKEvent_PaymentSent: {
+ int8_tArray payment_id_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(payment_id_arr + 4), obj->payment_sent.payment_id.data, 32);
int8_tArray payment_preimage_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(payment_preimage_arr + 4), obj->payment_sent.payment_preimage.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_sent.payment_hash.data, 32);
- return 0 /* LDKEvent - PaymentSent */; (void) payment_preimage_arr; (void) payment_hash_arr;
+ uint64_t fee_paid_msat_ref = ((uint64_t)&obj->payment_sent.fee_paid_msat) | 1;
+ return 0 /* LDKEvent - PaymentSent */; (void) payment_id_arr; (void) payment_preimage_arr; (void) payment_hash_arr; (void) fee_paid_msat_ref;
}
case LDKEvent_PaymentPathFailed: {
+ 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_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_path_failed.payment_hash.data, 32);
uint64_t network_update_ref = ((uint64_t)&obj->payment_path_failed.network_update) | 1;
LDKCVec_RouteHopZ path_var = obj->payment_path_failed.path;
- uint32_tArray path_arr = init_arr(path_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ 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.
- uint64_t path_conv_10_ref = (uint64_t)path_conv_10_var.inner & ~1;
+ path_conv_10_ref = (uint64_t)path_conv_10_var.inner & ~1;
path_arr_ptr[k] = path_conv_10_ref;
}
+
uint64_t short_channel_id_ref = ((uint64_t)&obj->payment_path_failed.short_channel_id) | 1;
- return 0 /* LDKEvent - PaymentPathFailed */; (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;
+ LDKRouteParameters retry_var = obj->payment_path_failed.retry;
+ uint64_t retry_ref = 0;
+ if ((uint64_t)retry_var.inner > 4096) {
+ CHECK((((uint64_t)retry_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&retry_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ retry_ref = (uint64_t)retry_var.inner & ~1;
+ }
+ 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_PendingHTLCsForwardable: {
return 0 /* LDKEvent - PendingHTLCsForwardable */; (void) obj->pending_htl_cs_forwardable.time_forwardable;
}
case LDKEvent_SpendableOutputs: {
LDKCVec_SpendableOutputDescriptorZ outputs_var = obj->spendable_outputs.outputs;
- uint32_tArray outputs_arr = init_arr(outputs_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray outputs_arr = NULL;
+ outputs_arr = init_arr(outputs_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *outputs_arr_ptr = (uint32_t*)(outputs_arr + 4);
for (size_t b = 0; b < outputs_var.datalen; b++) {
uint64_t outputs_conv_27_ref = ((uint64_t)&outputs_var.data[b]) | 1;
outputs_arr_ptr[b] = outputs_conv_27_ref;
}
+
return 0 /* LDKEvent - SpendableOutputs */; (void) outputs_arr;
}
case LDKEvent_PaymentForwarded: {
uint32_tArray __attribute__((visibility("default"))) TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(uint32_t tuple) {
LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* tuple_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(tuple & ~1);
LDKCVec_C2Tuple_u32TxOutZZ ret_var = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(tuple_conv);
- uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t u = 0; u < ret_var.datalen; u++) {
LDKC2Tuple_u32TxOutZ* ret_conv_20_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ");
*ret_conv_20_conv = ret_var.data[u];
ret_arr_ptr[u] = ((uint64_t)ret_conv_20_conv);
}
+
FREE(ret_var.data);
return ret_arr;
}
LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *val = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_NoneLightningErrorZ_result_ok(uint32_t arg) {
LDKCResult_NoneLightningErrorZ *val = (LDKCResult_NoneLightningErrorZ*)(arg & ~1);
CHECK(!val->result_ok);
LDKLightningError 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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
static inline struct LDKPublicKey C2Tuple_PublicKeyTypeZ_get_a(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR tuple){
}
uint32_t __attribute__((visibility("default"))) TS_C2Tuple_PublicKeyTypeZ_get_b(uint32_t tuple) {
LDKC2Tuple_PublicKeyTypeZ* tuple_conv = (LDKC2Tuple_PublicKeyTypeZ*)(tuple & ~1);
- LDKType* ret_ret =MALLOC(sizeof(LDKType), "LDKType");
+ LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType");
*ret_ret = C2Tuple_PublicKeyTypeZ_get_b(tuple_conv);
return (uint64_t)ret_ret;
}
LDKCResult_boolLightningErrorZ *val = (LDKCResult_boolLightningErrorZ*)(arg & ~1);
CHECK(!val->result_ok);
LDKLightningError 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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
static inline struct LDKChannelAnnouncement C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR tuple){
uint32_t __attribute__((visibility("default"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(uint32_t tuple) {
LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* tuple_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(tuple & ~1);
LDKChannelAnnouncement ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(tuple_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
uint32_t __attribute__((visibility("default"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(uint32_t tuple) {
LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* tuple_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(tuple & ~1);
LDKChannelUpdate ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(tuple_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
uint32_t __attribute__((visibility("default"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(uint32_t tuple) {
LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* tuple_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(tuple & ~1);
LDKChannelUpdate ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(tuple_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKCResult_CVec_u8ZPeerHandleErrorZ *val = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)(arg & ~1);
CHECK(!val->result_ok);
LDKPeerHandleError 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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_NonePeerHandleErrorZ_result_ok(uint32_t arg) {
LDKCResult_NonePeerHandleErrorZ *val = (LDKCResult_NonePeerHandleErrorZ*)(arg & ~1);
CHECK(!val->result_ok);
LDKPeerHandleError 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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_boolPeerHandleErrorZ_result_ok(uint32_t arg) {
LDKCResult_boolPeerHandleErrorZ *val = (LDKCResult_boolPeerHandleErrorZ*)(arg & ~1);
CHECK(!val->result_ok);
LDKPeerHandleError 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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_NodeIdDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_NodeIdDecodeErrorZ *val = (LDKCResult_NodeIdDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKNodeId 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NodeIdDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_NodeIdDecodeErrorZ *val = (LDKCResult_NodeIdDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
typedef struct LDKAccess_JCalls {
LDKCOption_AccessZ *obj = (LDKCOption_AccessZ*)(ptr & ~1);
switch(obj->tag) {
case LDKCOption_AccessZ_Some: {
- LDKAccess* some_ret =MALLOC(sizeof(LDKAccess), "LDKAccess");
+ LDKAccess* some_ret = MALLOC(sizeof(LDKAccess), "LDKAccess");
*some_ret = obj->some;
// Warning: We likely need to clone here, but no clone is available, so we just do it for Java instances
return 0 /* LDKCOption_AccessZ - Some */; (void) (uint64_t)some_ret;
LDKCResult_DirectionalChannelInfoDecodeErrorZ *val = (LDKCResult_DirectionalChannelInfoDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKDirectionalChannelInfo 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_DirectionalChannelInfoDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_DirectionalChannelInfoDecodeErrorZ *val = (LDKCResult_DirectionalChannelInfoDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_ChannelInfoDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_ChannelInfoDecodeErrorZ *val = (LDKCResult_ChannelInfoDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKChannelInfo 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelInfoDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_ChannelInfoDecodeErrorZ *val = (LDKCResult_ChannelInfoDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_RoutingFeesDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_RoutingFeesDecodeErrorZ *val = (LDKCResult_RoutingFeesDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKRoutingFees 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RoutingFeesDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_RoutingFeesDecodeErrorZ *val = (LDKCResult_RoutingFeesDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_NodeAnnouncementInfoDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_NodeAnnouncementInfoDecodeErrorZ *val = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKNodeAnnouncementInfo 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NodeAnnouncementInfoDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_NodeAnnouncementInfoDecodeErrorZ *val = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCVec_u64Z_new(int64_tArray elems) {
LDKCResult_NodeInfoDecodeErrorZ *val = (LDKCResult_NodeInfoDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKNodeInfo 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NodeInfoDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_NodeInfoDecodeErrorZ *val = (LDKCResult_NodeInfoDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_NetworkGraphDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_NetworkGraphDecodeErrorZ *val = (LDKCResult_NetworkGraphDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKNetworkGraph 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NetworkGraphDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_NetworkGraphDecodeErrorZ *val = (LDKCResult_NetworkGraphDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCOption_CVec_NetAddressZZ_ref_from_ptr(uint32_t ptr) {
switch(obj->tag) {
case LDKCOption_CVec_NetAddressZZ_Some: {
LDKCVec_NetAddressZ some_var = obj->some;
- uint32_tArray some_arr = init_arr(some_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray some_arr = NULL;
+ some_arr = init_arr(some_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *some_arr_ptr = (uint32_t*)(some_arr + 4);
for (size_t m = 0; m < some_var.datalen; m++) {
uint64_t some_conv_12_ref = ((uint64_t)&some_var.data[m]) | 1;
some_arr_ptr[m] = some_conv_12_ref;
}
+
return 0 /* LDKCOption_CVec_NetAddressZZ - Some */; (void) some_arr;
}
case LDKCOption_CVec_NetAddressZZ_None: {
default: abort();
}
}
-jboolean __attribute__((visibility("default"))) TS_LDKCResult_NetAddressu8Z_result_ok(uint32_t arg) {
- return ((LDKCResult_NetAddressu8Z*)arg)->result_ok;
-}
-uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NetAddressu8Z_get_ok(uint32_t arg) {
- LDKCResult_NetAddressu8Z *val = (LDKCResult_NetAddressu8Z*)(arg & ~1);
- CHECK(val->result_ok);
- uint64_t res_ref = ((uint64_t)&(*val->contents.result)) | 1;
- return res_ref;
-}
-int8_t __attribute__((visibility("default"))) TS_LDKCResult_NetAddressu8Z_get_err(uint32_t arg) {
- LDKCResult_NetAddressu8Z *val = (LDKCResult_NetAddressu8Z*)(arg & ~1);
- CHECK(!val->result_ok);
- return *val->contents.err;
-}
-jboolean __attribute__((visibility("default"))) TS_LDKCResult_CResult_NetAddressu8ZDecodeErrorZ_result_ok(uint32_t arg) {
- return ((LDKCResult_CResult_NetAddressu8ZDecodeErrorZ*)arg)->result_ok;
-}
-uint32_t __attribute__((visibility("default"))) TS_LDKCResult_CResult_NetAddressu8ZDecodeErrorZ_get_ok(uint32_t arg) {
- LDKCResult_CResult_NetAddressu8ZDecodeErrorZ *val = (LDKCResult_CResult_NetAddressu8ZDecodeErrorZ*)(arg & ~1);
- CHECK(val->result_ok);
- LDKCResult_NetAddressu8Z* res_conv = MALLOC(sizeof(LDKCResult_NetAddressu8Z), "LDKCResult_NetAddressu8Z");
- *res_conv = (*val->contents.result);
- *res_conv = CResult_NetAddressu8Z_clone(res_conv);
- return (uint64_t)res_conv;
-}
-uint32_t __attribute__((visibility("default"))) TS_LDKCResult_CResult_NetAddressu8ZDecodeErrorZ_get_err(uint32_t arg) {
- LDKCResult_CResult_NetAddressu8ZDecodeErrorZ *val = (LDKCResult_CResult_NetAddressu8ZDecodeErrorZ*)(arg & ~1);
- CHECK(!val->result_ok);
- LDKDecodeError err_var = (*val->contents.err);
- 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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
- return err_ref;
-}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_NetAddressDecodeErrorZ_result_ok(uint32_t arg) {
return ((LDKCResult_NetAddressDecodeErrorZ*)arg)->result_ok;
}
LDKCResult_NetAddressDecodeErrorZ *val = (LDKCResult_NetAddressDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCVec_UpdateAddHTLCZ_new(uint32_tArray elems) {
LDKCResult_AcceptChannelDecodeErrorZ *val = (LDKCResult_AcceptChannelDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKAcceptChannel 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_AcceptChannelDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_AcceptChannelDecodeErrorZ *val = (LDKCResult_AcceptChannelDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_AnnouncementSignaturesDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_AnnouncementSignaturesDecodeErrorZ *val = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKAnnouncementSignatures 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_AnnouncementSignaturesDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_AnnouncementSignaturesDecodeErrorZ *val = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_ChannelReestablishDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_ChannelReestablishDecodeErrorZ *val = (LDKCResult_ChannelReestablishDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKChannelReestablish 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelReestablishDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_ChannelReestablishDecodeErrorZ *val = (LDKCResult_ChannelReestablishDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_ClosingSignedDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_ClosingSignedDecodeErrorZ *val = (LDKCResult_ClosingSignedDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKClosingSigned 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ClosingSignedDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_ClosingSignedDecodeErrorZ *val = (LDKCResult_ClosingSignedDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_ClosingSignedFeeRangeDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *val = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKClosingSignedFeeRange 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *val = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_CommitmentSignedDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_CommitmentSignedDecodeErrorZ *val = (LDKCResult_CommitmentSignedDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKCommitmentSigned 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_CommitmentSignedDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_CommitmentSignedDecodeErrorZ *val = (LDKCResult_CommitmentSignedDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_FundingCreatedDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_FundingCreatedDecodeErrorZ *val = (LDKCResult_FundingCreatedDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKFundingCreated 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_FundingCreatedDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_FundingCreatedDecodeErrorZ *val = (LDKCResult_FundingCreatedDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_FundingSignedDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_FundingSignedDecodeErrorZ *val = (LDKCResult_FundingSignedDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKFundingSigned 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_FundingSignedDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_FundingSignedDecodeErrorZ *val = (LDKCResult_FundingSignedDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_FundingLockedDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_FundingLockedDecodeErrorZ *val = (LDKCResult_FundingLockedDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKFundingLocked 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_FundingLockedDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_FundingLockedDecodeErrorZ *val = (LDKCResult_FundingLockedDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_InitDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_InitDecodeErrorZ *val = (LDKCResult_InitDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKInit 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InitDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_InitDecodeErrorZ *val = (LDKCResult_InitDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_OpenChannelDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_OpenChannelDecodeErrorZ *val = (LDKCResult_OpenChannelDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKOpenChannel 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_OpenChannelDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_OpenChannelDecodeErrorZ *val = (LDKCResult_OpenChannelDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_RevokeAndACKDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_RevokeAndACKDecodeErrorZ *val = (LDKCResult_RevokeAndACKDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKRevokeAndACK 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RevokeAndACKDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_RevokeAndACKDecodeErrorZ *val = (LDKCResult_RevokeAndACKDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_ShutdownDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_ShutdownDecodeErrorZ *val = (LDKCResult_ShutdownDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKShutdown 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ShutdownDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_ShutdownDecodeErrorZ *val = (LDKCResult_ShutdownDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_UpdateFailHTLCDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_UpdateFailHTLCDecodeErrorZ *val = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKUpdateFailHTLC 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UpdateFailHTLCDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_UpdateFailHTLCDecodeErrorZ *val = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *val = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKUpdateFailMalformedHTLC 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *val = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_UpdateFeeDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_UpdateFeeDecodeErrorZ *val = (LDKCResult_UpdateFeeDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKUpdateFee 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UpdateFeeDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_UpdateFeeDecodeErrorZ *val = (LDKCResult_UpdateFeeDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_UpdateFulfillHTLCDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_UpdateFulfillHTLCDecodeErrorZ *val = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKUpdateFulfillHTLC 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UpdateFulfillHTLCDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_UpdateFulfillHTLCDecodeErrorZ *val = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_UpdateAddHTLCDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_UpdateAddHTLCDecodeErrorZ *val = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKUpdateAddHTLC 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UpdateAddHTLCDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_UpdateAddHTLCDecodeErrorZ *val = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_PingDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_PingDecodeErrorZ *val = (LDKCResult_PingDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKPing 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PingDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_PingDecodeErrorZ *val = (LDKCResult_PingDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_PongDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_PongDecodeErrorZ *val = (LDKCResult_PongDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKPong 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PongDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_PongDecodeErrorZ *val = (LDKCResult_PongDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *val = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKUnsignedChannelAnnouncement 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *val = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_ChannelAnnouncementDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_ChannelAnnouncementDecodeErrorZ *val = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKChannelAnnouncement 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelAnnouncementDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_ChannelAnnouncementDecodeErrorZ *val = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_UnsignedChannelUpdateDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_UnsignedChannelUpdateDecodeErrorZ *val = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKUnsignedChannelUpdate 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UnsignedChannelUpdateDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_UnsignedChannelUpdateDecodeErrorZ *val = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_ChannelUpdateDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_ChannelUpdateDecodeErrorZ *val = (LDKCResult_ChannelUpdateDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKChannelUpdate 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelUpdateDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_ChannelUpdateDecodeErrorZ *val = (LDKCResult_ChannelUpdateDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_ErrorMessageDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_ErrorMessageDecodeErrorZ *val = (LDKCResult_ErrorMessageDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKErrorMessage 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ErrorMessageDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_ErrorMessageDecodeErrorZ *val = (LDKCResult_ErrorMessageDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *val = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKUnsignedNodeAnnouncement 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *val = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_NodeAnnouncementDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_NodeAnnouncementDecodeErrorZ *val = (LDKCResult_NodeAnnouncementDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKNodeAnnouncement 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NodeAnnouncementDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_NodeAnnouncementDecodeErrorZ *val = (LDKCResult_NodeAnnouncementDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_QueryShortChannelIdsDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_QueryShortChannelIdsDecodeErrorZ *val = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKQueryShortChannelIds 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_QueryShortChannelIdsDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_QueryShortChannelIdsDecodeErrorZ *val = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *val = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKReplyShortChannelIdsEnd 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *val = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_QueryChannelRangeDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_QueryChannelRangeDecodeErrorZ *val = (LDKCResult_QueryChannelRangeDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKQueryChannelRange 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_QueryChannelRangeDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_QueryChannelRangeDecodeErrorZ *val = (LDKCResult_QueryChannelRangeDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_ReplyChannelRangeDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_ReplyChannelRangeDecodeErrorZ *val = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKReplyChannelRange 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ReplyChannelRangeDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_ReplyChannelRangeDecodeErrorZ *val = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_GossipTimestampFilterDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_GossipTimestampFilterDecodeErrorZ *val = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKGossipTimestampFilter 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_GossipTimestampFilterDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_GossipTimestampFilterDecodeErrorZ *val = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKSignOrCreationError_ref_from_ptr(uint32_t ptr) {
LDKCResult_InvoiceSignOrCreationErrorZ *val = (LDKCResult_InvoiceSignOrCreationErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKInvoice 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InvoiceSignOrCreationErrorZ_get_err(uint32_t arg) {
LDKCOption_C2Tuple_usizeTransactionZZ register_output_LDKFilter_jcall(const void* this_arg, LDKWatchedOutput output) {
LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
LDKWatchedOutput output_var = output;
+ uint64_t output_ref = 0;
CHECK((((uint64_t)output_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&output_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t output_ref = (uint64_t)output_var.inner;
+ output_ref = (uint64_t)output_var.inner;
if (output_var.is_owned) {
output_ref |= 1;
}
LDKCOption_FilterZ *obj = (LDKCOption_FilterZ*)(ptr & ~1);
switch(obj->tag) {
case LDKCOption_FilterZ_Some: {
- LDKFilter* some_ret =MALLOC(sizeof(LDKFilter), "LDKFilter");
+ LDKFilter* some_ret = MALLOC(sizeof(LDKFilter), "LDKFilter");
*some_ret = obj->some;
// Warning: We likely need to clone here, but no clone is available, so we just do it for Java instances
return 0 /* LDKCOption_FilterZ - Some */; (void) (uint64_t)some_ret;
LDKCResult_LockedChannelMonitorNoneZ *val = (LDKCResult_LockedChannelMonitorNoneZ*)(arg & ~1);
CHECK(val->result_ok);
LDKLockedChannelMonitor 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
void __attribute__((visibility("default"))) TS_LDKCResult_LockedChannelMonitorNoneZ_get_err(uint32_t arg) {
if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
LDKMessageSendEventsProvider* this_arg_conv = (LDKMessageSendEventsProvider*)this_arg_ptr;
LDKCVec_MessageSendEventZ ret_var = (this_arg_conv->get_and_clear_pending_msg_events)(this_arg_conv->this_arg);
- uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t s = 0; s < ret_var.datalen; s++) {
LDKMessageSendEvent *ret_conv_18_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
uint64_t ret_conv_18_ref = (uint64_t)ret_conv_18_copy;
ret_arr_ptr[s] = ret_conv_18_ref;
}
+
FREE(ret_var.data);
return ret_arr;
}
}
void process_pending_events_LDKEventsProvider_jcall(const void* this_arg, LDKEventHandler handler) {
LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
- LDKEventHandler* handler_ret =MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
+ LDKEventHandler* handler_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
*handler_ret = handler;
js_invoke_function_1(j_calls->process_pending_events_meth, (uint64_t)handler_ret);
}
int8_tArray header_arr = init_arr(80, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(header_arr + 4), *header, 80);
LDKCVec_C2Tuple_usizeTransactionZZ txdata_var = txdata;
- uint32_tArray txdata_arr = init_arr(txdata_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray txdata_arr = NULL;
+ txdata_arr = init_arr(txdata_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *txdata_arr_ptr = (uint32_t*)(txdata_arr + 4);
for (size_t c = 0; c < txdata_var.datalen; c++) {
LDKC2Tuple_usizeTransactionZ* txdata_conv_28_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
*txdata_conv_28_conv = txdata_var.data[c];
txdata_arr_ptr[c] = ((uint64_t)txdata_conv_28_conv);
}
+
FREE(txdata_var.data);
js_invoke_function_3(j_calls->transactions_confirmed_meth, header_arr, txdata_arr, height);
}
if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
LDKCVec_TxidZ ret_var = (this_arg_conv->get_relevant_txids)(this_arg_conv->this_arg);
- ptrArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native ptrArray Bytes");
+ ptrArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native ptrArray Bytes");
int8_tArray *ret_arr_ptr = (int8_tArray*)(ret_arr + 4);
for (size_t m = 0; m < ret_var.datalen; m++) {
int8_tArray ret_conv_12_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(ret_conv_12_arr + 4), ret_var.data[m].data, 32);
ret_arr_ptr[m] = ret_conv_12_arr;
}
+
FREE(ret_var.data);
return ret_arr;
}
FREE(j_calls);
}
}
-LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint id, const LDKChannelMonitor * data) {
+LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) {
LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg;
- LDKOutPoint id_var = id;
- CHECK((((uint64_t)id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
- CHECK((((uint64_t)&id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t id_ref = (uint64_t)id_var.inner;
- if (id_var.is_owned) {
- id_ref |= 1;
+ LDKOutPoint channel_id_var = channel_id;
+ uint64_t channel_id_ref = 0;
+ CHECK((((uint64_t)channel_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&channel_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ channel_id_ref = (uint64_t)channel_id_var.inner;
+ if (channel_id_var.is_owned) {
+ channel_id_ref |= 1;
}
LDKChannelMonitor data_var = *data;
+ uint64_t data_ref = 0;
data_var = ChannelMonitor_clone(data);
CHECK((((uint64_t)data_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&data_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t data_ref = (uint64_t)data_var.inner;
+ data_ref = (uint64_t)data_var.inner;
if (data_var.is_owned) {
data_ref |= 1;
}
- uint32_t ret = js_invoke_function_2(j_calls->persist_new_channel_meth, id_ref, data_ref);
+ LDKMonitorUpdateId update_id_var = update_id;
+ uint64_t update_id_ref = 0;
+ CHECK((((uint64_t)update_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&update_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ update_id_ref = (uint64_t)update_id_var.inner;
+ if (update_id_var.is_owned) {
+ update_id_ref |= 1;
+ }
+ uint32_t ret = js_invoke_function_3(j_calls->persist_new_channel_meth, channel_id_ref, data_ref, update_id_ref);
void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
-LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint id, const LDKChannelMonitorUpdate * update, const LDKChannelMonitor * data) {
+LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, const LDKChannelMonitorUpdate * update, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) {
LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg;
- LDKOutPoint id_var = id;
- CHECK((((uint64_t)id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
- CHECK((((uint64_t)&id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t id_ref = (uint64_t)id_var.inner;
- if (id_var.is_owned) {
- id_ref |= 1;
+ LDKOutPoint channel_id_var = channel_id;
+ uint64_t channel_id_ref = 0;
+ CHECK((((uint64_t)channel_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&channel_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ channel_id_ref = (uint64_t)channel_id_var.inner;
+ if (channel_id_var.is_owned) {
+ channel_id_ref |= 1;
}
LDKChannelMonitorUpdate update_var = *update;
- update_var = ChannelMonitorUpdate_clone(update);
- CHECK((((uint64_t)update_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
- CHECK((((uint64_t)&update_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t update_ref = (uint64_t)update_var.inner;
- if (update_var.is_owned) {
- update_ref |= 1;
+ uint64_t update_ref = 0;
+ if ((uint64_t)update_var.inner > 4096) {
+ update_var = ChannelMonitorUpdate_clone(update);
+ CHECK((((uint64_t)update_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&update_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ update_ref = (uint64_t)update_var.inner;
+ if (update_var.is_owned) {
+ update_ref |= 1;
+ }
}
LDKChannelMonitor data_var = *data;
+ uint64_t data_ref = 0;
data_var = ChannelMonitor_clone(data);
CHECK((((uint64_t)data_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&data_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t data_ref = (uint64_t)data_var.inner;
+ data_ref = (uint64_t)data_var.inner;
if (data_var.is_owned) {
data_ref |= 1;
}
- uint32_t ret = js_invoke_function_3(j_calls->update_persisted_channel_meth, id_ref, update_ref, data_ref);
+ LDKMonitorUpdateId update_id_var = update_id;
+ uint64_t update_id_ref = 0;
+ CHECK((((uint64_t)update_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&update_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ update_id_ref = (uint64_t)update_id_var.inner;
+ if (update_id_var.is_owned) {
+ update_id_ref |= 1;
+ }
+ uint32_t ret = js_invoke_function_4(j_calls->update_persisted_channel_meth, channel_id_ref, update_ref, data_ref, update_id_ref);
void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
*res_ptr = LDKPersist_init(o);
return (long)res_ptr;
}
-uint32_t __attribute__((visibility("default"))) TS_Persist_persist_new_channel(uint32_t this_arg, uint32_t id, uint32_t data) {
+uint32_t __attribute__((visibility("default"))) TS_Persist_persist_new_channel(uint32_t this_arg, uint32_t channel_id, uint32_t data, uint32_t update_id) {
void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr;
- LDKOutPoint id_conv;
- id_conv.inner = (void*)(id & (~1));
- id_conv.is_owned = (id & 1) || (id == 0);
- id_conv = OutPoint_clone(&id_conv);
+ LDKOutPoint channel_id_conv;
+ channel_id_conv.inner = (void*)(channel_id & (~1));
+ channel_id_conv.is_owned = (channel_id & 1) || (channel_id == 0);
+ channel_id_conv = OutPoint_clone(&channel_id_conv);
LDKChannelMonitor data_conv;
data_conv.inner = (void*)(data & (~1));
data_conv.is_owned = false;
+ LDKMonitorUpdateId update_id_conv;
+ update_id_conv.inner = (void*)(update_id & (~1));
+ update_id_conv.is_owned = (update_id & 1) || (update_id == 0);
+ update_id_conv = MonitorUpdateId_clone(&update_id_conv);
LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
- *ret_conv = (this_arg_conv->persist_new_channel)(this_arg_conv->this_arg, id_conv, &data_conv);
+ *ret_conv = (this_arg_conv->persist_new_channel)(this_arg_conv->this_arg, channel_id_conv, &data_conv, update_id_conv);
return (uint64_t)ret_conv;
}
-uint32_t __attribute__((visibility("default"))) TS_Persist_update_persisted_channel(uint32_t this_arg, uint32_t id, uint32_t update, uint32_t data) {
+uint32_t __attribute__((visibility("default"))) TS_Persist_update_persisted_channel(uint32_t this_arg, uint32_t channel_id, uint32_t update, uint32_t data, uint32_t update_id) {
void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr;
- LDKOutPoint id_conv;
- id_conv.inner = (void*)(id & (~1));
- id_conv.is_owned = (id & 1) || (id == 0);
- id_conv = OutPoint_clone(&id_conv);
+ LDKOutPoint channel_id_conv;
+ channel_id_conv.inner = (void*)(channel_id & (~1));
+ channel_id_conv.is_owned = (channel_id & 1) || (channel_id == 0);
+ channel_id_conv = OutPoint_clone(&channel_id_conv);
LDKChannelMonitorUpdate update_conv;
update_conv.inner = (void*)(update & (~1));
update_conv.is_owned = false;
LDKChannelMonitor data_conv;
data_conv.inner = (void*)(data & (~1));
data_conv.is_owned = false;
+ LDKMonitorUpdateId update_id_conv;
+ update_id_conv.inner = (void*)(update_id & (~1));
+ update_id_conv.is_owned = (update_id & 1) || (update_id == 0);
+ update_id_conv = MonitorUpdateId_clone(&update_id_conv);
LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
- *ret_conv = (this_arg_conv->update_persisted_channel)(this_arg_conv->this_arg, id_conv, &update_conv, &data_conv);
+ *ret_conv = (this_arg_conv->update_persisted_channel)(this_arg_conv->this_arg, channel_id_conv, &update_conv, &data_conv, update_id_conv);
return (uint64_t)ret_conv;
}
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
LDKInitFeatures their_features_var = their_features;
+ uint64_t their_features_ref = 0;
CHECK((((uint64_t)their_features_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&their_features_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t their_features_ref = (uint64_t)their_features_var.inner;
+ their_features_ref = (uint64_t)their_features_var.inner;
if (their_features_var.is_owned) {
their_features_ref |= 1;
}
LDKOpenChannel msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = OpenChannel_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
LDKInitFeatures their_features_var = their_features;
+ uint64_t their_features_ref = 0;
CHECK((((uint64_t)their_features_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&their_features_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t their_features_ref = (uint64_t)their_features_var.inner;
+ their_features_ref = (uint64_t)their_features_var.inner;
if (their_features_var.is_owned) {
their_features_ref |= 1;
}
LDKAcceptChannel msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = AcceptChannel_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
LDKFundingCreated msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = FundingCreated_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
LDKFundingSigned msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = FundingSigned_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
LDKFundingLocked msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = FundingLocked_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
LDKInitFeatures their_features_var = *their_features;
+ uint64_t their_features_ref = 0;
their_features_var = InitFeatures_clone(their_features);
CHECK((((uint64_t)their_features_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&their_features_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t their_features_ref = (uint64_t)their_features_var.inner;
+ their_features_ref = (uint64_t)their_features_var.inner;
if (their_features_var.is_owned) {
their_features_ref |= 1;
}
LDKShutdown msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = Shutdown_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
LDKClosingSigned msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = ClosingSigned_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
LDKUpdateAddHTLC msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = UpdateAddHTLC_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
LDKUpdateFulfillHTLC msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = UpdateFulfillHTLC_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
LDKUpdateFailHTLC msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = UpdateFailHTLC_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
LDKUpdateFailMalformedHTLC msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = UpdateFailMalformedHTLC_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
LDKCommitmentSigned msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = CommitmentSigned_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
LDKRevokeAndACK msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = RevokeAndACK_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
LDKUpdateFee msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = UpdateFee_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
LDKAnnouncementSignatures msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = AnnouncementSignatures_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
LDKInit msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = Init_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
LDKChannelReestablish msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = ChannelReestablish_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
LDKChannelUpdate msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = ChannelUpdate_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
LDKErrorMessage msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = ErrorMessage_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
LDKCResult_boolLightningErrorZ handle_node_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKNodeAnnouncement * msg) {
LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
LDKNodeAnnouncement msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = NodeAnnouncement_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
LDKCResult_boolLightningErrorZ handle_channel_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKChannelAnnouncement * msg) {
LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
LDKChannelAnnouncement msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = ChannelAnnouncement_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
LDKCResult_boolLightningErrorZ handle_channel_update_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKChannelUpdate * msg) {
LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
LDKChannelUpdate msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = ChannelUpdate_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
LDKInit init_var = *init;
+ uint64_t init_ref = 0;
init_var = Init_clone(init);
CHECK((((uint64_t)init_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&init_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t init_ref = (uint64_t)init_var.inner;
+ init_ref = (uint64_t)init_var.inner;
if (init_var.is_owned) {
init_ref |= 1;
}
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
LDKReplyChannelRange msg_var = msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
LDKReplyShortChannelIdsEnd msg_var = msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
LDKQueryChannelRange msg_var = msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
LDKQueryShortChannelIds msg_var = msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret_var = (this_arg_conv->get_next_channel_announcements)(this_arg_conv->this_arg, starting_point, batch_amount);
- uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t h = 0; h < ret_var.datalen; h++) {
LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv_59_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
*ret_conv_59_conv = ret_var.data[h];
ret_arr_ptr[h] = ((uint64_t)ret_conv_59_conv);
}
+
FREE(ret_var.data);
return ret_arr;
}
CHECK(*((uint32_t*)starting_point) == 33);
memcpy(starting_point_ref.compressed_form, (uint8_t*)(starting_point + 4), 33);
LDKCVec_NodeAnnouncementZ ret_var = (this_arg_conv->get_next_node_announcements)(this_arg_conv->this_arg, starting_point_ref, batch_amount);
- uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t s = 0; s < ret_var.datalen; s++) {
LDKNodeAnnouncement ret_conv_18_var = ret_var.data[s];
+ uint64_t ret_conv_18_ref = 0;
CHECK((((uint64_t)ret_conv_18_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_conv_18_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t ret_conv_18_ref = (uint64_t)ret_conv_18_var.inner;
+ ret_conv_18_ref = (uint64_t)ret_conv_18_var.inner;
if (ret_conv_18_var.is_owned) {
ret_conv_18_ref |= 1;
}
ret_arr_ptr[s] = ret_conv_18_ref;
}
+
FREE(ret_var.data);
return ret_arr;
}
}
LDKCResult_NoneLightningErrorZ handle_custom_message_LDKCustomMessageHandler_jcall(const void* this_arg, LDKType msg, LDKPublicKey sender_node_id) {
LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) this_arg;
- LDKType* msg_ret =MALLOC(sizeof(LDKType), "LDKType");
+ LDKType* msg_ret = MALLOC(sizeof(LDKType), "LDKType");
*msg_ret = msg;
int8_tArray sender_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(sender_node_id_arr + 4), sender_node_id.compressed_form, 33);
if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
LDKCustomMessageHandler* this_arg_conv = (LDKCustomMessageHandler*)this_arg_ptr;
LDKCVec_C2Tuple_PublicKeyTypeZZ ret_var = (this_arg_conv->get_and_clear_pending_msg)(this_arg_conv->this_arg);
- uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t z = 0; z < ret_var.datalen; z++) {
LDKC2Tuple_PublicKeyTypeZ* ret_conv_25_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ");
*ret_conv_25_conv = ret_var.data[z];
ret_arr_ptr[z] = ((uint64_t)ret_conv_25_conv);
}
+
FREE(ret_var.data);
return ret_arr;
}
typedef struct LDKScore_JCalls {
atomic_size_t refcnt;
uint32_t channel_penalty_msat_meth;
+ uint32_t payment_path_failed_meth;
+ uint32_t write_meth;
} LDKScore_JCalls;
static void LDKScore_JCalls_free(void* this_arg) {
LDKScore_JCalls *j_calls = (LDKScore_JCalls*) 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->write_meth);
FREE(j_calls);
}
}
-uint64_t channel_penalty_msat_LDKScore_jcall(const void* this_arg, uint64_t short_channel_id) {
+uint64_t channel_penalty_msat_LDKScore_jcall(const void* this_arg, uint64_t short_channel_id, const LDKNodeId * source, const LDKNodeId * target) {
+ LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
+ LDKNodeId source_var = *source;
+ uint64_t source_ref = 0;
+ source_var = NodeId_clone(source);
+ CHECK((((uint64_t)source_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&source_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ source_ref = (uint64_t)source_var.inner;
+ if (source_var.is_owned) {
+ source_ref |= 1;
+ }
+ LDKNodeId target_var = *target;
+ uint64_t target_ref = 0;
+ target_var = NodeId_clone(target);
+ CHECK((((uint64_t)target_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&target_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ target_ref = (uint64_t)target_var.inner;
+ 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);
+}
+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;
+ 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.
+ 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_2(j_calls->payment_path_failed_meth, path_arr, short_channel_id);
+}
+LDKCVec_u8Z write_LDKScore_jcall(const void* this_arg) {
LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
- return js_invoke_function_1(j_calls->channel_penalty_msat_meth, short_channel_id);
+ int8_tArray ret = js_invoke_function_0(j_calls->write_meth);
+ LDKCVec_u8Z ret_ref;
+ ret_ref.datalen = *((uint32_t*)ret);
+ ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
+ memcpy(ret_ref.data, (uint8_t*)(ret + 4), ret_ref.datalen);
+ return ret_ref;
}
static void LDKScore_JCalls_cloned(LDKScore* new_obj) {
LDKScore_JCalls *j_calls = (LDKScore_JCalls*) new_obj->this_arg;
LDKScore ret = {
.this_arg = (void*) calls,
.channel_penalty_msat = channel_penalty_msat_LDKScore_jcall,
+ .payment_path_failed = payment_path_failed_LDKScore_jcall,
+ .write = write_LDKScore_jcall,
.free = LDKScore_JCalls_free,
};
return ret;
*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) {
+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) {
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;
- int64_t ret_val = (this_arg_conv->channel_penalty_msat)(this_arg_conv->this_arg, short_channel_id);
+ LDKNodeId source_conv;
+ source_conv.inner = (void*)(source & (~1));
+ source_conv.is_owned = false;
+ LDKNodeId target_conv;
+ target_conv.inner = (void*)(target & (~1));
+ target_conv.is_owned = false;
+ int64_t ret_val = (this_arg_conv->channel_penalty_msat)(this_arg_conv->this_arg, short_channel_id, &source_conv, &target_conv);
return ret_val;
}
+void __attribute__((visibility("default"))) TS_Score_payment_path_failed(uint32_t this_arg, uint32_tArray path, int64_t short_channel_id) {
+ 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);
+ path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
+ path_constr.data[k] = path_conv_10_conv;
+ }
+ (this_arg_conv->payment_path_failed)(this_arg_conv->this_arg, path_constr, short_channel_id);
+}
+
+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); }
+ LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
+ LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
+ 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;
+}
+
typedef struct LDKChannelManagerPersister_JCalls {
atomic_size_t refcnt;
uint32_t persist_manager_meth;
LDKCResult_NoneErrorZ persist_manager_LDKChannelManagerPersister_jcall(const void* this_arg, const LDKChannelManager * channel_manager) {
LDKChannelManagerPersister_JCalls *j_calls = (LDKChannelManagerPersister_JCalls*) this_arg;
LDKChannelManager channel_manager_var = *channel_manager;
+ uint64_t channel_manager_ref = 0;
// Warning: we may need a move here but no clone is available for LDKChannelManager
CHECK((((uint64_t)channel_manager_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&channel_manager_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t channel_manager_ref = (uint64_t)channel_manager_var.inner;
+ channel_manager_ref = (uint64_t)channel_manager_var.inner;
if (channel_manager_var.is_owned) {
channel_manager_ref |= 1;
}
default: abort();
}
}
-jstring __attribute__((visibility("default"))) TS__ldk_get_compiled_version() {
+typedef struct LDKPayer_JCalls {
+ atomic_size_t refcnt;
+ uint32_t node_id_meth;
+ uint32_t first_hops_meth;
+ uint32_t send_payment_meth;
+ uint32_t retry_payment_meth;
+} LDKPayer_JCalls;
+static void LDKPayer_JCalls_free(void* this_arg) {
+ LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
+ if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
+ 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->retry_payment_meth);
+ FREE(j_calls);
+ }
+}
+LDKPublicKey node_id_LDKPayer_jcall(const void* this_arg) {
+ LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
+ int8_tArray ret = js_invoke_function_0(j_calls->node_id_meth);
+ LDKPublicKey ret_ref;
+ CHECK(*((uint32_t*)ret) == 33);
+ memcpy(ret_ref.compressed_form, (uint8_t*)(ret + 4), 33);
+ return ret_ref;
+}
+LDKCVec_ChannelDetailsZ first_hops_LDKPayer_jcall(const void* this_arg) {
+ LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
+ uint32_tArray ret = js_invoke_function_0(j_calls->first_hops_meth);
+ LDKCVec_ChannelDetailsZ ret_constr;
+ ret_constr.datalen = *((uint32_t*)ret);
+ if (ret_constr.datalen > 0)
+ ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
+ else
+ ret_constr.data = NULL;
+ uint32_t* ret_vals = (uint32_t*)(ret + 4);
+ for (size_t q = 0; q < ret_constr.datalen; q++) {
+ uint32_t ret_conv_16 = ret_vals[q];
+ LDKChannelDetails ret_conv_16_conv;
+ ret_conv_16_conv.inner = (void*)(ret_conv_16 & (~1));
+ ret_conv_16_conv.is_owned = (ret_conv_16 & 1) || (ret_conv_16 == 0);
+ ret_conv_16_conv = ChannelDetails_clone(&ret_conv_16_conv);
+ ret_constr.data[q] = ret_conv_16_conv;
+ }
+ return ret_constr;
+}
+LDKCResult_PaymentIdPaymentSendFailureZ send_payment_LDKPayer_jcall(const void* this_arg, const LDKRoute * route, LDKThirtyTwoBytes payment_hash, LDKThirtyTwoBytes payment_secret) {
+ 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.
+ route_ref = (uint64_t)route_var.inner;
+ if (route_var.is_owned) {
+ route_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.data, 32);
+ int8_tArray payment_secret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(payment_secret_arr + 4), payment_secret.data, 32);
+ uint32_t ret = js_invoke_function_3(j_calls->send_payment_meth, route_ref, payment_hash_arr, payment_secret_arr);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_PaymentIdPaymentSendFailureZ ret_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(ret_ptr);
+ ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone((LDKCResult_PaymentIdPaymentSendFailureZ*)(((uint64_t)ret) & ~1));
+ 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;
+ 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.
+ route_ref = (uint64_t)route_var.inner;
+ if (route_var.is_owned) {
+ route_ref |= 1;
+ }
+ 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);
+ uint32_t ret = js_invoke_function_2(j_calls->retry_payment_meth, route_ref, payment_id_arr);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NonePaymentSendFailureZ ret_conv = *(LDKCResult_NonePaymentSendFailureZ*)(ret_ptr);
+ ret_conv = CResult_NonePaymentSendFailureZ_clone((LDKCResult_NonePaymentSendFailureZ*)(((uint64_t)ret) & ~1));
+ return ret_conv;
+}
+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);
+}
+static inline LDKPayer LDKPayer_init (/*TODO: JS Object Reference */void* o) {
+ LDKPayer_JCalls *calls = MALLOC(sizeof(LDKPayer_JCalls), "LDKPayer_JCalls");
+ atomic_init(&calls->refcnt, 1);
+ //TODO: Assign calls->o from o
+
+ LDKPayer ret = {
+ .this_arg = (void*) calls,
+ .node_id = node_id_LDKPayer_jcall,
+ .first_hops = first_hops_LDKPayer_jcall,
+ .send_payment = send_payment_LDKPayer_jcall,
+ .retry_payment = retry_payment_LDKPayer_jcall,
+ .free = LDKPayer_JCalls_free,
+ };
+ return ret;
+}
+long __attribute__((visibility("default"))) TS_LDKPayer_new(/*TODO: JS Object Reference */void* o) {
+ LDKPayer *res_ptr = MALLOC(sizeof(LDKPayer), "LDKPayer");
+ *res_ptr = LDKPayer_init(o);
+ return (long)res_ptr;
+}
+int8_tArray __attribute__((visibility("default"))) TS_Payer_node_id(uint32_t this_arg) {
+ 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;
+ int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), (this_arg_conv->node_id)(this_arg_conv->this_arg).compressed_form, 33);
+ return ret_arr;
+}
+
+uint32_tArray __attribute__((visibility("default"))) TS_Payer_first_hops(uint32_t this_arg) {
+ 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;
+ LDKCVec_ChannelDetailsZ ret_var = (this_arg_conv->first_hops)(this_arg_conv->this_arg);
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
+ for (size_t q = 0; q < ret_var.datalen; q++) {
+ LDKChannelDetails ret_conv_16_var = ret_var.data[q];
+ uint64_t ret_conv_16_ref = 0;
+ CHECK((((uint64_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner;
+ if (ret_conv_16_var.is_owned) {
+ ret_conv_16_ref |= 1;
+ }
+ ret_arr_ptr[q] = ret_conv_16_ref;
+ }
+
+ FREE(ret_var.data);
+ return ret_arr;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_Payer_send_payment(uint32_t this_arg, uint32_t route, int8_tArray payment_hash, int8_tArray payment_secret) {
+ 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;
+ 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_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
+ *ret_conv = (this_arg_conv->send_payment)(this_arg_conv->this_arg, &route_conv, payment_hash_ref, payment_secret_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); }
+ LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
+ LDKRoute route_conv;
+ route_conv.inner = (void*)(route & (~1));
+ route_conv.is_owned = false;
+ LDKThirtyTwoBytes payment_id_ref;
+ CHECK(*((uint32_t*)payment_id) == 32);
+ memcpy(payment_id_ref.data, (uint8_t*)(payment_id + 4), 32);
+ LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
+ *ret_conv = (this_arg_conv->retry_payment)(this_arg_conv->this_arg, &route_conv, payment_id_ref);
+ return (uint64_t)ret_conv;
+}
+
+typedef struct LDKRouter_JCalls {
+ atomic_size_t refcnt;
+ uint32_t find_route_meth;
+} LDKRouter_JCalls;
+static void LDKRouter_JCalls_free(void* this_arg) {
+ LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg;
+ if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
+ js_free(j_calls->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) {
+ 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);
+ LDKRouteParameters params_var = *params;
+ uint64_t params_ref = 0;
+ params_var = RouteParameters_clone(params);
+ CHECK((((uint64_t)params_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)¶ms_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ params_ref = (uint64_t)params_var.inner;
+ if (params_var.is_owned) {
+ params_ref |= 1;
+ }
+ LDKCVec_ChannelDetailsZ *first_hops_var_ptr = first_hops;
+ uint32_tArray first_hops_arr = NULL;
+ if (first_hops != NULL) {
+ LDKCVec_ChannelDetailsZ first_hops_var = *first_hops_var_ptr;
+ first_hops_arr = init_arr(first_hops_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_t *first_hops_arr_ptr = (uint32_t*)(first_hops_arr + 4);
+ for (size_t q = 0; q < first_hops_var.datalen; q++) {
+ LDKChannelDetails first_hops_conv_16_var = first_hops_var.data[q];
+ uint64_t first_hops_conv_16_ref = 0;
+ CHECK((((uint64_t)first_hops_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&first_hops_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ first_hops_conv_16_ref = (uint64_t)first_hops_conv_16_var.inner;
+ if (first_hops_conv_16_var.is_owned) {
+ first_hops_conv_16_ref |= 1;
+ }
+ first_hops_arr_ptr[q] = first_hops_conv_16_ref;
+ }
+
+ }
+ // 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);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_RouteLightningErrorZ ret_conv = *(LDKCResult_RouteLightningErrorZ*)(ret_ptr);
+ ret_conv = CResult_RouteLightningErrorZ_clone((LDKCResult_RouteLightningErrorZ*)(((uint64_t)ret) & ~1));
+ return ret_conv;
+}
+static void LDKRouter_JCalls_cloned(LDKRouter* new_obj) {
+ LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) new_obj->this_arg;
+ atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
+}
+static inline LDKRouter LDKRouter_init (/*TODO: JS Object Reference */void* o) {
+ LDKRouter_JCalls *calls = MALLOC(sizeof(LDKRouter_JCalls), "LDKRouter_JCalls");
+ atomic_init(&calls->refcnt, 1);
+ //TODO: Assign calls->o from o
+
+ LDKRouter ret = {
+ .this_arg = (void*) calls,
+ .find_route = find_route_LDKRouter_jcall,
+ .free = LDKRouter_JCalls_free,
+ };
+ return ret;
+}
+long __attribute__((visibility("default"))) TS_LDKRouter_new(/*TODO: JS Object Reference */void* o) {
+ LDKRouter *res_ptr = MALLOC(sizeof(LDKRouter), "LDKRouter");
+ *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) {
+ 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;
+ LDKPublicKey payer_ref;
+ CHECK(*((uint32_t*)payer) == 33);
+ memcpy(payer_ref.compressed_form, (uint8_t*)(payer + 4), 33);
+ LDKRouteParameters params_conv;
+ params_conv.inner = (void*)(params & (~1));
+ params_conv.is_owned = false;
+ LDKCVec_ChannelDetailsZ first_hops_constr;
+ LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL;
+ if (first_hops != 0) {
+ first_hops_constr.datalen = *((uint32_t*)first_hops);
+ if (first_hops_constr.datalen > 0)
+ first_hops_constr.data = MALLOC(first_hops_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
+ else
+ first_hops_constr.data = NULL;
+ uint32_t* first_hops_vals = (uint32_t*)(first_hops + 4);
+ for (size_t q = 0; q < first_hops_constr.datalen; q++) {
+ uint32_t first_hops_conv_16 = first_hops_vals[q];
+ LDKChannelDetails first_hops_conv_16_conv;
+ first_hops_conv_16_conv.inner = (void*)(first_hops_conv_16 & (~1));
+ first_hops_conv_16_conv.is_owned = (first_hops_conv_16 & 1) || (first_hops_conv_16 == 0);
+ first_hops_constr.data[q] = first_hops_conv_16_conv;
+ }
+ first_hops_ptr = &first_hops_constr;
+ }
+ void* scorer_ptr = (void*)(((uint64_t)scorer) & ~1);
+ 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);
+ if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
+ return (uint64_t)ret_conv;
+}
+
+jstring __attribute__((visibility("default"))) TS__ldk_get_compiled_version() {
LDKStr ret_str = _ldk_get_compiled_version();
jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
Str_free(ret_str);
return (uint64_t)ret_conv;
}
+uint32_t __attribute__((visibility("default"))) TS_CResult_RouteParametersDecodeErrorZ_ok(uint32_t o) {
+ LDKRouteParameters o_conv;
+ o_conv.inner = (void*)(o & (~1));
+ o_conv.is_owned = (o & 1) || (o == 0);
+ o_conv = RouteParameters_clone(&o_conv);
+ LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
+ *ret_conv = CResult_RouteParametersDecodeErrorZ_ok(o_conv);
+ return (uint64_t)ret_conv;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_CResult_RouteParametersDecodeErrorZ_err(uint32_t e) {
+ LDKDecodeError e_conv;
+ e_conv.inner = (void*)(e & (~1));
+ e_conv.is_owned = (e & 1) || (e == 0);
+ e_conv = DecodeError_clone(&e_conv);
+ LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
+ *ret_conv = CResult_RouteParametersDecodeErrorZ_err(e_conv);
+ return (uint64_t)ret_conv;
+}
+
+void __attribute__((visibility("default"))) TS_CResult_RouteParametersDecodeErrorZ_free(uint32_t _res) {
+ if ((_res & 1) != 0) return;
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_RouteParametersDecodeErrorZ _res_conv = *(LDKCResult_RouteParametersDecodeErrorZ*)(_res_ptr);
+ FREE((void*)_res);
+ CResult_RouteParametersDecodeErrorZ_free(_res_conv);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_CResult_RouteParametersDecodeErrorZ_clone(uint32_t orig) {
+ LDKCResult_RouteParametersDecodeErrorZ* orig_conv = (LDKCResult_RouteParametersDecodeErrorZ*)(orig & ~1);
+ LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
+ *ret_conv = CResult_RouteParametersDecodeErrorZ_clone(orig_conv);
+ return (uint64_t)ret_conv;
+}
+
+void __attribute__((visibility("default"))) TS_CVec_RouteHintZ_free(uint32_tArray _res) {
+ LDKCVec_RouteHintZ _res_constr;
+ _res_constr.datalen = *((uint32_t*)_res);
+ if (_res_constr.datalen > 0)
+ _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
+ else
+ _res_constr.data = NULL;
+ uint32_t* _res_vals = (uint32_t*)(_res + 4);
+ for (size_t l = 0; l < _res_constr.datalen; l++) {
+ uint32_t _res_conv_11 = _res_vals[l];
+ LDKRouteHint _res_conv_11_conv;
+ _res_conv_11_conv.inner = (void*)(_res_conv_11 & (~1));
+ _res_conv_11_conv.is_owned = (_res_conv_11 & 1) || (_res_conv_11 == 0);
+ _res_constr.data[l] = _res_conv_11_conv;
+ }
+ CVec_RouteHintZ_free(_res_constr);
+}
+
uint32_t __attribute__((visibility("default"))) TS_COption_u64Z_some(int64_t o) {
LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
*ret_copy = COption_u64Z_some(o);
return ret_ref;
}
-void __attribute__((visibility("default"))) TS_CVec_ChannelDetailsZ_free(uint32_tArray _res) {
- LDKCVec_ChannelDetailsZ _res_constr;
- _res_constr.datalen = *((uint32_t*)_res);
- if (_res_constr.datalen > 0)
- _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
- else
- _res_constr.data = NULL;
- uint32_t* _res_vals = (uint32_t*)(_res + 4);
- for (size_t q = 0; q < _res_constr.datalen; q++) {
- uint32_t _res_conv_16 = _res_vals[q];
- LDKChannelDetails _res_conv_16_conv;
- _res_conv_16_conv.inner = (void*)(_res_conv_16 & (~1));
- _res_conv_16_conv.is_owned = (_res_conv_16 & 1) || (_res_conv_16 == 0);
- _res_constr.data[q] = _res_conv_16_conv;
- }
- CVec_ChannelDetailsZ_free(_res_constr);
+uint32_t __attribute__((visibility("default"))) TS_CResult_PayeeDecodeErrorZ_ok(uint32_t o) {
+ LDKPayee o_conv;
+ o_conv.inner = (void*)(o & (~1));
+ o_conv.is_owned = (o & 1) || (o == 0);
+ o_conv = Payee_clone(&o_conv);
+ LDKCResult_PayeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeeDecodeErrorZ), "LDKCResult_PayeeDecodeErrorZ");
+ *ret_conv = CResult_PayeeDecodeErrorZ_ok(o_conv);
+ return (uint64_t)ret_conv;
}
-void __attribute__((visibility("default"))) TS_CVec_RouteHintZ_free(uint32_tArray _res) {
- LDKCVec_RouteHintZ _res_constr;
+uint32_t __attribute__((visibility("default"))) TS_CResult_PayeeDecodeErrorZ_err(uint32_t e) {
+ LDKDecodeError e_conv;
+ e_conv.inner = (void*)(e & (~1));
+ e_conv.is_owned = (e & 1) || (e == 0);
+ e_conv = DecodeError_clone(&e_conv);
+ LDKCResult_PayeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeeDecodeErrorZ), "LDKCResult_PayeeDecodeErrorZ");
+ *ret_conv = CResult_PayeeDecodeErrorZ_err(e_conv);
+ return (uint64_t)ret_conv;
+}
+
+void __attribute__((visibility("default"))) TS_CResult_PayeeDecodeErrorZ_free(uint32_t _res) {
+ if ((_res & 1) != 0) return;
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_PayeeDecodeErrorZ _res_conv = *(LDKCResult_PayeeDecodeErrorZ*)(_res_ptr);
+ FREE((void*)_res);
+ CResult_PayeeDecodeErrorZ_free(_res_conv);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_CResult_PayeeDecodeErrorZ_clone(uint32_t orig) {
+ LDKCResult_PayeeDecodeErrorZ* orig_conv = (LDKCResult_PayeeDecodeErrorZ*)(orig & ~1);
+ LDKCResult_PayeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeeDecodeErrorZ), "LDKCResult_PayeeDecodeErrorZ");
+ *ret_conv = CResult_PayeeDecodeErrorZ_clone(orig_conv);
+ return (uint64_t)ret_conv;
+}
+
+void __attribute__((visibility("default"))) TS_CVec_RouteHintHopZ_free(uint32_tArray _res) {
+ LDKCVec_RouteHintHopZ _res_constr;
_res_constr.datalen = *((uint32_t*)_res);
if (_res_constr.datalen > 0)
- _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
+ _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements");
else
_res_constr.data = NULL;
uint32_t* _res_vals = (uint32_t*)(_res + 4);
- for (size_t l = 0; l < _res_constr.datalen; l++) {
- uint32_t _res_conv_11 = _res_vals[l];
- LDKRouteHint _res_conv_11_conv;
- _res_conv_11_conv.inner = (void*)(_res_conv_11 & (~1));
- _res_conv_11_conv.is_owned = (_res_conv_11 & 1) || (_res_conv_11 == 0);
- _res_constr.data[l] = _res_conv_11_conv;
+ for (size_t o = 0; o < _res_constr.datalen; o++) {
+ uint32_t _res_conv_14 = _res_vals[o];
+ LDKRouteHintHop _res_conv_14_conv;
+ _res_conv_14_conv.inner = (void*)(_res_conv_14 & (~1));
+ _res_conv_14_conv.is_owned = (_res_conv_14 & 1) || (_res_conv_14 == 0);
+ _res_constr.data[o] = _res_conv_14_conv;
}
- CVec_RouteHintZ_free(_res_constr);
+ CVec_RouteHintHopZ_free(_res_constr);
}
-uint32_t __attribute__((visibility("default"))) TS_CResult_RouteLightningErrorZ_ok(uint32_t o) {
- LDKRoute o_conv;
+uint32_t __attribute__((visibility("default"))) TS_CResult_RouteHintDecodeErrorZ_ok(uint32_t o) {
+ LDKRouteHint o_conv;
o_conv.inner = (void*)(o & (~1));
o_conv.is_owned = (o & 1) || (o == 0);
- o_conv = Route_clone(&o_conv);
- LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
- *ret_conv = CResult_RouteLightningErrorZ_ok(o_conv);
+ o_conv = RouteHint_clone(&o_conv);
+ LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
+ *ret_conv = CResult_RouteHintDecodeErrorZ_ok(o_conv);
return (uint64_t)ret_conv;
}
-uint32_t __attribute__((visibility("default"))) TS_CResult_RouteLightningErrorZ_err(uint32_t e) {
- LDKLightningError e_conv;
+uint32_t __attribute__((visibility("default"))) TS_CResult_RouteHintDecodeErrorZ_err(uint32_t e) {
+ LDKDecodeError e_conv;
e_conv.inner = (void*)(e & (~1));
e_conv.is_owned = (e & 1) || (e == 0);
- e_conv = LightningError_clone(&e_conv);
- LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
- *ret_conv = CResult_RouteLightningErrorZ_err(e_conv);
+ e_conv = DecodeError_clone(&e_conv);
+ LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
+ *ret_conv = CResult_RouteHintDecodeErrorZ_err(e_conv);
return (uint64_t)ret_conv;
}
-void __attribute__((visibility("default"))) TS_CResult_RouteLightningErrorZ_free(uint32_t _res) {
+void __attribute__((visibility("default"))) TS_CResult_RouteHintDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
CHECK_ACCESS(_res_ptr);
- LDKCResult_RouteLightningErrorZ _res_conv = *(LDKCResult_RouteLightningErrorZ*)(_res_ptr);
+ LDKCResult_RouteHintDecodeErrorZ _res_conv = *(LDKCResult_RouteHintDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
- CResult_RouteLightningErrorZ_free(_res_conv);
+ CResult_RouteHintDecodeErrorZ_free(_res_conv);
}
-uint32_t __attribute__((visibility("default"))) TS_CResult_RouteLightningErrorZ_clone(uint32_t orig) {
- LDKCResult_RouteLightningErrorZ* orig_conv = (LDKCResult_RouteLightningErrorZ*)(orig & ~1);
- LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
- *ret_conv = CResult_RouteLightningErrorZ_clone(orig_conv);
+uint32_t __attribute__((visibility("default"))) TS_CResult_RouteHintDecodeErrorZ_clone(uint32_t orig) {
+ LDKCResult_RouteHintDecodeErrorZ* orig_conv = (LDKCResult_RouteHintDecodeErrorZ*)(orig & ~1);
+ LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
+ *ret_conv = CResult_RouteHintDecodeErrorZ_clone(orig_conv);
return (uint64_t)ret_conv;
}
-uint32_t __attribute__((visibility("default"))) TS_CResult_TxOutAccessErrorZ_ok(uint32_t o) {
- void* o_ptr = (void*)(((uint64_t)o) & ~1);
- CHECK_ACCESS(o_ptr);
- LDKTxOut o_conv = *(LDKTxOut*)(o_ptr);
- o_conv = TxOut_clone((LDKTxOut*)(((uint64_t)o) & ~1));
- LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
- *ret_conv = CResult_TxOutAccessErrorZ_ok(o_conv);
- return (uint64_t)ret_conv;
-}
+uint32_t __attribute__((visibility("default"))) TS_CResult_RouteHintHopDecodeErrorZ_ok(uint32_t o) {
+ LDKRouteHintHop o_conv;
+ o_conv.inner = (void*)(o & (~1));
+ o_conv.is_owned = (o & 1) || (o == 0);
+ o_conv = RouteHintHop_clone(&o_conv);
+ LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
+ *ret_conv = CResult_RouteHintHopDecodeErrorZ_ok(o_conv);
+ return (uint64_t)ret_conv;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_CResult_RouteHintHopDecodeErrorZ_err(uint32_t e) {
+ LDKDecodeError e_conv;
+ e_conv.inner = (void*)(e & (~1));
+ e_conv.is_owned = (e & 1) || (e == 0);
+ e_conv = DecodeError_clone(&e_conv);
+ LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
+ *ret_conv = CResult_RouteHintHopDecodeErrorZ_err(e_conv);
+ return (uint64_t)ret_conv;
+}
+
+void __attribute__((visibility("default"))) TS_CResult_RouteHintHopDecodeErrorZ_free(uint32_t _res) {
+ if ((_res & 1) != 0) return;
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_RouteHintHopDecodeErrorZ _res_conv = *(LDKCResult_RouteHintHopDecodeErrorZ*)(_res_ptr);
+ FREE((void*)_res);
+ CResult_RouteHintHopDecodeErrorZ_free(_res_conv);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_CResult_RouteHintHopDecodeErrorZ_clone(uint32_t orig) {
+ LDKCResult_RouteHintHopDecodeErrorZ* orig_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)(orig & ~1);
+ LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
+ *ret_conv = CResult_RouteHintHopDecodeErrorZ_clone(orig_conv);
+ return (uint64_t)ret_conv;
+}
+
+void __attribute__((visibility("default"))) TS_CVec_ChannelDetailsZ_free(uint32_tArray _res) {
+ LDKCVec_ChannelDetailsZ _res_constr;
+ _res_constr.datalen = *((uint32_t*)_res);
+ if (_res_constr.datalen > 0)
+ _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
+ else
+ _res_constr.data = NULL;
+ uint32_t* _res_vals = (uint32_t*)(_res + 4);
+ for (size_t q = 0; q < _res_constr.datalen; q++) {
+ uint32_t _res_conv_16 = _res_vals[q];
+ LDKChannelDetails _res_conv_16_conv;
+ _res_conv_16_conv.inner = (void*)(_res_conv_16 & (~1));
+ _res_conv_16_conv.is_owned = (_res_conv_16 & 1) || (_res_conv_16 == 0);
+ _res_constr.data[q] = _res_conv_16_conv;
+ }
+ CVec_ChannelDetailsZ_free(_res_constr);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_CResult_RouteLightningErrorZ_ok(uint32_t o) {
+ LDKRoute o_conv;
+ o_conv.inner = (void*)(o & (~1));
+ o_conv.is_owned = (o & 1) || (o == 0);
+ o_conv = Route_clone(&o_conv);
+ LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
+ *ret_conv = CResult_RouteLightningErrorZ_ok(o_conv);
+ return (uint64_t)ret_conv;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_CResult_RouteLightningErrorZ_err(uint32_t e) {
+ LDKLightningError e_conv;
+ e_conv.inner = (void*)(e & (~1));
+ e_conv.is_owned = (e & 1) || (e == 0);
+ e_conv = LightningError_clone(&e_conv);
+ LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
+ *ret_conv = CResult_RouteLightningErrorZ_err(e_conv);
+ return (uint64_t)ret_conv;
+}
+
+void __attribute__((visibility("default"))) TS_CResult_RouteLightningErrorZ_free(uint32_t _res) {
+ if ((_res & 1) != 0) return;
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_RouteLightningErrorZ _res_conv = *(LDKCResult_RouteLightningErrorZ*)(_res_ptr);
+ FREE((void*)_res);
+ CResult_RouteLightningErrorZ_free(_res_conv);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_CResult_RouteLightningErrorZ_clone(uint32_t orig) {
+ LDKCResult_RouteLightningErrorZ* orig_conv = (LDKCResult_RouteLightningErrorZ*)(orig & ~1);
+ LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
+ *ret_conv = CResult_RouteLightningErrorZ_clone(orig_conv);
+ return (uint64_t)ret_conv;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_CResult_TxOutAccessErrorZ_ok(uint32_t o) {
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKTxOut o_conv = *(LDKTxOut*)(o_ptr);
+ o_conv = TxOut_clone((LDKTxOut*)(((uint64_t)o) & ~1));
+ LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
+ *ret_conv = CResult_TxOutAccessErrorZ_ok(o_conv);
+ return (uint64_t)ret_conv;
+}
uint32_t __attribute__((visibility("default"))) TS_CResult_TxOutAccessErrorZ_err(uint32_t e) {
LDKAccessError e_conv = LDKAccessError_from_js(e);
CResult_InvoiceFeaturesDecodeErrorZ_free(_res_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);
+ // 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_ScoringParametersDecodeErrorZ_err(uint32_t e) {
+ LDKDecodeError e_conv;
+ e_conv.inner = (void*)(e & (~1));
+ e_conv.is_owned = (e & 1) || (e == 0);
+ e_conv = DecodeError_clone(&e_conv);
+ LDKCResult_ScoringParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScoringParametersDecodeErrorZ), "LDKCResult_ScoringParametersDecodeErrorZ");
+ *ret_conv = CResult_ScoringParametersDecodeErrorZ_err(e_conv);
+ return (uint64_t)ret_conv;
+}
+
+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_ScoringParametersDecodeErrorZ _res_conv = *(LDKCResult_ScoringParametersDecodeErrorZ*)(_res_ptr);
+ FREE((void*)_res);
+ CResult_ScoringParametersDecodeErrorZ_free(_res_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);
+ // 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_ScorerDecodeErrorZ_err(uint32_t e) {
+ LDKDecodeError e_conv;
+ e_conv.inner = (void*)(e & (~1));
+ e_conv.is_owned = (e & 1) || (e == 0);
+ e_conv = DecodeError_clone(&e_conv);
+ LDKCResult_ScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScorerDecodeErrorZ), "LDKCResult_ScorerDecodeErrorZ");
+ *ret_conv = CResult_ScorerDecodeErrorZ_err(e_conv);
+ return (uint64_t)ret_conv;
+}
+
+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_ScorerDecodeErrorZ _res_conv = *(LDKCResult_ScorerDecodeErrorZ*)(_res_ptr);
+ FREE((void*)_res);
+ CResult_ScorerDecodeErrorZ_free(_res_conv);
+}
+
uint32_t __attribute__((visibility("default"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(uint32_t o) {
LDKDelayedPaymentOutputDescriptor o_conv;
o_conv.inner = (void*)(o & (~1));
return (uint64_t)ret_conv;
}
-uint32_t __attribute__((visibility("default"))) TS_CResult_PaymentIdDecodeErrorZ_ok(uint32_t o) {
- LDKPaymentId o_conv;
- o_conv.inner = (void*)(o & (~1));
- o_conv.is_owned = (o & 1) || (o == 0);
- o_conv = PaymentId_clone(&o_conv);
- LDKCResult_PaymentIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdDecodeErrorZ), "LDKCResult_PaymentIdDecodeErrorZ");
- *ret_conv = CResult_PaymentIdDecodeErrorZ_ok(o_conv);
- return (uint64_t)ret_conv;
-}
-
-uint32_t __attribute__((visibility("default"))) TS_CResult_PaymentIdDecodeErrorZ_err(uint32_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = (void*)(e & (~1));
- e_conv.is_owned = (e & 1) || (e == 0);
- e_conv = DecodeError_clone(&e_conv);
- LDKCResult_PaymentIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdDecodeErrorZ), "LDKCResult_PaymentIdDecodeErrorZ");
- *ret_conv = CResult_PaymentIdDecodeErrorZ_err(e_conv);
- return (uint64_t)ret_conv;
-}
-
-void __attribute__((visibility("default"))) TS_CResult_PaymentIdDecodeErrorZ_free(uint32_t _res) {
- if ((_res & 1) != 0) return;
- void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
- CHECK_ACCESS(_res_ptr);
- LDKCResult_PaymentIdDecodeErrorZ _res_conv = *(LDKCResult_PaymentIdDecodeErrorZ*)(_res_ptr);
- FREE((void*)_res);
- CResult_PaymentIdDecodeErrorZ_free(_res_conv);
-}
-
-uint32_t __attribute__((visibility("default"))) TS_CResult_PaymentIdDecodeErrorZ_clone(uint32_t orig) {
- LDKCResult_PaymentIdDecodeErrorZ* orig_conv = (LDKCResult_PaymentIdDecodeErrorZ*)(orig & ~1);
- LDKCResult_PaymentIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdDecodeErrorZ), "LDKCResult_PaymentIdDecodeErrorZ");
- *ret_conv = CResult_PaymentIdDecodeErrorZ_clone(orig_conv);
- return (uint64_t)ret_conv;
-}
-
uint32_t __attribute__((visibility("default"))) TS_COption_u16Z_some(int16_t o) {
LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z");
*ret_copy = COption_u16Z_some(o);
return (uint64_t)ret_conv;
}
-uint32_t __attribute__((visibility("default"))) TS_CResult_PaymentIdPaymentSendFailureZ_ok(uint32_t o) {
- LDKPaymentId o_conv;
- o_conv.inner = (void*)(o & (~1));
- o_conv.is_owned = (o & 1) || (o == 0);
- o_conv = PaymentId_clone(&o_conv);
+uint32_t __attribute__((visibility("default"))) TS_CResult_PaymentIdPaymentSendFailureZ_ok(int8_tArray o) {
+ LDKThirtyTwoBytes o_ref;
+ CHECK(*((uint32_t*)o) == 32);
+ memcpy(o_ref.data, (uint8_t*)(o + 4), 32);
LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
- *ret_conv = CResult_PaymentIdPaymentSendFailureZ_ok(o_conv);
+ *ret_conv = CResult_PaymentIdPaymentSendFailureZ_ok(o_ref);
return (uint64_t)ret_conv;
}
return ((uint64_t)ret_conv);
}
-uint32_t __attribute__((visibility("default"))) TS_C2Tuple_PaymentHashPaymentIdZ_new(int8_tArray a, uint32_t b) {
+uint32_t __attribute__((visibility("default"))) TS_C2Tuple_PaymentHashPaymentIdZ_new(int8_tArray a, int8_tArray b) {
LDKThirtyTwoBytes a_ref;
CHECK(*((uint32_t*)a) == 32);
memcpy(a_ref.data, (uint8_t*)(a + 4), 32);
- LDKPaymentId b_conv;
- b_conv.inner = (void*)(b & (~1));
- b_conv.is_owned = (b & 1) || (b == 0);
- b_conv = PaymentId_clone(&b_conv);
+ LDKThirtyTwoBytes b_ref;
+ CHECK(*((uint32_t*)b) == 32);
+ memcpy(b_ref.data, (uint8_t*)(b + 4), 32);
LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ");
- *ret_conv = C2Tuple_PaymentHashPaymentIdZ_new(a_ref, b_conv);
+ *ret_conv = C2Tuple_PaymentHashPaymentIdZ_new(a_ref, b_ref);
return ((uint64_t)ret_conv);
}
return (uint64_t)ret_conv;
}
+uint32_t __attribute__((visibility("default"))) TS_CResult_PaymentIdPaymentErrorZ_ok(int8_tArray o) {
+ LDKThirtyTwoBytes o_ref;
+ CHECK(*((uint32_t*)o) == 32);
+ memcpy(o_ref.data, (uint8_t*)(o + 4), 32);
+ LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
+ *ret_conv = CResult_PaymentIdPaymentErrorZ_ok(o_ref);
+ return (uint64_t)ret_conv;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_CResult_PaymentIdPaymentErrorZ_err(uint32_t e) {
+ void* e_ptr = (void*)(((uint64_t)e) & ~1);
+ CHECK_ACCESS(e_ptr);
+ LDKPaymentError e_conv = *(LDKPaymentError*)(e_ptr);
+ e_conv = PaymentError_clone((LDKPaymentError*)(((uint64_t)e) & ~1));
+ LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
+ *ret_conv = CResult_PaymentIdPaymentErrorZ_err(e_conv);
+ return (uint64_t)ret_conv;
+}
+
+void __attribute__((visibility("default"))) TS_CResult_PaymentIdPaymentErrorZ_free(uint32_t _res) {
+ if ((_res & 1) != 0) return;
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_PaymentIdPaymentErrorZ _res_conv = *(LDKCResult_PaymentIdPaymentErrorZ*)(_res_ptr);
+ FREE((void*)_res);
+ CResult_PaymentIdPaymentErrorZ_free(_res_conv);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_CResult_PaymentIdPaymentErrorZ_clone(uint32_t orig) {
+ LDKCResult_PaymentIdPaymentErrorZ* orig_conv = (LDKCResult_PaymentIdPaymentErrorZ*)(orig & ~1);
+ LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
+ *ret_conv = CResult_PaymentIdPaymentErrorZ_clone(orig_conv);
+ return (uint64_t)ret_conv;
+}
+
uint32_t __attribute__((visibility("default"))) TS_CResult_SiPrefixNoneZ_ok(uint32_t o) {
LDKSiPrefix o_conv = LDKSiPrefix_from_js(o);
LDKCResult_SiPrefixNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixNoneZ), "LDKCResult_SiPrefixNoneZ");
return ret_ref;
}
-uint32_t __attribute__((visibility("default"))) TS_CResult_NetAddressu8Z_ok(uint32_t o) {
- void* o_ptr = (void*)(((uint64_t)o) & ~1);
- CHECK_ACCESS(o_ptr);
- LDKNetAddress o_conv = *(LDKNetAddress*)(o_ptr);
- o_conv = NetAddress_clone((LDKNetAddress*)(((uint64_t)o) & ~1));
- LDKCResult_NetAddressu8Z* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressu8Z), "LDKCResult_NetAddressu8Z");
- *ret_conv = CResult_NetAddressu8Z_ok(o_conv);
- return (uint64_t)ret_conv;
-}
-
-uint32_t __attribute__((visibility("default"))) TS_CResult_NetAddressu8Z_err(int8_t e) {
- LDKCResult_NetAddressu8Z* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressu8Z), "LDKCResult_NetAddressu8Z");
- *ret_conv = CResult_NetAddressu8Z_err(e);
- return (uint64_t)ret_conv;
-}
-
-void __attribute__((visibility("default"))) TS_CResult_NetAddressu8Z_free(uint32_t _res) {
- if ((_res & 1) != 0) return;
- void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
- CHECK_ACCESS(_res_ptr);
- LDKCResult_NetAddressu8Z _res_conv = *(LDKCResult_NetAddressu8Z*)(_res_ptr);
- FREE((void*)_res);
- CResult_NetAddressu8Z_free(_res_conv);
-}
-
-uint32_t __attribute__((visibility("default"))) TS_CResult_NetAddressu8Z_clone(uint32_t orig) {
- LDKCResult_NetAddressu8Z* orig_conv = (LDKCResult_NetAddressu8Z*)(orig & ~1);
- LDKCResult_NetAddressu8Z* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressu8Z), "LDKCResult_NetAddressu8Z");
- *ret_conv = CResult_NetAddressu8Z_clone(orig_conv);
- return (uint64_t)ret_conv;
-}
-
-uint32_t __attribute__((visibility("default"))) TS_CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(uint32_t o) {
- void* o_ptr = (void*)(((uint64_t)o) & ~1);
- CHECK_ACCESS(o_ptr);
- LDKCResult_NetAddressu8Z o_conv = *(LDKCResult_NetAddressu8Z*)(o_ptr);
- o_conv = CResult_NetAddressu8Z_clone((LDKCResult_NetAddressu8Z*)(((uint64_t)o) & ~1));
- LDKCResult_CResult_NetAddressu8ZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CResult_NetAddressu8ZDecodeErrorZ), "LDKCResult_CResult_NetAddressu8ZDecodeErrorZ");
- *ret_conv = CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(o_conv);
- return (uint64_t)ret_conv;
-}
-
-uint32_t __attribute__((visibility("default"))) TS_CResult_CResult_NetAddressu8ZDecodeErrorZ_err(uint32_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = (void*)(e & (~1));
- e_conv.is_owned = (e & 1) || (e == 0);
- e_conv = DecodeError_clone(&e_conv);
- LDKCResult_CResult_NetAddressu8ZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CResult_NetAddressu8ZDecodeErrorZ), "LDKCResult_CResult_NetAddressu8ZDecodeErrorZ");
- *ret_conv = CResult_CResult_NetAddressu8ZDecodeErrorZ_err(e_conv);
- return (uint64_t)ret_conv;
-}
-
-void __attribute__((visibility("default"))) TS_CResult_CResult_NetAddressu8ZDecodeErrorZ_free(uint32_t _res) {
- if ((_res & 1) != 0) return;
- void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
- CHECK_ACCESS(_res_ptr);
- LDKCResult_CResult_NetAddressu8ZDecodeErrorZ _res_conv = *(LDKCResult_CResult_NetAddressu8ZDecodeErrorZ*)(_res_ptr);
- FREE((void*)_res);
- CResult_CResult_NetAddressu8ZDecodeErrorZ_free(_res_conv);
-}
-
-uint32_t __attribute__((visibility("default"))) TS_CResult_CResult_NetAddressu8ZDecodeErrorZ_clone(uint32_t orig) {
- LDKCResult_CResult_NetAddressu8ZDecodeErrorZ* orig_conv = (LDKCResult_CResult_NetAddressu8ZDecodeErrorZ*)(orig & ~1);
- LDKCResult_CResult_NetAddressu8ZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CResult_NetAddressu8ZDecodeErrorZ), "LDKCResult_CResult_NetAddressu8ZDecodeErrorZ");
- *ret_conv = CResult_CResult_NetAddressu8ZDecodeErrorZ_clone(orig_conv);
- return (uint64_t)ret_conv;
-}
-
uint32_t __attribute__((visibility("default"))) TS_CResult_NetAddressDecodeErrorZ_ok(uint32_t o) {
void* o_ptr = (void*)(((uint64_t)o) & ~1);
CHECK_ACCESS(o_ptr);
return ret_ref;
}
-uint32_t __attribute__((visibility("default"))) TS_Event_payment_sent(int8_tArray payment_preimage, int8_tArray payment_hash) {
+uint32_t __attribute__((visibility("default"))) TS_Event_payment_sent(int8_tArray payment_id, int8_tArray payment_preimage, int8_tArray payment_hash, uint32_t fee_paid_msat) {
+ LDKThirtyTwoBytes payment_id_ref;
+ CHECK(*((uint32_t*)payment_id) == 32);
+ memcpy(payment_id_ref.data, (uint8_t*)(payment_id + 4), 32);
LDKThirtyTwoBytes payment_preimage_ref;
CHECK(*((uint32_t*)payment_preimage) == 32);
memcpy(payment_preimage_ref.data, (uint8_t*)(payment_preimage + 4), 32);
LDKThirtyTwoBytes payment_hash_ref;
CHECK(*((uint32_t*)payment_hash) == 32);
memcpy(payment_hash_ref.data, (uint8_t*)(payment_hash + 4), 32);
+ void* fee_paid_msat_ptr = (void*)(((uint64_t)fee_paid_msat) & ~1);
+ CHECK_ACCESS(fee_paid_msat_ptr);
+ LDKCOption_u64Z fee_paid_msat_conv = *(LDKCOption_u64Z*)(fee_paid_msat_ptr);
+ fee_paid_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)fee_paid_msat) & ~1));
LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
- *ret_copy = Event_payment_sent(payment_preimage_ref, payment_hash_ref);
+ *ret_copy = Event_payment_sent(payment_id_ref, payment_preimage_ref, payment_hash_ref, fee_paid_msat_conv);
uint64_t ret_ref = (uint64_t)ret_copy;
return ret_ref;
}
-uint32_t __attribute__((visibility("default"))) TS_Event_payment_path_failed(int8_tArray payment_hash, jboolean rejected_by_dest, uint32_t network_update, jboolean all_paths_failed, uint32_tArray path, uint32_t short_channel_id) {
+uint32_t __attribute__((visibility("default"))) TS_Event_payment_path_failed(int8_tArray payment_id, int8_tArray payment_hash, jboolean rejected_by_dest, uint32_t network_update, jboolean all_paths_failed, uint32_tArray path, uint32_t short_channel_id, uint32_t retry) {
+ 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);
CHECK_ACCESS(short_channel_id_ptr);
LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(short_channel_id_ptr);
short_channel_id_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)short_channel_id) & ~1));
+ LDKRouteParameters retry_conv;
+ retry_conv.inner = (void*)(retry & (~1));
+ retry_conv.is_owned = (retry & 1) || (retry == 0);
+ retry_conv = RouteParameters_clone(&retry_conv);
LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
- *ret_copy = Event_payment_path_failed(payment_hash_ref, rejected_by_dest, network_update_conv, all_paths_failed, path_constr, short_channel_id_conv);
+ *ret_copy = Event_payment_path_failed(payment_id_ref, payment_hash_ref, rejected_by_dest, network_update_conv, all_paths_failed, path_constr, short_channel_id_conv, retry_conv);
uint64_t ret_ref = (uint64_t)ret_copy;
return ret_ref;
}
uint32_t __attribute__((visibility("default"))) TS_ChannelHandshakeConfig_new(int32_t minimum_depth_arg, int16_t our_to_self_delay_arg, int64_t our_htlc_minimum_msat_arg) {
LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
uint32_t __attribute__((visibility("default"))) TS_ChannelHandshakeConfig_default() {
LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_default();
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
uint32_t __attribute__((visibility("default"))) TS_ChannelHandshakeLimits_new(int64_t min_funding_satoshis_arg, int64_t max_htlc_minimum_msat_arg, int64_t min_max_htlc_value_in_flight_msat_arg, int64_t max_channel_reserve_satoshis_arg, int16_t min_max_accepted_htlcs_arg, int32_t max_minimum_depth_arg, jboolean force_announced_channel_preference_arg, int16_t their_to_self_delay_arg) {
LDKChannelHandshakeLimits ret_var = 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);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
uint32_t __attribute__((visibility("default"))) TS_ChannelHandshakeLimits_default() {
LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_default();
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
uint32_t __attribute__((visibility("default"))) TS_ChannelConfig_new(int32_t forwarding_fee_proportional_millionths_arg, int32_t forwarding_fee_base_msat_arg, int16_t cltv_expiry_delta_arg, jboolean announced_channel_arg, jboolean commit_upfront_shutdown_pubkey_arg, int64_t max_dust_htlc_exposure_msat_arg, int64_t force_close_avoidance_max_fee_satoshis_arg) {
LDKChannelConfig ret_var = 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);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelConfig ret_var = ChannelConfig_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
uint32_t __attribute__((visibility("default"))) TS_ChannelConfig_default() {
LDKChannelConfig ret_var = ChannelConfig_default();
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKChannelHandshakeConfig ret_var = UserConfig_get_own_channel_config(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKChannelHandshakeLimits ret_var = UserConfig_get_peer_channel_config_limits(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKChannelConfig ret_var = UserConfig_get_channel_options(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
channel_options_arg_conv.is_owned = (channel_options_arg & 1) || (channel_options_arg == 0);
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);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKUserConfig ret_var = UserConfig_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
uint32_t __attribute__((visibility("default"))) TS_UserConfig_default() {
LDKUserConfig ret_var = UserConfig_default();
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKBestBlock ret_var = BestBlock_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
uint32_t __attribute__((visibility("default"))) TS_BestBlock_from_genesis(uint32_t network) {
LDKNetwork network_conv = LDKNetwork_from_js(network);
LDKBestBlock ret_var = BestBlock_from_genesis(network_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK(*((uint32_t*)block_hash) == 32);
memcpy(block_hash_ref.data, (uint8_t*)(block_hash + 4), 32);
LDKBestBlock ret_var = BestBlock_new(block_hash_ref, height);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKOutPoint ret_var = WatchedOutput_get_outpoint(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
script_pubkey_arg_ref.data = MALLOC(script_pubkey_arg_ref.datalen, "LDKCVec_u8Z Bytes");
memcpy(script_pubkey_arg_ref.data, (uint8_t*)(script_pubkey_arg + 4), script_pubkey_arg_ref.datalen);
LDKWatchedOutput ret_var = WatchedOutput_new(block_hash_arg_ref, outpoint_arg_conv, script_pubkey_arg_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKWatchedOutput ret_var = WatchedOutput_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
FeeEstimator_free(this_ptr_conv);
}
+void __attribute__((visibility("default"))) TS_MonitorUpdateId_free(uint32_t this_obj) {
+ LDKMonitorUpdateId this_obj_conv;
+ this_obj_conv.inner = (void*)(this_obj & (~1));
+ this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+ MonitorUpdateId_free(this_obj_conv);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_MonitorUpdateId_clone(uint32_t orig) {
+ LDKMonitorUpdateId orig_conv;
+ orig_conv.inner = (void*)(orig & (~1));
+ orig_conv.is_owned = false;
+ LDKMonitorUpdateId ret_var = MonitorUpdateId_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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
+int64_t __attribute__((visibility("default"))) TS_MonitorUpdateId_hash(uint32_t o) {
+ LDKMonitorUpdateId o_conv;
+ o_conv.inner = (void*)(o & (~1));
+ o_conv.is_owned = false;
+ int64_t ret_val = MonitorUpdateId_hash(&o_conv);
+ return ret_val;
+}
+
+jboolean __attribute__((visibility("default"))) TS_MonitorUpdateId_eq(uint32_t a, uint32_t b) {
+ LDKMonitorUpdateId a_conv;
+ a_conv.inner = (void*)(a & (~1));
+ a_conv.is_owned = false;
+ LDKMonitorUpdateId b_conv;
+ b_conv.inner = (void*)(b & (~1));
+ b_conv.is_owned = false;
+ jboolean ret_val = MonitorUpdateId_eq(&a_conv, &b_conv);
+ return ret_val;
+}
+
void __attribute__((visibility("default"))) TS_Persist_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
CHECK_ACCESS(persister_ptr);
LDKPersist persister_conv = *(LDKPersist*)(persister_ptr);
LDKChainMonitor ret_var = ChainMonitor_new(chain_source_conv, broadcaster_conv, logger_conv, feeest_conv, persister_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
ignored_channels_constr.data[q] = ignored_channels_conv_16_conv;
}
LDKCVec_BalanceZ ret_var = ChainMonitor_get_claimable_balances(&this_arg_conv, ignored_channels_constr);
- uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t j = 0; j < ret_var.datalen; j++) {
LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
uint64_t ret_conv_9_ref = (uint64_t)ret_conv_9_copy;
ret_arr_ptr[j] = ret_conv_9_ref;
}
+
FREE(ret_var.data);
return ret_arr;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCVec_OutPointZ ret_var = ChainMonitor_list_monitors(&this_arg_conv);
- uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t k = 0; k < ret_var.datalen; k++) {
LDKOutPoint ret_conv_10_var = ret_var.data[k];
+ uint64_t ret_conv_10_ref = 0;
CHECK((((uint64_t)ret_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t ret_conv_10_ref = (uint64_t)ret_conv_10_var.inner;
+ ret_conv_10_ref = (uint64_t)ret_conv_10_var.inner;
if (ret_conv_10_var.is_owned) {
ret_conv_10_ref |= 1;
}
ret_arr_ptr[k] = ret_conv_10_ref;
}
+
FREE(ret_var.data);
return ret_arr;
}
+uint32_t __attribute__((visibility("default"))) TS_ChainMonitor_channel_monitor_updated(uint32_t this_arg, uint32_t funding_txo, uint32_t completed_update_id) {
+ LDKChainMonitor this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ LDKOutPoint funding_txo_conv;
+ funding_txo_conv.inner = (void*)(funding_txo & (~1));
+ funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0);
+ funding_txo_conv = OutPoint_clone(&funding_txo_conv);
+ LDKMonitorUpdateId completed_update_id_conv;
+ completed_update_id_conv.inner = (void*)(completed_update_id & (~1));
+ completed_update_id_conv.is_owned = (completed_update_id & 1) || (completed_update_id == 0);
+ completed_update_id_conv = MonitorUpdateId_clone(&completed_update_id_conv);
+ LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
+ *ret_conv = ChainMonitor_channel_monitor_updated(&this_arg_conv, funding_txo_conv, completed_update_id_conv);
+ return (uint64_t)ret_conv;
+}
+
uint32_t __attribute__((visibility("default"))) TS_ChainMonitor_as_Listen(uint32_t this_arg) {
LDKChainMonitor this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKListen* ret_ret =MALLOC(sizeof(LDKListen), "LDKListen");
+ LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen");
*ret_ret = ChainMonitor_as_Listen(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKChainMonitor this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKConfirm* ret_ret =MALLOC(sizeof(LDKConfirm), "LDKConfirm");
+ LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm");
*ret_ret = ChainMonitor_as_Confirm(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKChainMonitor this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKWatch* ret_ret =MALLOC(sizeof(LDKWatch), "LDKWatch");
+ LDKWatch* ret_ret = MALLOC(sizeof(LDKWatch), "LDKWatch");
*ret_ret = ChainMonitor_as_Watch(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKChainMonitor this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKEventsProvider* ret_ret =MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
+ LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
*ret_ret = ChainMonitor_as_EventsProvider(&this_arg_conv);
return (uint64_t)ret_ret;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
MonitorUpdateError_free(this_obj_conv);
}
-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;
- LDKMonitorUpdateError ret_var = MonitorUpdateError_clone(&orig_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;
+ 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;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
+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;
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
return ret_ref;
}
+uint32_t __attribute__((visibility("default"))) TS_MonitorEvent_update_completed(uint32_t funding_txo, int64_t monitor_update_id) {
+ LDKOutPoint funding_txo_conv;
+ funding_txo_conv.inner = (void*)(funding_txo & (~1));
+ funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0);
+ funding_txo_conv = OutPoint_clone(&funding_txo_conv);
+ LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
+ *ret_copy = MonitorEvent_update_completed(funding_txo_conv, monitor_update_id);
+ uint64_t ret_ref = (uint64_t)ret_copy;
+ return ret_ref;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_MonitorEvent_update_failed(uint32_t a) {
+ LDKOutPoint a_conv;
+ a_conv.inner = (void*)(a & (~1));
+ a_conv.is_owned = (a & 1) || (a == 0);
+ a_conv = OutPoint_clone(&a_conv);
+ LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
+ *ret_copy = MonitorEvent_update_failed(a_conv);
+ uint64_t ret_ref = (uint64_t)ret_copy;
+ return ret_ref;
+}
+
+int8_tArray __attribute__((visibility("default"))) TS_MonitorEvent_write(uint32_t obj) {
+ LDKMonitorEvent* obj_conv = (LDKMonitorEvent*)obj;
+ LDKCVec_u8Z ret_var = MonitorEvent_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_HTLCUpdate_free(uint32_t this_obj) {
LDKHTLCUpdate this_obj_conv;
this_obj_conv.inner = (void*)(this_obj & (~1));
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKHTLCUpdate ret_var = HTLCUpdate_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelMonitor ret_var = ChannelMonitor_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ret_var = ChannelMonitor_get_outputs_to_watch(&this_arg_conv);
- uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t o = 0; o < ret_var.datalen; o++) {
LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv_40_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ");
*ret_conv_40_conv = ret_var.data[o];
ret_arr_ptr[o] = ((uint64_t)ret_conv_40_conv);
}
+
FREE(ret_var.data);
return ret_arr;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCVec_MonitorEventZ ret_var = ChannelMonitor_get_and_clear_pending_monitor_events(&this_arg_conv);
- uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t o = 0; o < ret_var.datalen; o++) {
LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
uint64_t ret_conv_14_ref = (uint64_t)ret_conv_14_copy;
ret_arr_ptr[o] = ret_conv_14_ref;
}
+
FREE(ret_var.data);
return ret_arr;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCVec_EventZ ret_var = ChannelMonitor_get_and_clear_pending_events(&this_arg_conv);
- uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t h = 0; h < ret_var.datalen; h++) {
LDKEvent *ret_conv_7_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
uint64_t ret_conv_7_ref = (uint64_t)ret_conv_7_copy;
ret_arr_ptr[h] = ret_conv_7_ref;
}
+
FREE(ret_var.data);
return ret_arr;
}
if (!(logger & 1)) { CHECK_ACCESS(logger_ptr); }
LDKLogger* logger_conv = (LDKLogger*)logger_ptr;
LDKCVec_TransactionZ ret_var = ChannelMonitor_get_latest_holder_commitment_txn(&this_arg_conv, logger_conv);
- ptrArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native ptrArray Bytes");
+ ptrArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native ptrArray Bytes");
int8_tArray *ret_arr_ptr = (int8_tArray*)(ret_arr + 4);
for (size_t m = 0; m < ret_var.datalen; m++) {
LDKTransaction ret_conv_12_var = ret_var.data[m];
Transaction_free(ret_conv_12_var);
ret_arr_ptr[m] = ret_conv_12_arr;
}
+
FREE(ret_var.data);
return ret_arr;
}
CHECK_ACCESS(logger_ptr);
LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_block_connected(&this_arg_conv, header_ref, txdata_constr, height, broadcaster_conv, fee_estimator_conv, logger_conv);
- uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t n = 0; n < ret_var.datalen; n++) {
LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
*ret_conv_39_conv = ret_var.data[n];
ret_arr_ptr[n] = ((uint64_t)ret_conv_39_conv);
}
+
FREE(ret_var.data);
return ret_arr;
}
CHECK_ACCESS(logger_ptr);
LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_transactions_confirmed(&this_arg_conv, header_ref, txdata_constr, height, broadcaster_conv, fee_estimator_conv, logger_conv);
- uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t n = 0; n < ret_var.datalen; n++) {
LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
*ret_conv_39_conv = ret_var.data[n];
ret_arr_ptr[n] = ((uint64_t)ret_conv_39_conv);
}
+
FREE(ret_var.data);
return ret_arr;
}
CHECK_ACCESS(logger_ptr);
LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_best_block_updated(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv);
- uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t n = 0; n < ret_var.datalen; n++) {
LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
*ret_conv_39_conv = ret_var.data[n];
ret_arr_ptr[n] = ((uint64_t)ret_conv_39_conv);
}
+
FREE(ret_var.data);
return ret_arr;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCVec_TxidZ ret_var = ChannelMonitor_get_relevant_txids(&this_arg_conv);
- ptrArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native ptrArray Bytes");
+ ptrArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native ptrArray Bytes");
int8_tArray *ret_arr_ptr = (int8_tArray*)(ret_arr + 4);
for (size_t m = 0; m < ret_var.datalen; m++) {
int8_tArray ret_conv_12_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(ret_conv_12_arr + 4), ret_var.data[m].data, 32);
ret_arr_ptr[m] = ret_conv_12_arr;
}
+
FREE(ret_var.data);
return ret_arr;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKBestBlock ret_var = ChannelMonitor_current_best_block(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCVec_BalanceZ ret_var = ChannelMonitor_get_claimable_balances(&this_arg_conv);
- uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t j = 0; j < ret_var.datalen; j++) {
LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
uint64_t ret_conv_9_ref = (uint64_t)ret_conv_9_copy;
ret_arr_ptr[j] = ret_conv_9_ref;
}
+
FREE(ret_var.data);
return ret_arr;
}
CHECK(*((uint32_t*)txid_arg) == 32);
memcpy(txid_arg_ref.data, (uint8_t*)(txid_arg + 4), 32);
LDKOutPoint ret_var = OutPoint_new(txid_arg_ref, index_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKOutPoint ret_var = OutPoint_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKOutPoint ret_var = DelayedPaymentOutputDescriptor_get_outpoint(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK(*((uint32_t*)channel_keys_id_arg) == 32);
memcpy(channel_keys_id_arg_ref.data, (uint8_t*)(channel_keys_id_arg + 4), 32);
LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_new(outpoint_arg_conv, per_commitment_point_arg_ref, to_self_delay_arg, output_arg_conv, revocation_pubkey_arg_ref, channel_keys_id_arg_ref, channel_value_satoshis_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKOutPoint ret_var = StaticPaymentOutputDescriptor_get_outpoint(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK(*((uint32_t*)channel_keys_id_arg) == 32);
memcpy(channel_keys_id_arg_ref.data, (uint8_t*)(channel_keys_id_arg + 4), 32);
LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_new(outpoint_arg_conv, output_arg_conv, channel_keys_id_arg_ref, channel_value_satoshis_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
void* orig_ptr = (void*)(((uint64_t)orig) & ~1);
if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); }
LDKSign* orig_conv = (LDKSign*)orig_ptr;
- LDKSign* ret_ret =MALLOC(sizeof(LDKSign), "LDKSign");
+ LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
*ret_ret = Sign_clone(orig_conv);
return (uint64_t)ret_ret;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKInMemorySigner ret_var = InMemorySigner_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK(*((uint32_t*)channel_keys_id) == 32);
memcpy(channel_keys_id_ref.data, (uint8_t*)(channel_keys_id + 4), 32);
LDKInMemorySigner ret_var = InMemorySigner_new(funding_key_ref, revocation_base_key_ref, payment_key_ref, delayed_payment_base_key_ref, htlc_base_key_ref, commitment_seed_ref, channel_value_satoshis, channel_keys_id_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKChannelPublicKeys ret_var = InMemorySigner_counterparty_pubkeys(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKOutPoint ret_var = InMemorySigner_funding_outpoint(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKChannelTransactionParameters ret_var = InMemorySigner_get_channel_parameters(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKInMemorySigner this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKBaseSign* ret_ret =MALLOC(sizeof(LDKBaseSign), "LDKBaseSign");
+ LDKBaseSign* ret_ret = MALLOC(sizeof(LDKBaseSign), "LDKBaseSign");
*ret_ret = InMemorySigner_as_BaseSign(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKInMemorySigner this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKSign* ret_ret =MALLOC(sizeof(LDKSign), "LDKSign");
+ LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
*ret_ret = InMemorySigner_as_Sign(&this_arg_conv);
return (uint64_t)ret_ret;
}
memcpy(seed_arr, (uint8_t*)(seed + 4), 32);
unsigned char (*seed_ref)[32] = &seed_arr;
LDKKeysManager ret_var = KeysManager_new(seed_ref, starting_time_secs, starting_time_nanos);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
memcpy(params_arr, (uint8_t*)(params + 4), 32);
unsigned char (*params_ref)[32] = ¶ms_arr;
LDKInMemorySigner ret_var = KeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKKeysManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKKeysInterface* ret_ret =MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface");
+ LDKKeysInterface* ret_ret = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface");
*ret_ret = KeysManager_as_KeysInterface(&this_arg_conv);
return (uint64_t)ret_ret;
}
-void __attribute__((visibility("default"))) TS_PaymentId_free(uint32_t this_obj) {
- LDKPaymentId this_obj_conv;
- this_obj_conv.inner = (void*)(this_obj & (~1));
- this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
- PaymentId_free(this_obj_conv);
-}
-
-int64_t __attribute__((visibility("default"))) TS_PaymentId_hash(uint32_t o) {
- LDKPaymentId o_conv;
- o_conv.inner = (void*)(o & (~1));
- o_conv.is_owned = false;
- int64_t ret_val = PaymentId_hash(&o_conv);
- return ret_val;
-}
-
-uint32_t __attribute__((visibility("default"))) TS_PaymentId_clone(uint32_t orig) {
- LDKPaymentId orig_conv;
- orig_conv.inner = (void*)(orig & (~1));
- orig_conv.is_owned = false;
- LDKPaymentId ret_var = PaymentId_clone(&orig_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
- }
- return ret_ref;
-}
-
-jboolean __attribute__((visibility("default"))) TS_PaymentId_eq(uint32_t a, uint32_t b) {
- LDKPaymentId a_conv;
- a_conv.inner = (void*)(a & (~1));
- a_conv.is_owned = false;
- LDKPaymentId b_conv;
- b_conv.inner = (void*)(b & (~1));
- b_conv.is_owned = false;
- jboolean ret_val = PaymentId_eq(&a_conv, &b_conv);
- return ret_val;
-}
-
-int8_tArray __attribute__((visibility("default"))) TS_PaymentId_write(uint32_t obj) {
- LDKPaymentId obj_conv;
- obj_conv.inner = (void*)(obj & (~1));
- obj_conv.is_owned = false;
- LDKCVec_u8Z ret_var = PaymentId_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_PaymentId_read(int8_tArray ser) {
- LDKu8slice ser_ref;
- ser_ref.datalen = *((uint32_t*)ser);
- ser_ref.data = (int8_t*)(ser + 4);
- LDKCResult_PaymentIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdDecodeErrorZ), "LDKCResult_PaymentIdDecodeErrorZ");
- *ret_conv = PaymentId_read(ser_ref);
- return (uint64_t)ret_conv;
-}
-
void __attribute__((visibility("default"))) TS_ChannelManager_free(uint32_t this_obj) {
LDKChannelManager this_obj_conv;
this_obj_conv.inner = (void*)(this_obj & (~1));
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKBestBlock ret_var = ChainParameters_get_best_block(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
best_block_arg_conv.is_owned = (best_block_arg & 1) || (best_block_arg == 0);
best_block_arg_conv = BestBlock_clone(&best_block_arg_conv);
LDKChainParameters ret_var = ChainParameters_new(network_arg_conv, best_block_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChainParameters ret_var = ChainParameters_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
uint32_t __attribute__((visibility("default"))) TS_CounterpartyForwardingInfo_new(int32_t fee_base_msat_arg, int32_t fee_proportional_millionths_arg, int16_t cltv_expiry_delta_arg) {
LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_new(fee_base_msat_arg, fee_proportional_millionths_arg, cltv_expiry_delta_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKInitFeatures ret_var = ChannelCounterparty_get_features(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKCounterpartyForwardingInfo ret_var = ChannelCounterparty_get_forwarding_info(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
forwarding_info_arg_conv.is_owned = (forwarding_info_arg & 1) || (forwarding_info_arg == 0);
forwarding_info_arg_conv = CounterpartyForwardingInfo_clone(&forwarding_info_arg_conv);
LDKChannelCounterparty ret_var = ChannelCounterparty_new(node_id_arg_ref, features_arg_conv, unspendable_punishment_reserve_arg, forwarding_info_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelCounterparty ret_var = ChannelCounterparty_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKChannelCounterparty ret_var = ChannelDetails_get_counterparty(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKOutPoint ret_var = ChannelDetails_get_funding_txo(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
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);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelDetails ret_var = ChannelDetails_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
return ret_ref;
}
-uint32_t __attribute__((visibility("default"))) TS_PaymentSendFailure_partial_failure(uint32_tArray a) {
- LDKCVec_CResult_NoneAPIErrorZZ a_constr;
- a_constr.datalen = *((uint32_t*)a);
- if (a_constr.datalen > 0)
- a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
+uint32_t __attribute__((visibility("default"))) TS_PaymentSendFailure_partial_failure(uint32_tArray results, uint32_t failed_paths_retry, int8_tArray payment_id) {
+ LDKCVec_CResult_NoneAPIErrorZZ results_constr;
+ results_constr.datalen = *((uint32_t*)results);
+ if (results_constr.datalen > 0)
+ results_constr.data = MALLOC(results_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
else
- a_constr.data = NULL;
- uint32_t* a_vals = (uint32_t*)(a + 4);
- for (size_t w = 0; w < a_constr.datalen; w++) {
- uint32_t a_conv_22 = a_vals[w];
- void* a_conv_22_ptr = (void*)(((uint64_t)a_conv_22) & ~1);
- CHECK_ACCESS(a_conv_22_ptr);
- LDKCResult_NoneAPIErrorZ a_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(a_conv_22_ptr);
- a_conv_22_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)(((uint64_t)a_conv_22) & ~1));
- a_constr.data[w] = a_conv_22_conv;
- }
+ results_constr.data = NULL;
+ uint32_t* results_vals = (uint32_t*)(results + 4);
+ for (size_t w = 0; w < results_constr.datalen; w++) {
+ uint32_t results_conv_22 = results_vals[w];
+ void* results_conv_22_ptr = (void*)(((uint64_t)results_conv_22) & ~1);
+ CHECK_ACCESS(results_conv_22_ptr);
+ LDKCResult_NoneAPIErrorZ results_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(results_conv_22_ptr);
+ results_constr.data[w] = results_conv_22_conv;
+ }
+ LDKRouteParameters failed_paths_retry_conv;
+ failed_paths_retry_conv.inner = (void*)(failed_paths_retry & (~1));
+ failed_paths_retry_conv.is_owned = (failed_paths_retry & 1) || (failed_paths_retry == 0);
+ failed_paths_retry_conv = RouteParameters_clone(&failed_paths_retry_conv);
+ LDKThirtyTwoBytes payment_id_ref;
+ CHECK(*((uint32_t*)payment_id) == 32);
+ memcpy(payment_id_ref.data, (uint8_t*)(payment_id + 4), 32);
LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
- *ret_copy = PaymentSendFailure_partial_failure(a_constr);
+ *ret_copy = PaymentSendFailure_partial_failure(results_constr, failed_paths_retry_conv, payment_id_ref);
uint64_t ret_ref = (uint64_t)ret_copy;
return ret_ref;
}
params_conv.is_owned = (params & 1) || (params == 0);
params_conv = ChainParameters_clone(¶ms_conv);
LDKChannelManager ret_var = ChannelManager_new(fee_est_conv, chain_monitor_conv, tx_broadcaster_conv, logger_conv, keys_manager_conv, config_conv, params_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKUserConfig ret_var = ChannelManager_get_current_default_configuration(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_channels(&this_arg_conv);
- uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t q = 0; q < ret_var.datalen; q++) {
LDKChannelDetails ret_conv_16_var = ret_var.data[q];
+ uint64_t ret_conv_16_ref = 0;
CHECK((((uint64_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner;
+ ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner;
if (ret_conv_16_var.is_owned) {
ret_conv_16_ref |= 1;
}
ret_arr_ptr[q] = ret_conv_16_ref;
}
+
FREE(ret_var.data);
return ret_arr;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_usable_channels(&this_arg_conv);
- uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t q = 0; q < ret_var.datalen; q++) {
LDKChannelDetails ret_conv_16_var = ret_var.data[q];
+ uint64_t ret_conv_16_ref = 0;
CHECK((((uint64_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner;
+ ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner;
if (ret_conv_16_var.is_owned) {
ret_conv_16_ref |= 1;
}
ret_arr_ptr[q] = ret_conv_16_ref;
}
+
FREE(ret_var.data);
return ret_arr;
}
return (uint64_t)ret_conv;
}
-uint32_t __attribute__((visibility("default"))) TS_ChannelManager_retry_payment(uint32_t this_arg, uint32_t route, uint32_t payment_id) {
+uint32_t __attribute__((visibility("default"))) TS_ChannelManager_retry_payment(uint32_t this_arg, uint32_t route, int8_tArray payment_id) {
LDKChannelManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKRoute route_conv;
route_conv.inner = (void*)(route & (~1));
route_conv.is_owned = false;
- LDKPaymentId payment_id_conv;
- payment_id_conv.inner = (void*)(payment_id & (~1));
- payment_id_conv.is_owned = (payment_id & 1) || (payment_id == 0);
- payment_id_conv = PaymentId_clone(&payment_id_conv);
+ LDKThirtyTwoBytes payment_id_ref;
+ CHECK(*((uint32_t*)payment_id) == 32);
+ memcpy(payment_id_ref.data, (uint8_t*)(payment_id + 4), 32);
LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
- *ret_conv = ChannelManager_retry_payment(&this_arg_conv, &route_conv, payment_id_conv);
+ *ret_conv = ChannelManager_retry_payment(&this_arg_conv, &route_conv, payment_id_ref);
return (uint64_t)ret_conv;
}
return ret_arr;
}
-void __attribute__((visibility("default"))) TS_ChannelManager_channel_monitor_updated(uint32_t this_arg, uint32_t funding_txo, int64_t highest_applied_update_id) {
- LDKChannelManager this_arg_conv;
- this_arg_conv.inner = (void*)(this_arg & (~1));
- this_arg_conv.is_owned = false;
- LDKOutPoint funding_txo_conv;
- funding_txo_conv.inner = (void*)(funding_txo & (~1));
- funding_txo_conv.is_owned = false;
- ChannelManager_channel_monitor_updated(&this_arg_conv, &funding_txo_conv, highest_applied_update_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, int64_t user_payment_id) {
LDKChannelManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
LDKChannelManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKMessageSendEventsProvider* ret_ret =MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
+ LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
*ret_ret = ChannelManager_as_MessageSendEventsProvider(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKChannelManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKEventsProvider* ret_ret =MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
+ LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
*ret_ret = ChannelManager_as_EventsProvider(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKChannelManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKListen* ret_ret =MALLOC(sizeof(LDKListen), "LDKListen");
+ LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen");
*ret_ret = ChannelManager_as_Listen(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKChannelManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKConfirm* ret_ret =MALLOC(sizeof(LDKConfirm), "LDKConfirm");
+ LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm");
*ret_ret = ChannelManager_as_Confirm(&this_arg_conv);
return (uint64_t)ret_ret;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKBestBlock ret_var = ChannelManager_current_best_block(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKChannelManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKChannelMessageHandler* ret_ret =MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
+ LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
*ret_ret = ChannelManager_as_ChannelMessageHandler(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKChannelManagerReadArgs this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- uint64_t ret_ret = (uint64_t)ChannelManagerReadArgs_get_keys_manager(&this_ptr_conv);
+ // WARNING: This object doesn't live past this scope, needs clone!
+ uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_keys_manager(&this_ptr_conv)) | 1;
return ret_ret;
}
LDKChannelManagerReadArgs this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- uint64_t ret_ret = (uint64_t)ChannelManagerReadArgs_get_fee_estimator(&this_ptr_conv);
+ // WARNING: This object doesn't live past this scope, needs clone!
+ uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_fee_estimator(&this_ptr_conv)) | 1;
return ret_ret;
}
LDKChannelManagerReadArgs this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- uint64_t ret_ret = (uint64_t)ChannelManagerReadArgs_get_chain_monitor(&this_ptr_conv);
+ // WARNING: This object doesn't live past this scope, needs clone!
+ uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_chain_monitor(&this_ptr_conv)) | 1;
return ret_ret;
}
LDKChannelManagerReadArgs this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- uint64_t ret_ret = (uint64_t)ChannelManagerReadArgs_get_tx_broadcaster(&this_ptr_conv);
+ // WARNING: This object doesn't live past this scope, needs clone!
+ uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_tx_broadcaster(&this_ptr_conv)) | 1;
return ret_ret;
}
LDKChannelManagerReadArgs this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- uint64_t ret_ret = (uint64_t)ChannelManagerReadArgs_get_logger(&this_ptr_conv);
+ // WARNING: This object doesn't live past this scope, needs clone!
+ uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_logger(&this_ptr_conv)) | 1;
return ret_ret;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKUserConfig ret_var = ChannelManagerReadArgs_get_default_config(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
channel_monitors_constr.data[q] = channel_monitors_conv_16_conv;
}
LDKChannelManagerReadArgs ret_var = ChannelManagerReadArgs_new(keys_manager_conv, fee_estimator_conv, chain_monitor_conv, tx_broadcaster_conv, logger_conv, default_config_conv, channel_monitors_constr);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKDecodeError ret_var = DecodeError_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKInitFeatures ret_var = Init_get_features(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0);
features_arg_conv = InitFeatures_clone(&features_arg_conv);
LDKInit ret_var = Init_new(features_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKInit ret_var = Init_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
memcpy(channel_id_arg_ref.data, (uint8_t*)(channel_id_arg + 4), 32);
LDKStr data_arg_conv = str_ref_to_owned_c(data_arg);
LDKErrorMessage ret_var = ErrorMessage_new(channel_id_arg_ref, data_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKErrorMessage ret_var = ErrorMessage_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
uint32_t __attribute__((visibility("default"))) TS_Ping_new(int16_t ponglen_arg, int16_t byteslen_arg) {
LDKPing ret_var = Ping_new(ponglen_arg, byteslen_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKPing ret_var = Ping_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
uint32_t __attribute__((visibility("default"))) TS_Pong_new(int16_t byteslen_arg) {
LDKPong ret_var = Pong_new(byteslen_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKPong ret_var = Pong_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKOpenChannel ret_var = OpenChannel_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKAcceptChannel ret_var = AcceptChannel_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK(*((uint32_t*)signature_arg) == 64);
memcpy(signature_arg_ref.compact_form, (uint8_t*)(signature_arg + 4), 64);
LDKFundingCreated ret_var = FundingCreated_new(temporary_channel_id_arg_ref, funding_txid_arg_ref, funding_output_index_arg, signature_arg_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKFundingCreated ret_var = FundingCreated_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK(*((uint32_t*)signature_arg) == 64);
memcpy(signature_arg_ref.compact_form, (uint8_t*)(signature_arg + 4), 64);
LDKFundingSigned ret_var = FundingSigned_new(channel_id_arg_ref, signature_arg_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKFundingSigned ret_var = FundingSigned_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK(*((uint32_t*)next_per_commitment_point_arg) == 33);
memcpy(next_per_commitment_point_arg_ref.compressed_form, (uint8_t*)(next_per_commitment_point_arg + 4), 33);
LDKFundingLocked ret_var = FundingLocked_new(channel_id_arg_ref, next_per_commitment_point_arg_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKFundingLocked ret_var = FundingLocked_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
scriptpubkey_arg_ref.data = MALLOC(scriptpubkey_arg_ref.datalen, "LDKCVec_u8Z Bytes");
memcpy(scriptpubkey_arg_ref.data, (uint8_t*)(scriptpubkey_arg + 4), scriptpubkey_arg_ref.datalen);
LDKShutdown ret_var = Shutdown_new(channel_id_arg_ref, scriptpubkey_arg_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKShutdown ret_var = Shutdown_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
uint32_t __attribute__((visibility("default"))) TS_ClosingSignedFeeRange_new(int64_t min_fee_satoshis_arg, int64_t max_fee_satoshis_arg) {
LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_new(min_fee_satoshis_arg, max_fee_satoshis_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKClosingSignedFeeRange ret_var = ClosingSigned_get_fee_range(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
fee_range_arg_conv.is_owned = (fee_range_arg & 1) || (fee_range_arg == 0);
fee_range_arg_conv = ClosingSignedFeeRange_clone(&fee_range_arg_conv);
LDKClosingSigned ret_var = ClosingSigned_new(channel_id_arg_ref, fee_satoshis_arg, signature_arg_ref, fee_range_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKClosingSigned ret_var = ClosingSigned_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKUpdateAddHTLC ret_var = UpdateAddHTLC_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK(*((uint32_t*)payment_preimage_arg) == 32);
memcpy(payment_preimage_arg_ref.data, (uint8_t*)(payment_preimage_arg + 4), 32);
LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_new(channel_id_arg_ref, htlc_id_arg, payment_preimage_arg_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKUpdateFailHTLC ret_var = UpdateFailHTLC_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKUpdateFailMalformedHTLC ret_var = UpdateFailMalformedHTLC_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
htlc_signatures_arg_constr.data[m] = htlc_signatures_arg_conv_12_ref;
}
LDKCommitmentSigned ret_var = CommitmentSigned_new(channel_id_arg_ref, signature_arg_ref, htlc_signatures_arg_constr);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKCommitmentSigned ret_var = CommitmentSigned_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK(*((uint32_t*)next_per_commitment_point_arg) == 33);
memcpy(next_per_commitment_point_arg_ref.compressed_form, (uint8_t*)(next_per_commitment_point_arg + 4), 33);
LDKRevokeAndACK ret_var = RevokeAndACK_new(channel_id_arg_ref, per_commitment_secret_arg_ref, next_per_commitment_point_arg_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKRevokeAndACK ret_var = RevokeAndACK_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK(*((uint32_t*)channel_id_arg) == 32);
memcpy(channel_id_arg_ref.data, (uint8_t*)(channel_id_arg + 4), 32);
LDKUpdateFee ret_var = UpdateFee_new(channel_id_arg_ref, feerate_per_kw_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKUpdateFee ret_var = UpdateFee_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK(*((uint32_t*)my_current_per_commitment_point_arg) == 33);
memcpy(my_current_per_commitment_point_arg_ref.compressed_form, (uint8_t*)(my_current_per_commitment_point_arg + 4), 33);
LDKDataLossProtect ret_var = DataLossProtect_new(your_last_per_commitment_secret_arg_ref, my_current_per_commitment_point_arg_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKDataLossProtect ret_var = DataLossProtect_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelReestablish ret_var = ChannelReestablish_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK(*((uint32_t*)bitcoin_signature_arg) == 64);
memcpy(bitcoin_signature_arg_ref.compact_form, (uint8_t*)(bitcoin_signature_arg + 4), 64);
LDKAnnouncementSignatures ret_var = AnnouncementSignatures_new(channel_id_arg_ref, short_channel_id_arg, node_signature_arg_ref, bitcoin_signature_arg_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKAnnouncementSignatures ret_var = AnnouncementSignatures_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
return ret_arr;
}
-uint32_t __attribute__((visibility("default"))) TS_Result_read(int8_tArray ser) {
- LDKu8slice ser_ref;
- ser_ref.datalen = *((uint32_t*)ser);
- ser_ref.data = (int8_t*)(ser + 4);
- LDKCResult_CResult_NetAddressu8ZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CResult_NetAddressu8ZDecodeErrorZ), "LDKCResult_CResult_NetAddressu8ZDecodeErrorZ");
- *ret_conv = Result_read(ser_ref);
- return (uint64_t)ret_conv;
-}
-
uint32_t __attribute__((visibility("default"))) TS_NetAddress_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = *((uint32_t*)ser);
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKNodeFeatures ret_var = UnsignedNodeAnnouncement_get_features(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKUnsignedNodeAnnouncement ret_var = NodeAnnouncement_get_contents(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
contents_arg_conv.is_owned = (contents_arg & 1) || (contents_arg == 0);
contents_arg_conv = UnsignedNodeAnnouncement_clone(&contents_arg_conv);
LDKNodeAnnouncement ret_var = NodeAnnouncement_new(signature_arg_ref, contents_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKNodeAnnouncement ret_var = NodeAnnouncement_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKChannelFeatures ret_var = UnsignedChannelAnnouncement_get_features(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKUnsignedChannelAnnouncement ret_var = UnsignedChannelAnnouncement_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKUnsignedChannelAnnouncement ret_var = ChannelAnnouncement_get_contents(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
contents_arg_conv.is_owned = (contents_arg & 1) || (contents_arg == 0);
contents_arg_conv = UnsignedChannelAnnouncement_clone(&contents_arg_conv);
LDKChannelAnnouncement ret_var = ChannelAnnouncement_new(node_signature_1_arg_ref, node_signature_2_arg_ref, bitcoin_signature_1_arg_ref, bitcoin_signature_2_arg_ref, contents_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelAnnouncement ret_var = ChannelAnnouncement_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKUnsignedChannelUpdate ret_var = ChannelUpdate_get_contents(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
contents_arg_conv.is_owned = (contents_arg & 1) || (contents_arg == 0);
contents_arg_conv = UnsignedChannelUpdate_clone(&contents_arg_conv);
LDKChannelUpdate ret_var = ChannelUpdate_new(signature_arg_ref, contents_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelUpdate ret_var = ChannelUpdate_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK(*((uint32_t*)chain_hash_arg) == 32);
memcpy(chain_hash_arg_ref.data, (uint8_t*)(chain_hash_arg + 4), 32);
LDKQueryChannelRange ret_var = QueryChannelRange_new(chain_hash_arg_ref, first_blocknum_arg, number_of_blocks_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKQueryChannelRange ret_var = QueryChannelRange_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
short_channel_ids_arg_constr.data[i] = short_channel_ids_arg_conv_8;
}
LDKReplyChannelRange ret_var = ReplyChannelRange_new(chain_hash_arg_ref, first_blocknum_arg, number_of_blocks_arg, sync_complete_arg, short_channel_ids_arg_constr);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKReplyChannelRange ret_var = ReplyChannelRange_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
short_channel_ids_arg_constr.data[i] = short_channel_ids_arg_conv_8;
}
LDKQueryShortChannelIds ret_var = QueryShortChannelIds_new(chain_hash_arg_ref, short_channel_ids_arg_constr);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKQueryShortChannelIds ret_var = QueryShortChannelIds_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK(*((uint32_t*)chain_hash_arg) == 32);
memcpy(chain_hash_arg_ref.data, (uint8_t*)(chain_hash_arg + 4), 32);
LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_new(chain_hash_arg_ref, full_information_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK(*((uint32_t*)chain_hash_arg) == 32);
memcpy(chain_hash_arg_ref.data, (uint8_t*)(chain_hash_arg + 4), 32);
LDKGossipTimestampFilter ret_var = GossipTimestampFilter_new(chain_hash_arg_ref, first_timestamp_arg, timestamp_range_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKGossipTimestampFilter ret_var = GossipTimestampFilter_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKErrorAction action_arg_conv = *(LDKErrorAction*)(action_arg_ptr);
action_arg_conv = ErrorAction_clone((LDKErrorAction*)(((uint64_t)action_arg) & ~1));
LDKLightningError ret_var = LightningError_new(err_arg_conv, action_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKLightningError ret_var = LightningError_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKCVec_UpdateAddHTLCZ ret_var = CommitmentUpdate_get_update_add_htlcs(&this_ptr_conv);
- uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t p = 0; p < ret_var.datalen; p++) {
LDKUpdateAddHTLC ret_conv_15_var = ret_var.data[p];
+ uint64_t ret_conv_15_ref = 0;
CHECK((((uint64_t)ret_conv_15_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_conv_15_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t ret_conv_15_ref = (uint64_t)ret_conv_15_var.inner;
+ ret_conv_15_ref = (uint64_t)ret_conv_15_var.inner;
if (ret_conv_15_var.is_owned) {
ret_conv_15_ref |= 1;
}
ret_arr_ptr[p] = ret_conv_15_ref;
}
+
FREE(ret_var.data);
return ret_arr;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKCVec_UpdateFulfillHTLCZ ret_var = CommitmentUpdate_get_update_fulfill_htlcs(&this_ptr_conv);
- uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t t = 0; t < ret_var.datalen; t++) {
LDKUpdateFulfillHTLC ret_conv_19_var = ret_var.data[t];
+ uint64_t ret_conv_19_ref = 0;
CHECK((((uint64_t)ret_conv_19_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_conv_19_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t ret_conv_19_ref = (uint64_t)ret_conv_19_var.inner;
+ ret_conv_19_ref = (uint64_t)ret_conv_19_var.inner;
if (ret_conv_19_var.is_owned) {
ret_conv_19_ref |= 1;
}
ret_arr_ptr[t] = ret_conv_19_ref;
}
+
FREE(ret_var.data);
return ret_arr;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKCVec_UpdateFailHTLCZ ret_var = CommitmentUpdate_get_update_fail_htlcs(&this_ptr_conv);
- uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t q = 0; q < ret_var.datalen; q++) {
LDKUpdateFailHTLC ret_conv_16_var = ret_var.data[q];
+ uint64_t ret_conv_16_ref = 0;
CHECK((((uint64_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner;
+ ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner;
if (ret_conv_16_var.is_owned) {
ret_conv_16_ref |= 1;
}
ret_arr_ptr[q] = ret_conv_16_ref;
}
+
FREE(ret_var.data);
return ret_arr;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKCVec_UpdateFailMalformedHTLCZ ret_var = CommitmentUpdate_get_update_fail_malformed_htlcs(&this_ptr_conv);
- uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t z = 0; z < ret_var.datalen; z++) {
LDKUpdateFailMalformedHTLC ret_conv_25_var = ret_var.data[z];
+ uint64_t ret_conv_25_ref = 0;
CHECK((((uint64_t)ret_conv_25_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_conv_25_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t ret_conv_25_ref = (uint64_t)ret_conv_25_var.inner;
+ ret_conv_25_ref = (uint64_t)ret_conv_25_var.inner;
if (ret_conv_25_var.is_owned) {
ret_conv_25_ref |= 1;
}
ret_arr_ptr[z] = ret_conv_25_ref;
}
+
FREE(ret_var.data);
return ret_arr;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKUpdateFee ret_var = CommitmentUpdate_get_update_fee(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKCommitmentSigned ret_var = CommitmentUpdate_get_commitment_signed(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
commitment_signed_arg_conv.is_owned = (commitment_signed_arg & 1) || (commitment_signed_arg == 0);
commitment_signed_arg_conv = CommitmentSigned_clone(&commitment_signed_arg_conv);
LDKCommitmentUpdate ret_var = CommitmentUpdate_new(update_add_htlcs_arg_constr, update_fulfill_htlcs_arg_constr, update_fail_htlcs_arg_constr, update_fail_malformed_htlcs_arg_constr, update_fee_arg_conv, commitment_signed_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKCommitmentUpdate ret_var = CommitmentUpdate_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
uint32_t __attribute__((visibility("default"))) TS_IgnoringMessageHandler_new() {
LDKIgnoringMessageHandler ret_var = IgnoringMessageHandler_new();
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKIgnoringMessageHandler this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKMessageSendEventsProvider* ret_ret =MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
+ LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
*ret_ret = IgnoringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKIgnoringMessageHandler this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKRoutingMessageHandler* ret_ret =MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
+ LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
*ret_ret = IgnoringMessageHandler_as_RoutingMessageHandler(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKIgnoringMessageHandler this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKCustomMessageReader* ret_ret =MALLOC(sizeof(LDKCustomMessageReader), "LDKCustomMessageReader");
+ LDKCustomMessageReader* ret_ret = MALLOC(sizeof(LDKCustomMessageReader), "LDKCustomMessageReader");
*ret_ret = IgnoringMessageHandler_as_CustomMessageReader(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKIgnoringMessageHandler this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKCustomMessageHandler* ret_ret =MALLOC(sizeof(LDKCustomMessageHandler), "LDKCustomMessageHandler");
+ LDKCustomMessageHandler* ret_ret = MALLOC(sizeof(LDKCustomMessageHandler), "LDKCustomMessageHandler");
*ret_ret = IgnoringMessageHandler_as_CustomMessageHandler(&this_arg_conv);
return (uint64_t)ret_ret;
}
uint32_t __attribute__((visibility("default"))) TS_ErroringMessageHandler_new() {
LDKErroringMessageHandler ret_var = ErroringMessageHandler_new();
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKErroringMessageHandler this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKMessageSendEventsProvider* ret_ret =MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
+ LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
*ret_ret = ErroringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKErroringMessageHandler this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKChannelMessageHandler* ret_ret =MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
+ LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
*ret_ret = ErroringMessageHandler_as_ChannelMessageHandler(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKMessageHandler this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- uint64_t ret_ret = (uint64_t)MessageHandler_get_chan_handler(&this_ptr_conv);
+ // WARNING: This object doesn't live past this scope, needs clone!
+ uint64_t ret_ret = ((uint64_t)MessageHandler_get_chan_handler(&this_ptr_conv)) | 1;
return ret_ret;
}
LDKMessageHandler this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- uint64_t ret_ret = (uint64_t)MessageHandler_get_route_handler(&this_ptr_conv);
+ // WARNING: This object doesn't live past this scope, needs clone!
+ uint64_t ret_ret = ((uint64_t)MessageHandler_get_route_handler(&this_ptr_conv)) | 1;
return ret_ret;
}
CHECK_ACCESS(route_handler_arg_ptr);
LDKRoutingMessageHandler route_handler_arg_conv = *(LDKRoutingMessageHandler*)(route_handler_arg_ptr);
LDKMessageHandler ret_var = MessageHandler_new(chan_handler_arg_conv, route_handler_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
void* orig_ptr = (void*)(((uint64_t)orig) & ~1);
if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); }
LDKSocketDescriptor* orig_conv = (LDKSocketDescriptor*)orig_ptr;
- LDKSocketDescriptor* ret_ret =MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
+ LDKSocketDescriptor* ret_ret = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
*ret_ret = SocketDescriptor_clone(orig_conv);
return (uint64_t)ret_ret;
}
uint32_t __attribute__((visibility("default"))) TS_PeerHandleError_new(jboolean no_connection_possible_arg) {
LDKPeerHandleError ret_var = PeerHandleError_new(no_connection_possible_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKPeerHandleError ret_var = PeerHandleError_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK_ACCESS(custom_message_handler_ptr);
LDKCustomMessageHandler custom_message_handler_conv = *(LDKCustomMessageHandler*)(custom_message_handler_ptr);
LDKPeerManager ret_var = PeerManager_new(message_handler_conv, our_node_secret_ref, ephemeral_random_data_ref, logger_conv, custom_message_handler_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCVec_PublicKeyZ ret_var = PeerManager_get_peer_node_ids(&this_arg_conv);
- ptrArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native ptrArray Bytes");
+ ptrArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native ptrArray Bytes");
int8_tArray *ret_arr_ptr = (int8_tArray*)(ret_arr + 4);
for (size_t m = 0; m < ret_var.datalen; m++) {
int8_tArray ret_conv_12_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(ret_conv_12_arr + 4), ret_var.data[m].compressed_form, 33);
ret_arr_ptr[m] = ret_conv_12_arr;
}
+
FREE(ret_var.data);
return ret_arr;
}
PeerManager_disconnect_by_node_id(&this_arg_conv, node_id_ref, no_connection_possible);
}
+void __attribute__((visibility("default"))) TS_PeerManager_disconnect_all_peers(uint32_t this_arg) {
+ LDKPeerManager this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ PeerManager_disconnect_all_peers(&this_arg_conv);
+}
+
void __attribute__((visibility("default"))) TS_PeerManager_timer_tick_occurred(uint32_t this_arg) {
LDKPeerManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
CHECK(*((uint32_t*)broadcaster_delayed_payment_key_arg) == 33);
memcpy(broadcaster_delayed_payment_key_arg_ref.compressed_form, (uint8_t*)(broadcaster_delayed_payment_key_arg + 4), 33);
LDKTxCreationKeys ret_var = TxCreationKeys_new(per_commitment_point_arg_ref, revocation_key_arg_ref, broadcaster_htlc_key_arg_ref, countersignatory_htlc_key_arg_ref, broadcaster_delayed_payment_key_arg_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKTxCreationKeys ret_var = TxCreationKeys_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK(*((uint32_t*)htlc_basepoint_arg) == 33);
memcpy(htlc_basepoint_arg_ref.compressed_form, (uint8_t*)(htlc_basepoint_arg + 4), 33);
LDKChannelPublicKeys ret_var = ChannelPublicKeys_new(funding_pubkey_arg_ref, revocation_basepoint_arg_ref, payment_point_arg_ref, delayed_payment_basepoint_arg_ref, htlc_basepoint_arg_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelPublicKeys ret_var = ChannelPublicKeys_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKCOption_u32Z transaction_output_index_arg_conv = *(LDKCOption_u32Z*)(transaction_output_index_arg_ptr);
transaction_output_index_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)(((uint64_t)transaction_output_index_arg) & ~1));
LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_new(offered_arg, amount_msat_arg, cltv_expiry_arg, payment_hash_arg_ref, transaction_output_index_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKChannelPublicKeys ret_var = ChannelTransactionParameters_get_holder_pubkeys(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKCounterpartyChannelTransactionParameters ret_var = ChannelTransactionParameters_get_counterparty_parameters(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKOutPoint ret_var = ChannelTransactionParameters_get_funding_outpoint(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
funding_outpoint_arg_conv.is_owned = (funding_outpoint_arg & 1) || (funding_outpoint_arg == 0);
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);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKChannelPublicKeys ret_var = CounterpartyChannelTransactionParameters_get_pubkeys(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
pubkeys_arg_conv.is_owned = (pubkeys_arg & 1) || (pubkeys_arg == 0);
pubkeys_arg_conv = ChannelPublicKeys_clone(&pubkeys_arg_conv);
LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_new(pubkeys_arg_conv, selected_contest_delay_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_holder_broadcastable(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_counterparty_broadcastable(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_broadcaster_pubkeys(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_countersignatory_pubkeys(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKOutPoint ret_var = DirectedChannelTransactionParameters_funding_outpoint(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK(*((uint32_t*)counterparty_funding_key) == 33);
memcpy(counterparty_funding_key_ref.compressed_form, (uint8_t*)(counterparty_funding_key + 4), 33);
LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_new(commitment_tx_conv, counterparty_sig_ref, counterparty_htlc_sigs_constr, holder_funding_key_ref, counterparty_funding_key_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK(*((uint32_t*)txid_arg) == 32);
memcpy(txid_arg_ref.data, (uint8_t*)(txid_arg + 4), 32);
LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_new(transaction_arg_ref, txid_arg_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKClosingTransaction ret_var = ClosingTransaction_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
funding_outpoint_conv.is_owned = (funding_outpoint & 1) || (funding_outpoint == 0);
funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv);
LDKClosingTransaction ret_var = ClosingTransaction_new(to_holder_value_sat, to_counterparty_value_sat, to_holder_script_ref, to_counterparty_script_ref, funding_outpoint_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKTrustedClosingTransaction ret_var = ClosingTransaction_trust(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKCommitmentTransaction ret_var = CommitmentTransaction_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKTrustedCommitmentTransaction ret_var = CommitmentTransaction_trust(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKBuiltCommitmentTransaction ret_var = TrustedCommitmentTransaction_built_transaction(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKTxCreationKeys ret_var = TrustedCommitmentTransaction_keys(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKInitFeatures ret_var = InitFeatures_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKNodeFeatures ret_var = NodeFeatures_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelFeatures ret_var = ChannelFeatures_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKInvoiceFeatures ret_var = InvoiceFeatures_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
uint32_t __attribute__((visibility("default"))) TS_InitFeatures_empty() {
LDKInitFeatures ret_var = InitFeatures_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
uint32_t __attribute__((visibility("default"))) TS_InitFeatures_known() {
LDKInitFeatures ret_var = InitFeatures_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
uint32_t __attribute__((visibility("default"))) TS_NodeFeatures_empty() {
LDKNodeFeatures ret_var = NodeFeatures_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
uint32_t __attribute__((visibility("default"))) TS_NodeFeatures_known() {
LDKNodeFeatures ret_var = NodeFeatures_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
uint32_t __attribute__((visibility("default"))) TS_ChannelFeatures_empty() {
LDKChannelFeatures ret_var = ChannelFeatures_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
uint32_t __attribute__((visibility("default"))) TS_ChannelFeatures_known() {
LDKChannelFeatures ret_var = ChannelFeatures_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
uint32_t __attribute__((visibility("default"))) TS_InvoiceFeatures_empty() {
LDKInvoiceFeatures ret_var = InvoiceFeatures_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
uint32_t __attribute__((visibility("default"))) TS_InvoiceFeatures_known() {
LDKInvoiceFeatures ret_var = InvoiceFeatures_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKShutdownScript ret_var = ShutdownScript_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
script_arg_ref.data = MALLOC(script_arg_ref.datalen, "LDKCVec_u8Z Bytes");
memcpy(script_arg_ref.data, (uint8_t*)(script_arg + 4), script_arg_ref.datalen);
LDKInvalidShutdownScript ret_var = InvalidShutdownScript_new(script_arg_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKInvalidShutdownScript ret_var = InvalidShutdownScript_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
memcpy(pubkey_hash_arr, (uint8_t*)(pubkey_hash + 4), 20);
unsigned char (*pubkey_hash_ref)[20] = &pubkey_hash_arr;
LDKShutdownScript ret_var = ShutdownScript_new_p2wpkh(pubkey_hash_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
memcpy(script_hash_arr, (uint8_t*)(script_hash + 4), 32);
unsigned char (*script_hash_ref)[32] = &script_hash_arr;
LDKShutdownScript ret_var = ShutdownScript_new_p2wsh(script_hash_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
void* orig_ptr = (void*)(((uint64_t)orig) & ~1);
if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); }
LDKType* orig_conv = (LDKType*)orig_ptr;
- LDKType* ret_ret =MALLOC(sizeof(LDKType), "LDKType");
+ LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType");
*ret_ret = Type_clone(orig_conv);
return (uint64_t)ret_ret;
}
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);
+ 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.
+ 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;
+ 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));
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKNodeId ret_var = NodeId_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK(*((uint32_t*)pubkey) == 33);
memcpy(pubkey_ref.compressed_form, (uint8_t*)(pubkey + 4), 33);
LDKNodeId ret_var = NodeId_from_pubkey(pubkey_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKNetworkGraph ret_var = NetworkGraph_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKNetGraphMsgHandler this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKEventHandler* ret_ret =MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
+ LDKEventHandler* ret_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
*ret_ret = NetGraphMsgHandler_as_EventHandler(&this_arg_conv);
return (uint64_t)ret_ret;
}
NetGraphMsgHandler_free(this_obj_conv);
}
-uint32_t __attribute__((visibility("default"))) TS_NetGraphMsgHandler_get_network_graph(uint32_t this_ptr) {
- LDKNetGraphMsgHandler this_ptr_conv;
- this_ptr_conv.inner = (void*)(this_ptr & (~1));
- this_ptr_conv.is_owned = false;
- LDKNetworkGraph ret_var = NetGraphMsgHandler_get_network_graph(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
- }
- return ret_ref;
-}
-
-void __attribute__((visibility("default"))) TS_NetGraphMsgHandler_set_network_graph(uint32_t this_ptr, uint32_t val) {
- LDKNetGraphMsgHandler this_ptr_conv;
- this_ptr_conv.inner = (void*)(this_ptr & (~1));
- this_ptr_conv.is_owned = false;
- LDKNetworkGraph val_conv;
- val_conv.inner = (void*)(val & (~1));
- val_conv.is_owned = (val & 1) || (val == 0);
- val_conv = NetworkGraph_clone(&val_conv);
- NetGraphMsgHandler_set_network_graph(&this_ptr_conv, val_conv);
-}
-
uint32_t __attribute__((visibility("default"))) TS_NetGraphMsgHandler_new(uint32_t network_graph, uint32_t chain_access, uint32_t logger) {
LDKNetworkGraph network_graph_conv;
network_graph_conv.inner = (void*)(network_graph & (~1));
- network_graph_conv.is_owned = (network_graph & 1) || (network_graph == 0);
- network_graph_conv = NetworkGraph_clone(&network_graph_conv);
+ network_graph_conv.is_owned = false;
void* chain_access_ptr = (void*)(((uint64_t)chain_access) & ~1);
CHECK_ACCESS(chain_access_ptr);
LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
CHECK_ACCESS(logger_ptr);
LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
- LDKNetGraphMsgHandler ret_var = NetGraphMsgHandler_new(network_graph_conv, chain_access_conv, logger_conv);
+ LDKNetGraphMsgHandler ret_var = NetGraphMsgHandler_new(&network_graph_conv, chain_access_conv, logger_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKNetGraphMsgHandler this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKRoutingMessageHandler* ret_ret =MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
+ LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
*ret_ret = NetGraphMsgHandler_as_RoutingMessageHandler(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKNetGraphMsgHandler this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKMessageSendEventsProvider* ret_ret =MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
+ LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
*ret_ret = NetGraphMsgHandler_as_MessageSendEventsProvider(&this_arg_conv);
return (uint64_t)ret_ret;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKRoutingFees ret_var = DirectionalChannelInfo_get_fees(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKChannelUpdate ret_var = DirectionalChannelInfo_get_last_update_message(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
last_update_message_arg_conv.is_owned = (last_update_message_arg & 1) || (last_update_message_arg == 0);
last_update_message_arg_conv = ChannelUpdate_clone(&last_update_message_arg_conv);
LDKDirectionalChannelInfo ret_var = DirectionalChannelInfo_new(last_update_arg, enabled_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg_conv, fees_arg_conv, last_update_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKDirectionalChannelInfo ret_var = DirectionalChannelInfo_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKChannelFeatures ret_var = ChannelInfo_get_features(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKNodeId ret_var = ChannelInfo_get_node_one(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKDirectionalChannelInfo ret_var = ChannelInfo_get_one_to_two(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKNodeId ret_var = ChannelInfo_get_node_two(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKDirectionalChannelInfo ret_var = ChannelInfo_get_two_to_one(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKChannelAnnouncement ret_var = ChannelInfo_get_announcement_message(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
announcement_message_arg_conv.is_owned = (announcement_message_arg & 1) || (announcement_message_arg == 0);
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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelInfo ret_var = ChannelInfo_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
uint32_t __attribute__((visibility("default"))) TS_RoutingFees_new(int32_t base_msat_arg, int32_t proportional_millionths_arg) {
LDKRoutingFees ret_var = RoutingFees_new(base_msat_arg, proportional_millionths_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKRoutingFees ret_var = RoutingFees_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKNodeFeatures ret_var = NodeAnnouncementInfo_get_features(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKNodeAnnouncement ret_var = NodeAnnouncementInfo_get_announcement_message(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
announcement_message_arg_conv.is_owned = (announcement_message_arg & 1) || (announcement_message_arg == 0);
announcement_message_arg_conv = NodeAnnouncement_clone(&announcement_message_arg_conv);
LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_new(features_arg_conv, last_update_arg, rgb_arg_ref, alias_arg_ref, addresses_arg_constr, 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKRoutingFees ret_var = NodeInfo_get_lowest_inbound_channel_fees(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKNodeAnnouncementInfo ret_var = NodeInfo_get_announcement_info(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
announcement_info_arg_conv.is_owned = (announcement_info_arg & 1) || (announcement_info_arg == 0);
announcement_info_arg_conv = NodeAnnouncementInfo_clone(&announcement_info_arg_conv);
LDKNodeInfo ret_var = NodeInfo_new(channels_arg_constr, lowest_inbound_channel_fees_arg_conv, announcement_info_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKNodeInfo ret_var = NodeInfo_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK(*((uint32_t*)genesis_hash) == 32);
memcpy(genesis_hash_ref.data, (uint8_t*)(genesis_hash + 4), 32);
LDKNetworkGraph ret_var = NetworkGraph_new(genesis_hash_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKReadOnlyNetworkGraph ret_var = NetworkGraph_read_only(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKNodeFeatures ret_var = RouteHop_get_node_features(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKChannelFeatures ret_var = RouteHop_get_channel_features(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
channel_features_arg_conv.is_owned = (channel_features_arg & 1) || (channel_features_arg == 0);
channel_features_arg_conv = ChannelFeatures_clone(&channel_features_arg_conv);
LDKRouteHop ret_var = RouteHop_new(pubkey_arg_ref, node_features_arg_conv, short_channel_id_arg, channel_features_arg_conv, fee_msat_arg, cltv_expiry_delta_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKRouteHop ret_var = RouteHop_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKCVec_CVec_RouteHopZZ ret_var = Route_get_paths(&this_ptr_conv);
- ptrArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native ptrArray Bytes");
+ ptrArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native ptrArray Bytes");
uint32_tArray *ret_arr_ptr = (uint32_tArray*)(ret_arr + 4);
for (size_t m = 0; m < ret_var.datalen; m++) {
LDKCVec_RouteHopZ ret_conv_12_var = ret_var.data[m];
- uint32_tArray ret_conv_12_arr = init_arr(ret_conv_12_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray ret_conv_12_arr = NULL;
+ ret_conv_12_arr = init_arr(ret_conv_12_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_conv_12_arr_ptr = (uint32_t*)(ret_conv_12_arr + 4);
for (size_t k = 0; k < ret_conv_12_var.datalen; k++) {
LDKRouteHop ret_conv_12_conv_10_var = ret_conv_12_var.data[k];
+ uint64_t ret_conv_12_conv_10_ref = 0;
CHECK((((uint64_t)ret_conv_12_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_conv_12_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t ret_conv_12_conv_10_ref = (uint64_t)ret_conv_12_conv_10_var.inner;
+ ret_conv_12_conv_10_ref = (uint64_t)ret_conv_12_conv_10_var.inner;
if (ret_conv_12_conv_10_var.is_owned) {
ret_conv_12_conv_10_ref |= 1;
}
ret_conv_12_arr_ptr[k] = ret_conv_12_conv_10_ref;
}
+
FREE(ret_conv_12_var.data);
ret_arr_ptr[m] = ret_conv_12_arr;
}
+
FREE(ret_var.data);
return ret_arr;
}
Route_set_paths(&this_ptr_conv, val_constr);
}
-uint32_t __attribute__((visibility("default"))) TS_Route_new(ptrArray paths_arg) {
+uint32_t __attribute__((visibility("default"))) TS_Route_get_payee(uint32_t this_ptr) {
+ LDKRoute this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKPayee ret_var = Route_get_payee(&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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ }
+ return ret_ref;
+}
+
+void __attribute__((visibility("default"))) TS_Route_set_payee(uint32_t this_ptr, uint32_t val) {
+ LDKRoute this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKPayee val_conv;
+ val_conv.inner = (void*)(val & (~1));
+ val_conv.is_owned = (val & 1) || (val == 0);
+ val_conv = Payee_clone(&val_conv);
+ Route_set_payee(&this_ptr_conv, val_conv);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_Route_new(ptrArray paths_arg, uint32_t payee_arg) {
LDKCVec_CVec_RouteHopZZ paths_arg_constr;
paths_arg_constr.datalen = *((uint32_t*)paths_arg);
if (paths_arg_constr.datalen > 0)
}
paths_arg_constr.data[m] = paths_arg_conv_12_constr;
}
- LDKRoute ret_var = Route_new(paths_arg_constr);
+ LDKPayee payee_arg_conv;
+ payee_arg_conv.inner = (void*)(payee_arg & (~1));
+ payee_arg_conv.is_owned = (payee_arg & 1) || (payee_arg == 0);
+ payee_arg_conv = Payee_clone(&payee_arg_conv);
+ LDKRoute ret_var = Route_new(paths_arg_constr, payee_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKRoute ret_var = Route_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
return (uint64_t)ret_conv;
}
-void __attribute__((visibility("default"))) TS_RouteHint_free(uint32_t this_obj) {
- LDKRouteHint this_obj_conv;
+void __attribute__((visibility("default"))) TS_RouteParameters_free(uint32_t this_obj) {
+ LDKRouteParameters this_obj_conv;
+ this_obj_conv.inner = (void*)(this_obj & (~1));
+ this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+ RouteParameters_free(this_obj_conv);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_RouteParameters_get_payee(uint32_t this_ptr) {
+ LDKRouteParameters this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKPayee ret_var = RouteParameters_get_payee(&this_ptr_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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
+void __attribute__((visibility("default"))) TS_RouteParameters_set_payee(uint32_t this_ptr, uint32_t val) {
+ LDKRouteParameters this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKPayee val_conv;
+ val_conv.inner = (void*)(val & (~1));
+ val_conv.is_owned = (val & 1) || (val == 0);
+ val_conv = Payee_clone(&val_conv);
+ RouteParameters_set_payee(&this_ptr_conv, val_conv);
+}
+
+int64_t __attribute__((visibility("default"))) TS_RouteParameters_get_final_value_msat(uint32_t this_ptr) {
+ LDKRouteParameters this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ int64_t ret_val = RouteParameters_get_final_value_msat(&this_ptr_conv);
+ return ret_val;
+}
+
+void __attribute__((visibility("default"))) TS_RouteParameters_set_final_value_msat(uint32_t this_ptr, int64_t val) {
+ LDKRouteParameters this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ RouteParameters_set_final_value_msat(&this_ptr_conv, val);
+}
+
+int32_t __attribute__((visibility("default"))) TS_RouteParameters_get_final_cltv_expiry_delta(uint32_t this_ptr) {
+ LDKRouteParameters this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ int32_t ret_val = RouteParameters_get_final_cltv_expiry_delta(&this_ptr_conv);
+ return ret_val;
+}
+
+void __attribute__((visibility("default"))) TS_RouteParameters_set_final_cltv_expiry_delta(uint32_t this_ptr, int32_t val) {
+ LDKRouteParameters this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ RouteParameters_set_final_cltv_expiry_delta(&this_ptr_conv, val);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_RouteParameters_new(uint32_t payee_arg, int64_t final_value_msat_arg, int32_t final_cltv_expiry_delta_arg) {
+ LDKPayee payee_arg_conv;
+ payee_arg_conv.inner = (void*)(payee_arg & (~1));
+ payee_arg_conv.is_owned = (payee_arg & 1) || (payee_arg == 0);
+ payee_arg_conv = Payee_clone(&payee_arg_conv);
+ LDKRouteParameters ret_var = RouteParameters_new(payee_arg_conv, final_value_msat_arg, final_cltv_expiry_delta_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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_RouteParameters_clone(uint32_t orig) {
+ LDKRouteParameters orig_conv;
+ orig_conv.inner = (void*)(orig & (~1));
+ orig_conv.is_owned = false;
+ LDKRouteParameters ret_var = RouteParameters_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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
+int8_tArray __attribute__((visibility("default"))) TS_RouteParameters_write(uint32_t obj) {
+ LDKRouteParameters obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z ret_var = RouteParameters_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_RouteParameters_read(int8_tArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = *((uint32_t*)ser);
+ ser_ref.data = (int8_t*)(ser + 4);
+ LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
+ *ret_conv = RouteParameters_read(ser_ref);
+ return (uint64_t)ret_conv;
+}
+
+void __attribute__((visibility("default"))) TS_Payee_free(uint32_t this_obj) {
+ LDKPayee this_obj_conv;
+ this_obj_conv.inner = (void*)(this_obj & (~1));
+ this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+ Payee_free(this_obj_conv);
+}
+
+int8_tArray __attribute__((visibility("default"))) TS_Payee_get_pubkey(uint32_t this_ptr) {
+ LDKPayee this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), Payee_get_pubkey(&this_ptr_conv).compressed_form, 33);
+ return ret_arr;
+}
+
+void __attribute__((visibility("default"))) TS_Payee_set_pubkey(uint32_t this_ptr, int8_tArray val) {
+ LDKPayee this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKPublicKey val_ref;
+ CHECK(*((uint32_t*)val) == 33);
+ memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33);
+ Payee_set_pubkey(&this_ptr_conv, val_ref);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_Payee_get_features(uint32_t this_ptr) {
+ LDKPayee this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKInvoiceFeatures ret_var = Payee_get_features(&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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ }
+ return ret_ref;
+}
+
+void __attribute__((visibility("default"))) TS_Payee_set_features(uint32_t this_ptr, uint32_t val) {
+ LDKPayee this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKInvoiceFeatures val_conv;
+ val_conv.inner = (void*)(val & (~1));
+ val_conv.is_owned = (val & 1) || (val == 0);
+ val_conv = InvoiceFeatures_clone(&val_conv);
+ Payee_set_features(&this_ptr_conv, val_conv);
+}
+
+uint32_tArray __attribute__((visibility("default"))) TS_Payee_get_route_hints(uint32_t this_ptr) {
+ LDKPayee this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKCVec_RouteHintZ ret_var = Payee_get_route_hints(&this_ptr_conv);
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
+ for (size_t l = 0; l < ret_var.datalen; l++) {
+ LDKRouteHint ret_conv_11_var = ret_var.data[l];
+ uint64_t ret_conv_11_ref = 0;
+ CHECK((((uint64_t)ret_conv_11_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&ret_conv_11_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ ret_conv_11_ref = (uint64_t)ret_conv_11_var.inner;
+ if (ret_conv_11_var.is_owned) {
+ ret_conv_11_ref |= 1;
+ }
+ ret_arr_ptr[l] = ret_conv_11_ref;
+ }
+
+ FREE(ret_var.data);
+ return ret_arr;
+}
+
+void __attribute__((visibility("default"))) TS_Payee_set_route_hints(uint32_t this_ptr, uint32_tArray val) {
+ LDKPayee this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKCVec_RouteHintZ val_constr;
+ val_constr.datalen = *((uint32_t*)val);
+ if (val_constr.datalen > 0)
+ val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
+ else
+ val_constr.data = NULL;
+ uint32_t* val_vals = (uint32_t*)(val + 4);
+ for (size_t l = 0; l < val_constr.datalen; l++) {
+ uint32_t val_conv_11 = val_vals[l];
+ LDKRouteHint val_conv_11_conv;
+ val_conv_11_conv.inner = (void*)(val_conv_11 & (~1));
+ val_conv_11_conv.is_owned = (val_conv_11 & 1) || (val_conv_11 == 0);
+ val_conv_11_conv = RouteHint_clone(&val_conv_11_conv);
+ val_constr.data[l] = val_conv_11_conv;
+ }
+ Payee_set_route_hints(&this_ptr_conv, val_constr);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_Payee_get_expiry_time(uint32_t this_ptr) {
+ LDKPayee this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
+ *ret_copy = Payee_get_expiry_time(&this_ptr_conv);
+ uint64_t ret_ref = (uint64_t)ret_copy;
+ return ret_ref;
+}
+
+void __attribute__((visibility("default"))) TS_Payee_set_expiry_time(uint32_t this_ptr, uint32_t val) {
+ LDKPayee this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
+ val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)val) & ~1));
+ Payee_set_expiry_time(&this_ptr_conv, val_conv);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_Payee_new(int8_tArray pubkey_arg, uint32_t features_arg, uint32_tArray route_hints_arg, uint32_t expiry_time_arg) {
+ LDKPublicKey pubkey_arg_ref;
+ CHECK(*((uint32_t*)pubkey_arg) == 33);
+ memcpy(pubkey_arg_ref.compressed_form, (uint8_t*)(pubkey_arg + 4), 33);
+ LDKInvoiceFeatures features_arg_conv;
+ features_arg_conv.inner = (void*)(features_arg & (~1));
+ features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0);
+ features_arg_conv = InvoiceFeatures_clone(&features_arg_conv);
+ LDKCVec_RouteHintZ route_hints_arg_constr;
+ route_hints_arg_constr.datalen = *((uint32_t*)route_hints_arg);
+ if (route_hints_arg_constr.datalen > 0)
+ route_hints_arg_constr.data = MALLOC(route_hints_arg_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
+ else
+ route_hints_arg_constr.data = NULL;
+ uint32_t* route_hints_arg_vals = (uint32_t*)(route_hints_arg + 4);
+ for (size_t l = 0; l < route_hints_arg_constr.datalen; l++) {
+ uint32_t route_hints_arg_conv_11 = route_hints_arg_vals[l];
+ LDKRouteHint route_hints_arg_conv_11_conv;
+ route_hints_arg_conv_11_conv.inner = (void*)(route_hints_arg_conv_11 & (~1));
+ route_hints_arg_conv_11_conv.is_owned = (route_hints_arg_conv_11 & 1) || (route_hints_arg_conv_11 == 0);
+ route_hints_arg_conv_11_conv = RouteHint_clone(&route_hints_arg_conv_11_conv);
+ route_hints_arg_constr.data[l] = route_hints_arg_conv_11_conv;
+ }
+ void* expiry_time_arg_ptr = (void*)(((uint64_t)expiry_time_arg) & ~1);
+ CHECK_ACCESS(expiry_time_arg_ptr);
+ LDKCOption_u64Z expiry_time_arg_conv = *(LDKCOption_u64Z*)(expiry_time_arg_ptr);
+ expiry_time_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)expiry_time_arg) & ~1));
+ LDKPayee ret_var = Payee_new(pubkey_arg_ref, features_arg_conv, route_hints_arg_constr, expiry_time_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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_Payee_clone(uint32_t orig) {
+ LDKPayee orig_conv;
+ orig_conv.inner = (void*)(orig & (~1));
+ orig_conv.is_owned = false;
+ LDKPayee ret_var = Payee_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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
+int64_t __attribute__((visibility("default"))) TS_Payee_hash(uint32_t o) {
+ LDKPayee o_conv;
+ o_conv.inner = (void*)(o & (~1));
+ o_conv.is_owned = false;
+ int64_t ret_val = Payee_hash(&o_conv);
+ return ret_val;
+}
+
+jboolean __attribute__((visibility("default"))) TS_Payee_eq(uint32_t a, uint32_t b) {
+ LDKPayee a_conv;
+ a_conv.inner = (void*)(a & (~1));
+ a_conv.is_owned = false;
+ LDKPayee b_conv;
+ b_conv.inner = (void*)(b & (~1));
+ b_conv.is_owned = false;
+ jboolean ret_val = Payee_eq(&a_conv, &b_conv);
+ return ret_val;
+}
+
+int8_tArray __attribute__((visibility("default"))) TS_Payee_write(uint32_t obj) {
+ LDKPayee obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z ret_var = Payee_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_Payee_read(int8_tArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = *((uint32_t*)ser);
+ ser_ref.data = (int8_t*)(ser + 4);
+ LDKCResult_PayeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeeDecodeErrorZ), "LDKCResult_PayeeDecodeErrorZ");
+ *ret_conv = Payee_read(ser_ref);
+ return (uint64_t)ret_conv;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_Payee_from_node_id(int8_tArray pubkey) {
+ LDKPublicKey pubkey_ref;
+ CHECK(*((uint32_t*)pubkey) == 33);
+ memcpy(pubkey_ref.compressed_form, (uint8_t*)(pubkey + 4), 33);
+ LDKPayee ret_var = Payee_from_node_id(pubkey_ref);
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_Payee_for_keysend(int8_tArray pubkey) {
+ LDKPublicKey pubkey_ref;
+ CHECK(*((uint32_t*)pubkey) == 33);
+ memcpy(pubkey_ref.compressed_form, (uint8_t*)(pubkey + 4), 33);
+ LDKPayee ret_var = Payee_for_keysend(pubkey_ref);
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
+void __attribute__((visibility("default"))) TS_RouteHint_free(uint32_t this_obj) {
+ LDKRouteHint this_obj_conv;
this_obj_conv.inner = (void*)(this_obj & (~1));
this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
RouteHint_free(this_obj_conv);
}
+uint32_tArray __attribute__((visibility("default"))) TS_RouteHint_get_a(uint32_t this_ptr) {
+ LDKRouteHint this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKCVec_RouteHintHopZ ret_var = RouteHint_get_a(&this_ptr_conv);
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
+ for (size_t o = 0; o < ret_var.datalen; o++) {
+ LDKRouteHintHop ret_conv_14_var = ret_var.data[o];
+ uint64_t ret_conv_14_ref = 0;
+ CHECK((((uint64_t)ret_conv_14_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&ret_conv_14_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ ret_conv_14_ref = (uint64_t)ret_conv_14_var.inner;
+ if (ret_conv_14_var.is_owned) {
+ ret_conv_14_ref |= 1;
+ }
+ ret_arr_ptr[o] = ret_conv_14_ref;
+ }
+
+ FREE(ret_var.data);
+ return ret_arr;
+}
+
+void __attribute__((visibility("default"))) TS_RouteHint_set_a(uint32_t this_ptr, uint32_tArray val) {
+ LDKRouteHint this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKCVec_RouteHintHopZ val_constr;
+ val_constr.datalen = *((uint32_t*)val);
+ if (val_constr.datalen > 0)
+ val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements");
+ else
+ val_constr.data = NULL;
+ uint32_t* val_vals = (uint32_t*)(val + 4);
+ for (size_t o = 0; o < val_constr.datalen; o++) {
+ uint32_t val_conv_14 = val_vals[o];
+ LDKRouteHintHop val_conv_14_conv;
+ val_conv_14_conv.inner = (void*)(val_conv_14 & (~1));
+ val_conv_14_conv.is_owned = (val_conv_14 & 1) || (val_conv_14 == 0);
+ val_conv_14_conv = RouteHintHop_clone(&val_conv_14_conv);
+ val_constr.data[o] = val_conv_14_conv;
+ }
+ RouteHint_set_a(&this_ptr_conv, val_constr);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_RouteHint_new(uint32_tArray a_arg) {
+ LDKCVec_RouteHintHopZ a_arg_constr;
+ a_arg_constr.datalen = *((uint32_t*)a_arg);
+ if (a_arg_constr.datalen > 0)
+ a_arg_constr.data = MALLOC(a_arg_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements");
+ else
+ a_arg_constr.data = NULL;
+ uint32_t* a_arg_vals = (uint32_t*)(a_arg + 4);
+ for (size_t o = 0; o < a_arg_constr.datalen; o++) {
+ uint32_t a_arg_conv_14 = a_arg_vals[o];
+ LDKRouteHintHop a_arg_conv_14_conv;
+ a_arg_conv_14_conv.inner = (void*)(a_arg_conv_14 & (~1));
+ a_arg_conv_14_conv.is_owned = (a_arg_conv_14 & 1) || (a_arg_conv_14 == 0);
+ a_arg_conv_14_conv = RouteHintHop_clone(&a_arg_conv_14_conv);
+ a_arg_constr.data[o] = a_arg_conv_14_conv;
+ }
+ LDKRouteHint ret_var = RouteHint_new(a_arg_constr);
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
uint32_t __attribute__((visibility("default"))) TS_RouteHint_clone(uint32_t orig) {
LDKRouteHint orig_conv;
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKRouteHint ret_var = RouteHint_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
return ret_val;
}
+int8_tArray __attribute__((visibility("default"))) TS_RouteHint_write(uint32_t obj) {
+ LDKRouteHint obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z ret_var = RouteHint_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_RouteHint_read(int8_tArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = *((uint32_t*)ser);
+ ser_ref.data = (int8_t*)(ser + 4);
+ LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
+ *ret_conv = RouteHint_read(ser_ref);
+ return (uint64_t)ret_conv;
+}
+
void __attribute__((visibility("default"))) TS_RouteHintHop_free(uint32_t this_obj) {
LDKRouteHintHop this_obj_conv;
this_obj_conv.inner = (void*)(this_obj & (~1));
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKRoutingFees ret_var = RouteHintHop_get_fees(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKCOption_u64Z htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_maximum_msat_arg_ptr);
htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)htlc_maximum_msat_arg) & ~1));
LDKRouteHintHop ret_var = RouteHintHop_new(src_node_id_arg_ref, short_channel_id_arg, fees_arg_conv, cltv_expiry_delta_arg, htlc_minimum_msat_arg_conv, htlc_maximum_msat_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKRouteHintHop ret_var = RouteHintHop_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
return ret_val;
}
-uint32_t __attribute__((visibility("default"))) TS_get_keysend_route(int8_tArray our_node_pubkey, uint32_t network, int8_tArray payee, uint32_tArray first_hops, uint32_tArray last_hops, int64_t final_value_msat, int32_t final_cltv, uint32_t logger, uint32_t scorer) {
- LDKPublicKey our_node_pubkey_ref;
- CHECK(*((uint32_t*)our_node_pubkey) == 33);
- memcpy(our_node_pubkey_ref.compressed_form, (uint8_t*)(our_node_pubkey + 4), 33);
- LDKNetworkGraph network_conv;
- network_conv.inner = (void*)(network & (~1));
- network_conv.is_owned = false;
- LDKPublicKey payee_ref;
- CHECK(*((uint32_t*)payee) == 33);
- memcpy(payee_ref.compressed_form, (uint8_t*)(payee + 4), 33);
- LDKCVec_ChannelDetailsZ first_hops_constr;
- LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL;
- if (first_hops != 0) {
- first_hops_constr.datalen = *((uint32_t*)first_hops);
- if (first_hops_constr.datalen > 0)
- first_hops_constr.data = MALLOC(first_hops_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
- else
- first_hops_constr.data = NULL;
- uint32_t* first_hops_vals = (uint32_t*)(first_hops + 4);
- for (size_t q = 0; q < first_hops_constr.datalen; q++) {
- uint32_t first_hops_conv_16 = first_hops_vals[q];
- LDKChannelDetails first_hops_conv_16_conv;
- first_hops_conv_16_conv.inner = (void*)(first_hops_conv_16 & (~1));
- first_hops_conv_16_conv.is_owned = (first_hops_conv_16 & 1) || (first_hops_conv_16 == 0);
- first_hops_constr.data[q] = first_hops_conv_16_conv;
- }
- first_hops_ptr = &first_hops_constr;
- }
- LDKCVec_RouteHintZ last_hops_constr;
- last_hops_constr.datalen = *((uint32_t*)last_hops);
- if (last_hops_constr.datalen > 0)
- last_hops_constr.data = MALLOC(last_hops_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
- else
- last_hops_constr.data = NULL;
- uint32_t* last_hops_vals = (uint32_t*)(last_hops + 4);
- for (size_t l = 0; l < last_hops_constr.datalen; l++) {
- uint32_t last_hops_conv_11 = last_hops_vals[l];
- LDKRouteHint last_hops_conv_11_conv;
- last_hops_conv_11_conv.inner = (void*)(last_hops_conv_11 & (~1));
- last_hops_conv_11_conv.is_owned = (last_hops_conv_11 & 1) || (last_hops_conv_11 == 0);
- last_hops_conv_11_conv = RouteHint_clone(&last_hops_conv_11_conv);
- last_hops_constr.data[l] = last_hops_conv_11_conv;
- }
- void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
- CHECK_ACCESS(logger_ptr);
- LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
- void* scorer_ptr = (void*)(((uint64_t)scorer) & ~1);
- 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 = get_keysend_route(our_node_pubkey_ref, &network_conv, payee_ref, first_hops_ptr, last_hops_constr, final_value_msat, final_cltv, logger_conv, scorer_conv);
- if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
+int8_tArray __attribute__((visibility("default"))) TS_RouteHintHop_write(uint32_t obj) {
+ LDKRouteHintHop obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z ret_var = RouteHintHop_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_RouteHintHop_read(int8_tArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = *((uint32_t*)ser);
+ ser_ref.data = (int8_t*)(ser + 4);
+ LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
+ *ret_conv = RouteHintHop_read(ser_ref);
return (uint64_t)ret_conv;
}
-uint32_t __attribute__((visibility("default"))) TS_get_route(int8_tArray our_node_pubkey, uint32_t network, int8_tArray payee, uint32_t payee_features, uint32_tArray first_hops, uint32_tArray last_hops, int64_t final_value_msat, int32_t final_cltv, uint32_t logger, uint32_t scorer) {
+uint32_t __attribute__((visibility("default"))) TS_find_route(int8_tArray our_node_pubkey, uint32_t params, uint32_t network, uint32_tArray first_hops, uint32_t logger, uint32_t scorer) {
LDKPublicKey our_node_pubkey_ref;
CHECK(*((uint32_t*)our_node_pubkey) == 33);
memcpy(our_node_pubkey_ref.compressed_form, (uint8_t*)(our_node_pubkey + 4), 33);
+ LDKRouteParameters params_conv;
+ params_conv.inner = (void*)(params & (~1));
+ params_conv.is_owned = false;
LDKNetworkGraph network_conv;
network_conv.inner = (void*)(network & (~1));
network_conv.is_owned = false;
- LDKPublicKey payee_ref;
- CHECK(*((uint32_t*)payee) == 33);
- memcpy(payee_ref.compressed_form, (uint8_t*)(payee + 4), 33);
- LDKInvoiceFeatures payee_features_conv;
- payee_features_conv.inner = (void*)(payee_features & (~1));
- payee_features_conv.is_owned = (payee_features & 1) || (payee_features == 0);
- payee_features_conv = InvoiceFeatures_clone(&payee_features_conv);
LDKCVec_ChannelDetailsZ first_hops_constr;
LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL;
if (first_hops != 0) {
}
first_hops_ptr = &first_hops_constr;
}
- LDKCVec_RouteHintZ last_hops_constr;
- last_hops_constr.datalen = *((uint32_t*)last_hops);
- if (last_hops_constr.datalen > 0)
- last_hops_constr.data = MALLOC(last_hops_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
- else
- last_hops_constr.data = NULL;
- uint32_t* last_hops_vals = (uint32_t*)(last_hops + 4);
- for (size_t l = 0; l < last_hops_constr.datalen; l++) {
- uint32_t last_hops_conv_11 = last_hops_vals[l];
- LDKRouteHint last_hops_conv_11_conv;
- last_hops_conv_11_conv.inner = (void*)(last_hops_conv_11 & (~1));
- last_hops_conv_11_conv.is_owned = (last_hops_conv_11 & 1) || (last_hops_conv_11 == 0);
- last_hops_conv_11_conv = RouteHint_clone(&last_hops_conv_11_conv);
- last_hops_constr.data[l] = last_hops_conv_11_conv;
- }
void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
CHECK_ACCESS(logger_ptr);
LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
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 = get_route(our_node_pubkey_ref, &network_conv, payee_ref, payee_features_conv, first_hops_ptr, last_hops_constr, final_value_msat, final_cltv, logger_conv, scorer_conv);
+ *ret_conv = find_route(our_node_pubkey_ref, ¶ms_conv, &network_conv, first_hops_ptr, logger_conv, scorer_conv);
if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
return (uint64_t)ret_conv;
}
Scorer_free(this_obj_conv);
}
-uint32_t __attribute__((visibility("default"))) TS_Scorer_new(int64_t base_penalty_msat) {
- LDKScorer ret_var = Scorer_new(base_penalty_msat);
+void __attribute__((visibility("default"))) TS_ScoringParameters_free(uint32_t this_obj) {
+ LDKScoringParameters this_obj_conv;
+ this_obj_conv.inner = (void*)(this_obj & (~1));
+ this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+ ScoringParameters_free(this_obj_conv);
+}
+
+int64_t __attribute__((visibility("default"))) TS_ScoringParameters_get_base_penalty_msat(uint32_t this_ptr) {
+ LDKScoringParameters this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ int64_t ret_val = ScoringParameters_get_base_penalty_msat(&this_ptr_conv);
+ return ret_val;
+}
+
+void __attribute__((visibility("default"))) TS_ScoringParameters_set_base_penalty_msat(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;
+ ScoringParameters_set_base_penalty_msat(&this_ptr_conv, val);
+}
+
+int64_t __attribute__((visibility("default"))) TS_ScoringParameters_get_failure_penalty_msat(uint32_t this_ptr) {
+ LDKScoringParameters this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ int64_t ret_val = ScoringParameters_get_failure_penalty_msat(&this_ptr_conv);
+ return ret_val;
+}
+
+void __attribute__((visibility("default"))) TS_ScoringParameters_set_failure_penalty_msat(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;
+ ScoringParameters_set_failure_penalty_msat(&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));
+ this_ptr_conv.is_owned = false;
+ int64_t ret_val = ScoringParameters_get_failure_penalty_half_life(&this_ptr_conv);
+ return ret_val;
+}
+
+void __attribute__((visibility("default"))) TS_ScoringParameters_set_failure_penalty_half_life(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;
+ 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);
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
+int8_tArray __attribute__((visibility("default"))) TS_ScoringParameters_write(uint32_t obj) {
+ LDKScoringParameters obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z ret_var = ScoringParameters_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_ScoringParameters_read(int8_tArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = *((uint32_t*)ser);
+ ser_ref.data = (int8_t*)(ser + 4);
+ LDKCResult_ScoringParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScoringParametersDecodeErrorZ), "LDKCResult_ScoringParametersDecodeErrorZ");
+ *ret_conv = ScoringParameters_read(ser_ref);
+ return (uint64_t)ret_conv;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_Scorer_new(uint32_t params) {
+ LDKScoringParameters params_conv;
+ params_conv.inner = (void*)(params & (~1));
+ params_conv.is_owned = (params & 1) || (params == 0);
+ // Warning: we need a move here but no clone is available for LDKScoringParameters
+ LDKScorer ret_var = Scorer_new(params_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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_Scorer_default() {
+ LDKScorer ret_var = Scorer_default();
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
return ret_ref;
}
-uint32_t __attribute__((visibility("default"))) TS_Scorer_default() {
- LDKScorer ret_var = Scorer_default();
+uint32_t __attribute__((visibility("default"))) TS_ScoringParameters_default() {
+ LDKScoringParameters ret_var = ScoringParameters_default();
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKScorer this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKScore* ret_ret =MALLOC(sizeof(LDKScore), "LDKScore");
+ LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore");
*ret_ret = Scorer_as_Score(&this_arg_conv);
return (uint64_t)ret_ret;
}
+int8_tArray __attribute__((visibility("default"))) TS_Scorer_write(uint32_t obj) {
+ LDKScorer obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z ret_var = Scorer_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_Scorer_read(int8_tArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = *((uint32_t*)ser);
+ ser_ref.data = (int8_t*)(ser + 4);
+ LDKCResult_ScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScorerDecodeErrorZ), "LDKCResult_ScorerDecodeErrorZ");
+ *ret_conv = Scorer_read(ser_ref);
+ return (uint64_t)ret_conv;
+}
+
void __attribute__((visibility("default"))) TS_FilesystemPersister_free(uint32_t this_obj) {
LDKFilesystemPersister this_obj_conv;
this_obj_conv.inner = (void*)(this_obj & (~1));
uint32_t __attribute__((visibility("default"))) TS_FilesystemPersister_new(jstring path_to_channel_data) {
LDKStr path_to_channel_data_conv = str_ref_to_owned_c(path_to_channel_data);
LDKFilesystemPersister ret_var = FilesystemPersister_new(path_to_channel_data_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKFilesystemPersister this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKPersist* ret_ret =MALLOC(sizeof(LDKPersist), "LDKPersist");
+ LDKPersist* ret_ret = MALLOC(sizeof(LDKPersist), "LDKPersist");
*ret_ret = FilesystemPersister_as_Persist(&this_arg_conv);
return (uint64_t)ret_ret;
}
CHECK_ACCESS(logger_ptr);
LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
LDKBackgroundProcessor ret_var = BackgroundProcessor_start(persister_conv, event_handler_conv, &chain_monitor_conv, &channel_manager_conv, net_graph_msg_handler_conv, &peer_manager_conv, logger_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKInvoice ret_var = Invoice_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKSignedRawInvoice ret_var = SignedRawInvoice_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKRawDataPart ret_var = RawInvoice_get_data(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKRawInvoice ret_var = RawInvoice_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKPositiveTimestamp ret_var = RawDataPart_get_timestamp(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKRawDataPart ret_var = RawDataPart_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKPositiveTimestamp ret_var = PositiveTimestamp_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKSha256 ret_var = Sha256_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKDescription ret_var = Description_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
PayeePubKey_free(this_obj_conv);
}
+int8_tArray __attribute__((visibility("default"))) TS_PayeePubKey_get_a(uint32_t this_ptr) {
+ LDKPayeePubKey this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), PayeePubKey_get_a(&this_ptr_conv).compressed_form, 33);
+ return ret_arr;
+}
+
+void __attribute__((visibility("default"))) TS_PayeePubKey_set_a(uint32_t this_ptr, int8_tArray val) {
+ LDKPayeePubKey this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKPublicKey val_ref;
+ CHECK(*((uint32_t*)val) == 33);
+ memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33);
+ PayeePubKey_set_a(&this_ptr_conv, val_ref);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_PayeePubKey_new(int8_tArray a_arg) {
+ LDKPublicKey a_arg_ref;
+ CHECK(*((uint32_t*)a_arg) == 33);
+ memcpy(a_arg_ref.compressed_form, (uint8_t*)(a_arg + 4), 33);
+ LDKPayeePubKey ret_var = PayeePubKey_new(a_arg_ref);
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
uint32_t __attribute__((visibility("default"))) TS_PayeePubKey_clone(uint32_t orig) {
LDKPayeePubKey orig_conv;
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKPayeePubKey ret_var = PayeePubKey_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKExpiryTime ret_var = ExpiryTime_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
MinFinalCltvExpiry_free(this_obj_conv);
}
+int64_t __attribute__((visibility("default"))) TS_MinFinalCltvExpiry_get_a(uint32_t this_ptr) {
+ LDKMinFinalCltvExpiry this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ int64_t ret_val = MinFinalCltvExpiry_get_a(&this_ptr_conv);
+ return ret_val;
+}
+
+void __attribute__((visibility("default"))) TS_MinFinalCltvExpiry_set_a(uint32_t this_ptr, int64_t val) {
+ LDKMinFinalCltvExpiry this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ MinFinalCltvExpiry_set_a(&this_ptr_conv, val);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_MinFinalCltvExpiry_new(int64_t a_arg) {
+ LDKMinFinalCltvExpiry ret_var = MinFinalCltvExpiry_new(a_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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
uint32_t __attribute__((visibility("default"))) TS_MinFinalCltvExpiry_clone(uint32_t orig) {
LDKMinFinalCltvExpiry orig_conv;
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKMinFinalCltvExpiry ret_var = MinFinalCltvExpiry_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKInvoiceSignature ret_var = InvoiceSignature_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKPrivateRoute ret_var = PrivateRoute_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKRawInvoice ret_var = SignedRawInvoice_raw_invoice(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKInvoiceSignature ret_var = SignedRawInvoice_signature(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKSha256 ret_var = RawInvoice_payment_hash(&this_arg_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKDescription ret_var = RawInvoice_description(&this_arg_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKPayeePubKey ret_var = RawInvoice_payee_pub_key(&this_arg_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKSha256 ret_var = RawInvoice_description_hash(&this_arg_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKExpiryTime ret_var = RawInvoice_expiry_time(&this_arg_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKMinFinalCltvExpiry ret_var = RawInvoice_min_final_cltv_expiry(&this_arg_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKInvoiceFeatures ret_var = RawInvoice_features(&this_arg_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCVec_PrivateRouteZ ret_var = RawInvoice_private_routes(&this_arg_conv);
- uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t o = 0; o < ret_var.datalen; o++) {
LDKPrivateRoute ret_conv_14_var = ret_var.data[o];
+ uint64_t ret_conv_14_ref = 0;
CHECK((((uint64_t)ret_conv_14_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_conv_14_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t ret_conv_14_ref = (uint64_t)ret_conv_14_var.inner;
+ ret_conv_14_ref = (uint64_t)ret_conv_14_var.inner;
if (ret_conv_14_var.is_owned) {
ret_conv_14_ref |= 1;
}
ret_arr_ptr[o] = ret_conv_14_ref;
}
+
FREE(ret_var.data);
return ret_arr;
}
this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
this_arg_conv = Invoice_clone(&this_arg_conv);
LDKSignedRawInvoice ret_var = Invoice_into_signed_raw(this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(ret_arr + 4), Invoice_payment_secret(&this_arg_conv).data, 32);
+ memcpy((uint8_t*)(ret_arr + 4), *Invoice_payment_secret(&this_arg_conv), 32);
return ret_arr;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKInvoiceFeatures ret_var = Invoice_features(&this_arg_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
return ret_val;
}
+jboolean __attribute__((visibility("default"))) TS_Invoice_is_expired(uint32_t this_arg) {
+ LDKInvoice this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ jboolean ret_val = Invoice_is_expired(&this_arg_conv);
+ return ret_val;
+}
+
int64_t __attribute__((visibility("default"))) TS_Invoice_min_final_cltv_expiry(uint32_t this_arg) {
LDKInvoice this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCVec_PrivateRouteZ ret_var = Invoice_private_routes(&this_arg_conv);
- uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t o = 0; o < ret_var.datalen; o++) {
LDKPrivateRoute ret_conv_14_var = ret_var.data[o];
+ uint64_t ret_conv_14_ref = 0;
CHECK((((uint64_t)ret_conv_14_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_conv_14_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t ret_conv_14_ref = (uint64_t)ret_conv_14_var.inner;
+ ret_conv_14_ref = (uint64_t)ret_conv_14_var.inner;
if (ret_conv_14_var.is_owned) {
ret_conv_14_ref |= 1;
}
ret_arr_ptr[o] = ret_conv_14_ref;
}
+
FREE(ret_var.data);
return ret_arr;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCVec_RouteHintZ ret_var = Invoice_route_hints(&this_arg_conv);
- uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t l = 0; l < ret_var.datalen; l++) {
LDKRouteHint ret_conv_11_var = ret_var.data[l];
+ uint64_t ret_conv_11_ref = 0;
CHECK((((uint64_t)ret_conv_11_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_conv_11_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t ret_conv_11_ref = (uint64_t)ret_conv_11_var.inner;
+ ret_conv_11_ref = (uint64_t)ret_conv_11_var.inner;
if (ret_conv_11_var.is_owned) {
ret_conv_11_ref |= 1;
}
ret_arr_ptr[l] = ret_conv_11_ref;
}
+
FREE(ret_var.data);
return ret_arr;
}
return ret_conv;
}
-uint32_t __attribute__((visibility("default"))) TS_Invoice_amount_pico_btc(uint32_t this_arg) {
+uint32_t __attribute__((visibility("default"))) TS_Invoice_amount_milli_satoshis(uint32_t this_arg) {
LDKInvoice this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
- *ret_copy = Invoice_amount_pico_btc(&this_arg_conv);
+ *ret_copy = Invoice_amount_milli_satoshis(&this_arg_conv);
uint64_t ret_ref = (uint64_t)ret_copy;
return ret_ref;
}
this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
this_arg_conv = PrivateRoute_clone(&this_arg_conv);
LDKRouteHint ret_var = PrivateRoute_into_inner(this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
return ret_conv;
}
+void __attribute__((visibility("default"))) TS_InvoicePayer_free(uint32_t this_obj) {
+ LDKInvoicePayer this_obj_conv;
+ this_obj_conv.inner = (void*)(this_obj & (~1));
+ this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+ InvoicePayer_free(this_obj_conv);
+}
+
+void __attribute__((visibility("default"))) TS_Payer_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);
+ LDKPayer this_ptr_conv = *(LDKPayer*)(this_ptr_ptr);
+ FREE((void*)this_ptr);
+ Payer_free(this_ptr_conv);
+}
+
+void __attribute__((visibility("default"))) TS_Router_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);
+ LDKRouter this_ptr_conv = *(LDKRouter*)(this_ptr_ptr);
+ FREE((void*)this_ptr);
+ Router_free(this_ptr_conv);
+}
+
+void __attribute__((visibility("default"))) TS_RetryAttempts_free(uint32_t this_obj) {
+ LDKRetryAttempts this_obj_conv;
+ this_obj_conv.inner = (void*)(this_obj & (~1));
+ this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+ RetryAttempts_free(this_obj_conv);
+}
+
+int64_t __attribute__((visibility("default"))) TS_RetryAttempts_get_a(uint32_t this_ptr) {
+ LDKRetryAttempts this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ int64_t ret_val = RetryAttempts_get_a(&this_ptr_conv);
+ return ret_val;
+}
+
+void __attribute__((visibility("default"))) TS_RetryAttempts_set_a(uint32_t this_ptr, int64_t val) {
+ LDKRetryAttempts this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ RetryAttempts_set_a(&this_ptr_conv, val);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_RetryAttempts_new(int64_t a_arg) {
+ LDKRetryAttempts ret_var = RetryAttempts_new(a_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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_RetryAttempts_clone(uint32_t orig) {
+ LDKRetryAttempts orig_conv;
+ orig_conv.inner = (void*)(orig & (~1));
+ orig_conv.is_owned = false;
+ LDKRetryAttempts ret_var = RetryAttempts_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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
+jboolean __attribute__((visibility("default"))) TS_RetryAttempts_eq(uint32_t a, uint32_t b) {
+ LDKRetryAttempts a_conv;
+ a_conv.inner = (void*)(a & (~1));
+ a_conv.is_owned = false;
+ LDKRetryAttempts b_conv;
+ b_conv.inner = (void*)(b & (~1));
+ b_conv.is_owned = false;
+ jboolean ret_val = RetryAttempts_eq(&a_conv, &b_conv);
+ return ret_val;
+}
+
+int64_t __attribute__((visibility("default"))) TS_RetryAttempts_hash(uint32_t o) {
+ LDKRetryAttempts o_conv;
+ o_conv.inner = (void*)(o & (~1));
+ o_conv.is_owned = false;
+ int64_t ret_val = RetryAttempts_hash(&o_conv);
+ return ret_val;
+}
+
+void __attribute__((visibility("default"))) TS_PaymentError_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);
+ LDKPaymentError this_ptr_conv = *(LDKPaymentError*)(this_ptr_ptr);
+ FREE((void*)this_ptr);
+ PaymentError_free(this_ptr_conv);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_PaymentError_clone(uint32_t orig) {
+ LDKPaymentError* orig_conv = (LDKPaymentError*)orig;
+ LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
+ *ret_copy = PaymentError_clone(orig_conv);
+ uint64_t ret_ref = (uint64_t)ret_copy;
+ return ret_ref;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_PaymentError_invoice(jstring a) {
+ LDKStr a_conv = str_ref_to_owned_c(a);
+ LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
+ *ret_copy = PaymentError_invoice(a_conv);
+ uint64_t ret_ref = (uint64_t)ret_copy;
+ return ret_ref;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_PaymentError_routing(uint32_t a) {
+ LDKLightningError a_conv;
+ a_conv.inner = (void*)(a & (~1));
+ a_conv.is_owned = (a & 1) || (a == 0);
+ a_conv = LightningError_clone(&a_conv);
+ LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
+ *ret_copy = PaymentError_routing(a_conv);
+ uint64_t ret_ref = (uint64_t)ret_copy;
+ return ret_ref;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_PaymentError_sending(uint32_t a) {
+ void* a_ptr = (void*)(((uint64_t)a) & ~1);
+ CHECK_ACCESS(a_ptr);
+ LDKPaymentSendFailure a_conv = *(LDKPaymentSendFailure*)(a_ptr);
+ a_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)(((uint64_t)a) & ~1));
+ LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
+ *ret_copy = PaymentError_sending(a_conv);
+ uint64_t ret_ref = (uint64_t)ret_copy;
+ return ret_ref;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_InvoicePayer_new(uint32_t payer, uint32_t router, uint32_t scorer, uint32_t logger, uint32_t event_handler, uint32_t retry_attempts) {
+ void* payer_ptr = (void*)(((uint64_t)payer) & ~1);
+ CHECK_ACCESS(payer_ptr);
+ LDKPayer payer_conv = *(LDKPayer*)(payer_ptr);
+ void* router_ptr = (void*)(((uint64_t)router) & ~1);
+ CHECK_ACCESS(router_ptr);
+ LDKRouter router_conv = *(LDKRouter*)(router_ptr);
+ LDKLockableScore scorer_conv;
+ scorer_conv.inner = (void*)(scorer & (~1));
+ scorer_conv.is_owned = false;
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
+ void* event_handler_ptr = (void*)(((uint64_t)event_handler) & ~1);
+ CHECK_ACCESS(event_handler_ptr);
+ LDKEventHandler event_handler_conv = *(LDKEventHandler*)(event_handler_ptr);
+ LDKRetryAttempts retry_attempts_conv;
+ retry_attempts_conv.inner = (void*)(retry_attempts & (~1));
+ retry_attempts_conv.is_owned = (retry_attempts & 1) || (retry_attempts == 0);
+ retry_attempts_conv = RetryAttempts_clone(&retry_attempts_conv);
+ LDKInvoicePayer ret_var = InvoicePayer_new(payer_conv, router_conv, &scorer_conv, logger_conv, event_handler_conv, retry_attempts_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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_InvoicePayer_pay_invoice(uint32_t this_arg, uint32_t invoice) {
+ LDKInvoicePayer this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ LDKInvoice invoice_conv;
+ invoice_conv.inner = (void*)(invoice & (~1));
+ invoice_conv.is_owned = false;
+ LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
+ *ret_conv = InvoicePayer_pay_invoice(&this_arg_conv, &invoice_conv);
+ return (uint64_t)ret_conv;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_InvoicePayer_pay_zero_value_invoice(uint32_t this_arg, uint32_t invoice, int64_t amount_msats) {
+ LDKInvoicePayer this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ LDKInvoice invoice_conv;
+ invoice_conv.inner = (void*)(invoice & (~1));
+ invoice_conv.is_owned = false;
+ LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
+ *ret_conv = InvoicePayer_pay_zero_value_invoice(&this_arg_conv, &invoice_conv, amount_msats);
+ 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));
+ this_arg_conv.is_owned = false;
+ 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;
+ InvoicePayer_remove_cached_payment(&this_arg_conv, payment_hash_ref);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_InvoicePayer_as_EventHandler(uint32_t this_arg) {
+ LDKInvoicePayer this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ LDKEventHandler* ret_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
+ *ret_ret = InvoicePayer_as_EventHandler(&this_arg_conv);
+ return (uint64_t)ret_ret;
+}
+
uint32_t __attribute__((visibility("default"))) TS_create_invoice_from_channelmanager(uint32_t channelmanager, uint32_t keys_manager, uint32_t network, uint32_t amt_msat, jstring description) {
LDKChannelManager channelmanager_conv;
channelmanager_conv.inner = (void*)(channelmanager & (~1));
return (uint64_t)ret_conv;
}
+void __attribute__((visibility("default"))) TS_DefaultRouter_free(uint32_t this_obj) {
+ LDKDefaultRouter this_obj_conv;
+ this_obj_conv.inner = (void*)(this_obj & (~1));
+ this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+ DefaultRouter_free(this_obj_conv);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_DefaultRouter_new(uint32_t network_graph, uint32_t logger) {
+ LDKNetworkGraph network_graph_conv;
+ network_graph_conv.inner = (void*)(network_graph & (~1));
+ network_graph_conv.is_owned = false;
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
+ LDKDefaultRouter ret_var = DefaultRouter_new(&network_graph_conv, logger_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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_DefaultRouter_as_Router(uint32_t this_arg) {
+ LDKDefaultRouter this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ LDKRouter* ret_ret = MALLOC(sizeof(LDKRouter), "LDKRouter");
+ *ret_ret = DefaultRouter_as_Router(&this_arg_conv);
+ return (uint64_t)ret_ret;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_ChannelManager_as_Payer(uint32_t this_arg) {
+ LDKChannelManager this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ LDKPayer* ret_ret = MALLOC(sizeof(LDKPayer), "LDKPayer");
+ *ret_ret = ChannelManager_as_Payer(&this_arg_conv);
+ return (uint64_t)ret_ret;
+}
+
uint32_t __attribute__((visibility("default"))) TS_SiPrefix_from_str(jstring s) {
LDKStr s_conv = str_ref_to_owned_c(s);
LDKCResult_SiPrefixNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixNoneZ), "LDKCResult_SiPrefixNoneZ");
void free(void *ptr);
#define MALLOC(a, _) malloc(a)
-#define FREE(p) if ((unsigned long)(p) > 1024) { free(p); }
+#define FREE(p) if ((unsigned long)(p) > 4096) { free(p); }
#define DO_ASSERT(a) (void)(a)
#define CHECK(a)
#define CHECK_ACCESS(p)
LDKCResult_TxCreationKeysDecodeErrorZ *val = (LDKCResult_TxCreationKeysDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKTxCreationKeys 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_TxCreationKeysDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_TxCreationKeysDecodeErrorZ *val = (LDKCResult_TxCreationKeysDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_ChannelPublicKeysDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_ChannelPublicKeysDecodeErrorZ *val = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKChannelPublicKeys 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelPublicKeysDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_ChannelPublicKeysDecodeErrorZ *val = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_TxCreationKeysErrorZ_result_ok(uint32_t arg) {
LDKCResult_TxCreationKeysErrorZ *val = (LDKCResult_TxCreationKeysErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKTxCreationKeys 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_TxCreationKeysErrorZ_get_err(uint32_t arg) {
LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *val = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKHTLCOutputInCommitment 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *val = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *val = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKCounterpartyChannelTransactionParameters 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *val = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_ChannelTransactionParametersDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_ChannelTransactionParametersDecodeErrorZ *val = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKChannelTransactionParameters 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelTransactionParametersDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_ChannelTransactionParametersDecodeErrorZ *val = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_HolderCommitmentTransactionDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_HolderCommitmentTransactionDecodeErrorZ *val = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKHolderCommitmentTransaction 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_HolderCommitmentTransactionDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_HolderCommitmentTransactionDecodeErrorZ *val = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_BuiltCommitmentTransactionDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *val = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKBuiltCommitmentTransaction 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *val = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_TrustedClosingTransactionNoneZ_result_ok(uint32_t arg) {
LDKCResult_TrustedClosingTransactionNoneZ *val = (LDKCResult_TrustedClosingTransactionNoneZ*)(arg & ~1);
CHECK(val->result_ok);
LDKTrustedClosingTransaction 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
void __attribute__((visibility("default"))) TS_LDKCResult_TrustedClosingTransactionNoneZ_get_err(uint32_t arg) {
LDKCResult_CommitmentTransactionDecodeErrorZ *val = (LDKCResult_CommitmentTransactionDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKCommitmentTransaction 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_CommitmentTransactionDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_CommitmentTransactionDecodeErrorZ *val = (LDKCResult_CommitmentTransactionDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_TrustedCommitmentTransactionNoneZ_result_ok(uint32_t arg) {
LDKCResult_TrustedCommitmentTransactionNoneZ *val = (LDKCResult_TrustedCommitmentTransactionNoneZ*)(arg & ~1);
CHECK(val->result_ok);
LDKTrustedCommitmentTransaction 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
void __attribute__((visibility("default"))) TS_LDKCResult_TrustedCommitmentTransactionNoneZ_get_err(uint32_t arg) {
LDKCResult_CVec_SignatureZNoneZ *val = (LDKCResult_CVec_SignatureZNoneZ*)(arg & ~1);
CHECK(val->result_ok);
LDKCVec_SignatureZ res_var = (*val->contents.result);
- ptrArray res_arr = init_arr(res_var.datalen, sizeof(uint32_t), "Native ptrArray Bytes");
+ ptrArray res_arr = NULL;
+ res_arr = init_arr(res_var.datalen, sizeof(uint32_t), "Native ptrArray Bytes");
int8_tArray *res_arr_ptr = (int8_tArray*)(res_arr + 4);
for (size_t m = 0; m < res_var.datalen; m++) {
int8_tArray res_conv_12_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(res_conv_12_arr + 4), res_var.data[m].compact_form, 64);
res_arr_ptr[m] = res_conv_12_arr;
}
+
return res_arr;
}
void __attribute__((visibility("default"))) TS_LDKCResult_CVec_SignatureZNoneZ_get_err(uint32_t arg) {
LDKCResult_ShutdownScriptDecodeErrorZ *val = (LDKCResult_ShutdownScriptDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKShutdownScript 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ShutdownScriptDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_ShutdownScriptDecodeErrorZ *val = (LDKCResult_ShutdownScriptDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_ShutdownScriptInvalidShutdownScriptZ_result_ok(uint32_t arg) {
LDKCResult_ShutdownScriptInvalidShutdownScriptZ *val = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(arg & ~1);
CHECK(val->result_ok);
LDKShutdownScript 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ShutdownScriptInvalidShutdownScriptZ_get_err(uint32_t arg) {
LDKCResult_ShutdownScriptInvalidShutdownScriptZ *val = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(arg & ~1);
CHECK(!val->result_ok);
LDKInvalidShutdownScript 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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_NoneErrorZ_result_ok(uint32_t arg) {
LDKCResult_RouteHopDecodeErrorZ *val = (LDKCResult_RouteHopDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKRouteHop 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RouteHopDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_RouteHopDecodeErrorZ *val = (LDKCResult_RouteHopDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCVec_RouteHopZ_new(uint32_tArray elems) {
LDKCResult_RouteDecodeErrorZ *val = (LDKCResult_RouteDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKRoute 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RouteDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_RouteDecodeErrorZ *val = (LDKCResult_RouteDecodeErrorZ*)(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.
+ err_ref = (uint64_t)err_var.inner & ~1;
+ return err_ref;
+}
+jboolean __attribute__((visibility("default"))) TS_LDKCResult_RouteParametersDecodeErrorZ_result_ok(uint32_t arg) {
+ return ((LDKCResult_RouteParametersDecodeErrorZ*)arg)->result_ok;
+}
+uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RouteParametersDecodeErrorZ_get_ok(uint32_t arg) {
+ LDKCResult_RouteParametersDecodeErrorZ *val = (LDKCResult_RouteParametersDecodeErrorZ*)(arg & ~1);
+ CHECK(val->result_ok);
+ LDKRouteParameters 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_RouteParametersDecodeErrorZ_get_err(uint32_t arg) {
+ LDKCResult_RouteParametersDecodeErrorZ *val = (LDKCResult_RouteParametersDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
+uint32_t __attribute__((visibility("default"))) TS_LDKCVec_RouteHintZ_new(uint32_tArray elems) {
+ LDKCVec_RouteHintZ *ret = MALLOC(sizeof(LDKCVec_RouteHintZ), "LDKCVec_RouteHintZ");
+ ret->datalen = *((uint32_t*)elems);
+ if (ret->datalen == 0) {
+ ret->data = NULL;
+ } else {
+ ret->data = MALLOC(sizeof(LDKRouteHint) * ret->datalen, "LDKCVec_RouteHintZ Data");
+ uint32_t *java_elems = (uint32_t*)(elems + 4);
+ for (size_t i = 0; i < ret->datalen; i++) {
+ uint32_t arr_elem = java_elems[i];
+ LDKRouteHint arr_elem_conv;
+ arr_elem_conv.inner = (void*)(arr_elem & (~1));
+ arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0);
+ arr_elem_conv = RouteHint_clone(&arr_elem_conv);
+ ret->data[i] = arr_elem_conv;
+ }
+ }
+ return (uint64_t)ret;
+}
+static inline LDKCVec_RouteHintZ CVec_RouteHintZ_clone(const LDKCVec_RouteHintZ *orig) {
+ LDKCVec_RouteHintZ ret = { .data = MALLOC(sizeof(LDKRouteHint) * orig->datalen, "LDKCVec_RouteHintZ clone bytes"), .datalen = orig->datalen };
+ for (size_t i = 0; i < ret.datalen; i++) {
+ ret.data[i] = RouteHint_clone(&orig->data[i]);
+ }
+ return ret;
+}
uint32_t __attribute__((visibility("default"))) TS_LDKCOption_u64Z_ref_from_ptr(uint32_t ptr) {
LDKCOption_u64Z *obj = (LDKCOption_u64Z*)(ptr & ~1);
switch(obj->tag) {
default: abort();
}
}
-uint32_t __attribute__((visibility("default"))) TS_LDKCVec_ChannelDetailsZ_new(uint32_tArray elems) {
- LDKCVec_ChannelDetailsZ *ret = MALLOC(sizeof(LDKCVec_ChannelDetailsZ), "LDKCVec_ChannelDetailsZ");
+jboolean __attribute__((visibility("default"))) TS_LDKCResult_PayeeDecodeErrorZ_result_ok(uint32_t arg) {
+ return ((LDKCResult_PayeeDecodeErrorZ*)arg)->result_ok;
+}
+uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PayeeDecodeErrorZ_get_ok(uint32_t arg) {
+ LDKCResult_PayeeDecodeErrorZ *val = (LDKCResult_PayeeDecodeErrorZ*)(arg & ~1);
+ CHECK(val->result_ok);
+ LDKPayee 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_PayeeDecodeErrorZ_get_err(uint32_t arg) {
+ LDKCResult_PayeeDecodeErrorZ *val = (LDKCResult_PayeeDecodeErrorZ*)(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.
+ err_ref = (uint64_t)err_var.inner & ~1;
+ return err_ref;
+}
+uint32_t __attribute__((visibility("default"))) TS_LDKCVec_RouteHintHopZ_new(uint32_tArray elems) {
+ LDKCVec_RouteHintHopZ *ret = MALLOC(sizeof(LDKCVec_RouteHintHopZ), "LDKCVec_RouteHintHopZ");
ret->datalen = *((uint32_t*)elems);
if (ret->datalen == 0) {
ret->data = NULL;
} else {
- ret->data = MALLOC(sizeof(LDKChannelDetails) * ret->datalen, "LDKCVec_ChannelDetailsZ Data");
+ ret->data = MALLOC(sizeof(LDKRouteHintHop) * ret->datalen, "LDKCVec_RouteHintHopZ Data");
uint32_t *java_elems = (uint32_t*)(elems + 4);
for (size_t i = 0; i < ret->datalen; i++) {
uint32_t arr_elem = java_elems[i];
- LDKChannelDetails arr_elem_conv;
+ LDKRouteHintHop arr_elem_conv;
arr_elem_conv.inner = (void*)(arr_elem & (~1));
arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0);
- arr_elem_conv = ChannelDetails_clone(&arr_elem_conv);
+ arr_elem_conv = RouteHintHop_clone(&arr_elem_conv);
ret->data[i] = arr_elem_conv;
}
}
return (uint64_t)ret;
}
-static inline LDKCVec_ChannelDetailsZ CVec_ChannelDetailsZ_clone(const LDKCVec_ChannelDetailsZ *orig) {
- LDKCVec_ChannelDetailsZ ret = { .data = MALLOC(sizeof(LDKChannelDetails) * orig->datalen, "LDKCVec_ChannelDetailsZ clone bytes"), .datalen = orig->datalen };
+static inline LDKCVec_RouteHintHopZ CVec_RouteHintHopZ_clone(const LDKCVec_RouteHintHopZ *orig) {
+ LDKCVec_RouteHintHopZ ret = { .data = MALLOC(sizeof(LDKRouteHintHop) * orig->datalen, "LDKCVec_RouteHintHopZ clone bytes"), .datalen = orig->datalen };
for (size_t i = 0; i < ret.datalen; i++) {
- ret.data[i] = ChannelDetails_clone(&orig->data[i]);
+ ret.data[i] = RouteHintHop_clone(&orig->data[i]);
}
return ret;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKCVec_RouteHintZ_new(uint32_tArray elems) {
- LDKCVec_RouteHintZ *ret = MALLOC(sizeof(LDKCVec_RouteHintZ), "LDKCVec_RouteHintZ");
+jboolean __attribute__((visibility("default"))) TS_LDKCResult_RouteHintDecodeErrorZ_result_ok(uint32_t arg) {
+ return ((LDKCResult_RouteHintDecodeErrorZ*)arg)->result_ok;
+}
+uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RouteHintDecodeErrorZ_get_ok(uint32_t arg) {
+ LDKCResult_RouteHintDecodeErrorZ *val = (LDKCResult_RouteHintDecodeErrorZ*)(arg & ~1);
+ CHECK(val->result_ok);
+ LDKRouteHint 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_RouteHintDecodeErrorZ_get_err(uint32_t arg) {
+ LDKCResult_RouteHintDecodeErrorZ *val = (LDKCResult_RouteHintDecodeErrorZ*)(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.
+ err_ref = (uint64_t)err_var.inner & ~1;
+ return err_ref;
+}
+jboolean __attribute__((visibility("default"))) TS_LDKCResult_RouteHintHopDecodeErrorZ_result_ok(uint32_t arg) {
+ return ((LDKCResult_RouteHintHopDecodeErrorZ*)arg)->result_ok;
+}
+uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RouteHintHopDecodeErrorZ_get_ok(uint32_t arg) {
+ LDKCResult_RouteHintHopDecodeErrorZ *val = (LDKCResult_RouteHintHopDecodeErrorZ*)(arg & ~1);
+ CHECK(val->result_ok);
+ LDKRouteHintHop 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_RouteHintHopDecodeErrorZ_get_err(uint32_t arg) {
+ LDKCResult_RouteHintHopDecodeErrorZ *val = (LDKCResult_RouteHintHopDecodeErrorZ*)(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.
+ err_ref = (uint64_t)err_var.inner & ~1;
+ return err_ref;
+}
+uint32_t __attribute__((visibility("default"))) TS_LDKCVec_ChannelDetailsZ_new(uint32_tArray elems) {
+ LDKCVec_ChannelDetailsZ *ret = MALLOC(sizeof(LDKCVec_ChannelDetailsZ), "LDKCVec_ChannelDetailsZ");
ret->datalen = *((uint32_t*)elems);
if (ret->datalen == 0) {
ret->data = NULL;
} else {
- ret->data = MALLOC(sizeof(LDKRouteHint) * ret->datalen, "LDKCVec_RouteHintZ Data");
+ ret->data = MALLOC(sizeof(LDKChannelDetails) * ret->datalen, "LDKCVec_ChannelDetailsZ Data");
uint32_t *java_elems = (uint32_t*)(elems + 4);
for (size_t i = 0; i < ret->datalen; i++) {
uint32_t arr_elem = java_elems[i];
- LDKRouteHint arr_elem_conv;
+ LDKChannelDetails arr_elem_conv;
arr_elem_conv.inner = (void*)(arr_elem & (~1));
arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0);
- arr_elem_conv = RouteHint_clone(&arr_elem_conv);
+ arr_elem_conv = ChannelDetails_clone(&arr_elem_conv);
ret->data[i] = arr_elem_conv;
}
}
return (uint64_t)ret;
}
-static inline LDKCVec_RouteHintZ CVec_RouteHintZ_clone(const LDKCVec_RouteHintZ *orig) {
- LDKCVec_RouteHintZ ret = { .data = MALLOC(sizeof(LDKRouteHint) * orig->datalen, "LDKCVec_RouteHintZ clone bytes"), .datalen = orig->datalen };
+static inline LDKCVec_ChannelDetailsZ CVec_ChannelDetailsZ_clone(const LDKCVec_ChannelDetailsZ *orig) {
+ LDKCVec_ChannelDetailsZ ret = { .data = MALLOC(sizeof(LDKChannelDetails) * orig->datalen, "LDKCVec_ChannelDetailsZ clone bytes"), .datalen = orig->datalen };
for (size_t i = 0; i < ret.datalen; i++) {
- ret.data[i] = RouteHint_clone(&orig->data[i]);
+ ret.data[i] = ChannelDetails_clone(&orig->data[i]);
}
return ret;
}
LDKCResult_RouteLightningErrorZ *val = (LDKCResult_RouteLightningErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKRoute 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RouteLightningErrorZ_get_err(uint32_t arg) {
LDKCResult_RouteLightningErrorZ *val = (LDKCResult_RouteLightningErrorZ*)(arg & ~1);
CHECK(!val->result_ok);
LDKLightningError 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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_TxOutAccessErrorZ_result_ok(uint32_t arg) {
switch(obj->tag) {
case LDKMonitorEvent_HTLCEvent: {
LDKHTLCUpdate htlc_event_var = obj->htlc_event;
+ uint64_t htlc_event_ref = 0;
CHECK((((uint64_t)htlc_event_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&htlc_event_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t htlc_event_ref = (uint64_t)htlc_event_var.inner & ~1;
+ htlc_event_ref = (uint64_t)htlc_event_var.inner & ~1;
return 0 /* LDKMonitorEvent - HTLCEvent */; (void) htlc_event_ref;
}
case LDKMonitorEvent_CommitmentTxConfirmed: {
LDKOutPoint commitment_tx_confirmed_var = obj->commitment_tx_confirmed;
+ uint64_t commitment_tx_confirmed_ref = 0;
CHECK((((uint64_t)commitment_tx_confirmed_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&commitment_tx_confirmed_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t commitment_tx_confirmed_ref = (uint64_t)commitment_tx_confirmed_var.inner & ~1;
+ commitment_tx_confirmed_ref = (uint64_t)commitment_tx_confirmed_var.inner & ~1;
return 0 /* LDKMonitorEvent - CommitmentTxConfirmed */; (void) commitment_tx_confirmed_ref;
}
+ case LDKMonitorEvent_UpdateCompleted: {
+ LDKOutPoint funding_txo_var = obj->update_completed.funding_txo;
+ uint64_t funding_txo_ref = 0;
+ CHECK((((uint64_t)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&funding_txo_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ funding_txo_ref = (uint64_t)funding_txo_var.inner & ~1;
+ return 0 /* LDKMonitorEvent - UpdateCompleted */; (void) funding_txo_ref; (void) obj->update_completed.monitor_update_id;
+ }
+ case LDKMonitorEvent_UpdateFailed: {
+ LDKOutPoint update_failed_var = obj->update_failed;
+ uint64_t update_failed_ref = 0;
+ CHECK((((uint64_t)update_failed_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&update_failed_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ update_failed_ref = (uint64_t)update_failed_var.inner & ~1;
+ return 0 /* LDKMonitorEvent - UpdateFailed */; (void) update_failed_ref;
+ }
default: abort();
}
}
switch(obj->tag) {
case LDKNetworkUpdate_ChannelUpdateMessage: {
LDKChannelUpdate msg_var = obj->channel_update_message.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return 0 /* LDKNetworkUpdate - ChannelUpdateMessage */; (void) msg_ref;
}
case LDKNetworkUpdate_ChannelClosed: {
switch(obj->tag) {
case LDKSpendableOutputDescriptor_StaticOutput: {
LDKOutPoint outpoint_var = obj->static_output.outpoint;
+ uint64_t outpoint_ref = 0;
CHECK((((uint64_t)outpoint_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&outpoint_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t outpoint_ref = (uint64_t)outpoint_var.inner & ~1;
+ outpoint_ref = (uint64_t)outpoint_var.inner & ~1;
uint64_t output_ref = ((uint64_t)&obj->static_output.output) | 1;
return 0 /* LDKSpendableOutputDescriptor - StaticOutput */; (void) outpoint_ref; (void) (uint64_t)output_ref;
}
case LDKSpendableOutputDescriptor_DelayedPaymentOutput: {
LDKDelayedPaymentOutputDescriptor delayed_payment_output_var = obj->delayed_payment_output;
+ uint64_t delayed_payment_output_ref = 0;
CHECK((((uint64_t)delayed_payment_output_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&delayed_payment_output_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t delayed_payment_output_ref = (uint64_t)delayed_payment_output_var.inner & ~1;
+ delayed_payment_output_ref = (uint64_t)delayed_payment_output_var.inner & ~1;
return 0 /* LDKSpendableOutputDescriptor - DelayedPaymentOutput */; (void) delayed_payment_output_ref;
}
case LDKSpendableOutputDescriptor_StaticPaymentOutput: {
LDKStaticPaymentOutputDescriptor static_payment_output_var = obj->static_payment_output;
+ uint64_t static_payment_output_ref = 0;
CHECK((((uint64_t)static_payment_output_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&static_payment_output_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t static_payment_output_ref = (uint64_t)static_payment_output_var.inner & ~1;
+ static_payment_output_ref = (uint64_t)static_payment_output_var.inner & ~1;
return 0 /* LDKSpendableOutputDescriptor - StaticPaymentOutput */; (void) static_payment_output_ref;
}
default: abort();
switch(obj->tag) {
case LDKErrorAction_DisconnectPeer: {
LDKErrorMessage msg_var = obj->disconnect_peer.msg;
- CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
- CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ uint64_t msg_ref = 0;
+ if ((uint64_t)msg_var.inner > 4096) {
+ CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ msg_ref = (uint64_t)msg_var.inner & ~1;
+ }
return 0 /* LDKErrorAction - DisconnectPeer */; (void) msg_ref;
}
case LDKErrorAction_IgnoreError: {
}
case LDKErrorAction_SendErrorMessage: {
LDKErrorMessage msg_var = obj->send_error_message.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return 0 /* LDKErrorAction - SendErrorMessage */; (void) msg_ref;
}
default: abort();
int8_tArray node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(node_id_arr + 4), obj->send_accept_channel.node_id.compressed_form, 33);
LDKAcceptChannel msg_var = obj->send_accept_channel.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return 0 /* LDKMessageSendEvent - SendAcceptChannel */; (void) node_id_arr; (void) msg_ref;
}
case LDKMessageSendEvent_SendOpenChannel: {
int8_tArray node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(node_id_arr + 4), obj->send_open_channel.node_id.compressed_form, 33);
LDKOpenChannel msg_var = obj->send_open_channel.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return 0 /* LDKMessageSendEvent - SendOpenChannel */; (void) node_id_arr; (void) msg_ref;
}
case LDKMessageSendEvent_SendFundingCreated: {
int8_tArray node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(node_id_arr + 4), obj->send_funding_created.node_id.compressed_form, 33);
LDKFundingCreated msg_var = obj->send_funding_created.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return 0 /* LDKMessageSendEvent - SendFundingCreated */; (void) node_id_arr; (void) msg_ref;
}
case LDKMessageSendEvent_SendFundingSigned: {
int8_tArray node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(node_id_arr + 4), obj->send_funding_signed.node_id.compressed_form, 33);
LDKFundingSigned msg_var = obj->send_funding_signed.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return 0 /* LDKMessageSendEvent - SendFundingSigned */; (void) node_id_arr; (void) msg_ref;
}
case LDKMessageSendEvent_SendFundingLocked: {
int8_tArray node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(node_id_arr + 4), obj->send_funding_locked.node_id.compressed_form, 33);
LDKFundingLocked msg_var = obj->send_funding_locked.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return 0 /* LDKMessageSendEvent - SendFundingLocked */; (void) node_id_arr; (void) msg_ref;
}
case LDKMessageSendEvent_SendAnnouncementSignatures: {
int8_tArray node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(node_id_arr + 4), obj->send_announcement_signatures.node_id.compressed_form, 33);
LDKAnnouncementSignatures msg_var = obj->send_announcement_signatures.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return 0 /* LDKMessageSendEvent - SendAnnouncementSignatures */; (void) node_id_arr; (void) msg_ref;
}
case LDKMessageSendEvent_UpdateHTLCs: {
int8_tArray node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(node_id_arr + 4), obj->update_htl_cs.node_id.compressed_form, 33);
LDKCommitmentUpdate updates_var = obj->update_htl_cs.updates;
+ uint64_t updates_ref = 0;
CHECK((((uint64_t)updates_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&updates_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t updates_ref = (uint64_t)updates_var.inner & ~1;
+ updates_ref = (uint64_t)updates_var.inner & ~1;
return 0 /* LDKMessageSendEvent - UpdateHTLCs */; (void) node_id_arr; (void) updates_ref;
}
case LDKMessageSendEvent_SendRevokeAndACK: {
int8_tArray node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(node_id_arr + 4), obj->send_revoke_and_ack.node_id.compressed_form, 33);
LDKRevokeAndACK msg_var = obj->send_revoke_and_ack.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return 0 /* LDKMessageSendEvent - SendRevokeAndACK */; (void) node_id_arr; (void) msg_ref;
}
case LDKMessageSendEvent_SendClosingSigned: {
int8_tArray node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(node_id_arr + 4), obj->send_closing_signed.node_id.compressed_form, 33);
LDKClosingSigned msg_var = obj->send_closing_signed.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return 0 /* LDKMessageSendEvent - SendClosingSigned */; (void) node_id_arr; (void) msg_ref;
}
case LDKMessageSendEvent_SendShutdown: {
int8_tArray node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(node_id_arr + 4), obj->send_shutdown.node_id.compressed_form, 33);
LDKShutdown msg_var = obj->send_shutdown.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return 0 /* LDKMessageSendEvent - SendShutdown */; (void) node_id_arr; (void) msg_ref;
}
case LDKMessageSendEvent_SendChannelReestablish: {
int8_tArray node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(node_id_arr + 4), obj->send_channel_reestablish.node_id.compressed_form, 33);
LDKChannelReestablish msg_var = obj->send_channel_reestablish.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return 0 /* LDKMessageSendEvent - SendChannelReestablish */; (void) node_id_arr; (void) msg_ref;
}
case LDKMessageSendEvent_BroadcastChannelAnnouncement: {
LDKChannelAnnouncement msg_var = obj->broadcast_channel_announcement.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
LDKChannelUpdate update_msg_var = obj->broadcast_channel_announcement.update_msg;
+ uint64_t update_msg_ref = 0;
CHECK((((uint64_t)update_msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&update_msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t update_msg_ref = (uint64_t)update_msg_var.inner & ~1;
+ update_msg_ref = (uint64_t)update_msg_var.inner & ~1;
return 0 /* LDKMessageSendEvent - BroadcastChannelAnnouncement */; (void) msg_ref; (void) update_msg_ref;
}
case LDKMessageSendEvent_BroadcastNodeAnnouncement: {
LDKNodeAnnouncement msg_var = obj->broadcast_node_announcement.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return 0 /* LDKMessageSendEvent - BroadcastNodeAnnouncement */; (void) msg_ref;
}
case LDKMessageSendEvent_BroadcastChannelUpdate: {
LDKChannelUpdate msg_var = obj->broadcast_channel_update.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return 0 /* LDKMessageSendEvent - BroadcastChannelUpdate */; (void) msg_ref;
}
case LDKMessageSendEvent_SendChannelUpdate: {
int8_tArray node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(node_id_arr + 4), obj->send_channel_update.node_id.compressed_form, 33);
LDKChannelUpdate msg_var = obj->send_channel_update.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return 0 /* LDKMessageSendEvent - SendChannelUpdate */; (void) node_id_arr; (void) msg_ref;
}
case LDKMessageSendEvent_HandleError: {
int8_tArray node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(node_id_arr + 4), obj->send_channel_range_query.node_id.compressed_form, 33);
LDKQueryChannelRange msg_var = obj->send_channel_range_query.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return 0 /* LDKMessageSendEvent - SendChannelRangeQuery */; (void) node_id_arr; (void) msg_ref;
}
case LDKMessageSendEvent_SendShortIdsQuery: {
int8_tArray node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(node_id_arr + 4), obj->send_short_ids_query.node_id.compressed_form, 33);
LDKQueryShortChannelIds msg_var = obj->send_short_ids_query.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return 0 /* LDKMessageSendEvent - SendShortIdsQuery */; (void) node_id_arr; (void) msg_ref;
}
case LDKMessageSendEvent_SendReplyChannelRange: {
int8_tArray node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(node_id_arr + 4), obj->send_reply_channel_range.node_id.compressed_form, 33);
LDKReplyChannelRange msg_var = obj->send_reply_channel_range.msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+ msg_ref = (uint64_t)msg_var.inner & ~1;
return 0 /* LDKMessageSendEvent - SendReplyChannelRange */; (void) node_id_arr; (void) msg_ref;
}
default: abort();
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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ 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;
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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_NodeFeaturesDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_NodeFeaturesDecodeErrorZ *val = (LDKCResult_NodeFeaturesDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ 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);
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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_ChannelFeaturesDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_ChannelFeaturesDecodeErrorZ *val = (LDKCResult_ChannelFeaturesDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKChannelFeatures 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelFeaturesDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_ChannelFeaturesDecodeErrorZ *val = (LDKCResult_ChannelFeaturesDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_InvoiceFeaturesDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_InvoiceFeaturesDecodeErrorZ *val = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ 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);
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.
+ err_ref = (uint64_t)err_var.inner & ~1;
+ return err_ref;
+}
+jboolean __attribute__((visibility("default"))) TS_LDKCResult_ScoringParametersDecodeErrorZ_result_ok(uint32_t arg) {
+ return ((LDKCResult_ScoringParametersDecodeErrorZ*)arg)->result_ok;
+}
+uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ScoringParametersDecodeErrorZ_get_ok(uint32_t arg) {
+ LDKCResult_ScoringParametersDecodeErrorZ *val = (LDKCResult_ScoringParametersDecodeErrorZ*)(arg & ~1);
+ CHECK(val->result_ok);
+ 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_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;
+ 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.
+ err_ref = (uint64_t)err_var.inner & ~1;
+ return err_ref;
+}
+jboolean __attribute__((visibility("default"))) TS_LDKCResult_ScorerDecodeErrorZ_result_ok(uint32_t arg) {
+ return ((LDKCResult_ScorerDecodeErrorZ*)arg)->result_ok;
+}
+uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ScorerDecodeErrorZ_get_ok(uint32_t arg) {
+ LDKCResult_ScorerDecodeErrorZ *val = (LDKCResult_ScorerDecodeErrorZ*)(arg & ~1);
+ CHECK(val->result_ok);
+ 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_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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *val = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKDelayedPaymentOutputDescriptor 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *val = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *val = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKStaticPaymentOutputDescriptor 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *val = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_SpendableOutputDescriptorDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_SpendableOutputDescriptorDecodeErrorZ *val = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_NoneNoneZ_result_ok(uint32_t arg) {
ptrArray __attribute__((visibility("default"))) TS_C2Tuple_SignatureCVec_SignatureZZ_get_b(uint32_t tuple) {
LDKC2Tuple_SignatureCVec_SignatureZZ* tuple_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)(tuple & ~1);
LDKCVec_SignatureZ ret_var = C2Tuple_SignatureCVec_SignatureZZ_get_b(tuple_conv);
- ptrArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native ptrArray Bytes");
+ ptrArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native ptrArray Bytes");
int8_tArray *ret_arr_ptr = (int8_tArray*)(ret_arr + 4);
for (size_t m = 0; m < ret_var.datalen; m++) {
int8_tArray ret_conv_12_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(ret_conv_12_arr + 4), ret_var.data[m].compact_form, 64);
ret_arr_ptr[m] = ret_conv_12_arr;
}
+
FREE(ret_var.data);
return ret_arr;
}
LDKCResult_NoneNoneZ validate_holder_commitment_LDKBaseSign_jcall(const void* this_arg, const LDKHolderCommitmentTransaction * holder_tx) {
LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
LDKHolderCommitmentTransaction holder_tx_var = *holder_tx;
+ uint64_t holder_tx_ref = 0;
holder_tx_var = HolderCommitmentTransaction_clone(holder_tx);
CHECK((((uint64_t)holder_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&holder_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t holder_tx_ref = (uint64_t)holder_tx_var.inner;
+ holder_tx_ref = (uint64_t)holder_tx_var.inner;
if (holder_tx_var.is_owned) {
holder_tx_ref |= 1;
}
LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment_LDKBaseSign_jcall(const void* this_arg, const LDKCommitmentTransaction * commitment_tx) {
LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
LDKCommitmentTransaction commitment_tx_var = *commitment_tx;
+ uint64_t commitment_tx_ref = 0;
commitment_tx_var = CommitmentTransaction_clone(commitment_tx);
CHECK((((uint64_t)commitment_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&commitment_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t commitment_tx_ref = (uint64_t)commitment_tx_var.inner;
+ commitment_tx_ref = (uint64_t)commitment_tx_var.inner;
if (commitment_tx_var.is_owned) {
commitment_tx_ref |= 1;
}
LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htlcs_LDKBaseSign_jcall(const void* this_arg, const LDKHolderCommitmentTransaction * commitment_tx) {
LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
LDKHolderCommitmentTransaction commitment_tx_var = *commitment_tx;
+ uint64_t commitment_tx_ref = 0;
commitment_tx_var = HolderCommitmentTransaction_clone(commitment_tx);
CHECK((((uint64_t)commitment_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&commitment_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t commitment_tx_ref = (uint64_t)commitment_tx_var.inner;
+ commitment_tx_ref = (uint64_t)commitment_tx_var.inner;
if (commitment_tx_var.is_owned) {
commitment_tx_ref |= 1;
}
int8_tArray per_commitment_key_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(per_commitment_key_arr + 4), *per_commitment_key, 32);
LDKHTLCOutputInCommitment htlc_var = *htlc;
+ uint64_t htlc_ref = 0;
htlc_var = HTLCOutputInCommitment_clone(htlc);
CHECK((((uint64_t)htlc_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&htlc_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t htlc_ref = (uint64_t)htlc_var.inner;
+ htlc_ref = (uint64_t)htlc_var.inner;
if (htlc_var.is_owned) {
htlc_ref |= 1;
}
int8_tArray per_commitment_point_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(per_commitment_point_arr + 4), per_commitment_point.compressed_form, 33);
LDKHTLCOutputInCommitment htlc_var = *htlc;
+ uint64_t htlc_ref = 0;
htlc_var = HTLCOutputInCommitment_clone(htlc);
CHECK((((uint64_t)htlc_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&htlc_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t htlc_ref = (uint64_t)htlc_var.inner;
+ htlc_ref = (uint64_t)htlc_var.inner;
if (htlc_var.is_owned) {
htlc_ref |= 1;
}
LDKCResult_SignatureNoneZ sign_closing_transaction_LDKBaseSign_jcall(const void* this_arg, const LDKClosingTransaction * closing_tx) {
LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
LDKClosingTransaction closing_tx_var = *closing_tx;
+ uint64_t closing_tx_ref = 0;
closing_tx_var = ClosingTransaction_clone(closing_tx);
CHECK((((uint64_t)closing_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&closing_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t closing_tx_ref = (uint64_t)closing_tx_var.inner;
+ closing_tx_ref = (uint64_t)closing_tx_var.inner;
if (closing_tx_var.is_owned) {
closing_tx_ref |= 1;
}
LDKCResult_SignatureNoneZ sign_channel_announcement_LDKBaseSign_jcall(const void* this_arg, const LDKUnsignedChannelAnnouncement * msg) {
LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
LDKUnsignedChannelAnnouncement msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = UnsignedChannelAnnouncement_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
void ready_channel_LDKBaseSign_jcall(void* this_arg, const LDKChannelTransactionParameters * channel_parameters) {
LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
LDKChannelTransactionParameters channel_parameters_var = *channel_parameters;
+ uint64_t channel_parameters_ref = 0;
channel_parameters_var = ChannelTransactionParameters_clone(channel_parameters);
CHECK((((uint64_t)channel_parameters_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&channel_parameters_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t channel_parameters_ref = (uint64_t)channel_parameters_var.inner;
+ channel_parameters_ref = (uint64_t)channel_parameters_var.inner;
if (channel_parameters_var.is_owned) {
channel_parameters_ref |= 1;
}
if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
LDKChannelPublicKeys ret_var = LDKBaseSign_set_get_pubkeys(this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_SignDecodeErrorZ_get_ok(uint32_t arg) {
LDKCResult_SignDecodeErrorZ *val = (LDKCResult_SignDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
- LDKSign* res_ret =MALLOC(sizeof(LDKSign), "LDKSign");
+ LDKSign* res_ret = MALLOC(sizeof(LDKSign), "LDKSign");
*res_ret = Sign_clone(&(*val->contents.result));
return (uint64_t)res_ret;
}
LDKCResult_SignDecodeErrorZ *val = (LDKCResult_SignDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_RecoverableSignatureNoneZ_result_ok(uint32_t arg) {
LDKCResult_CVec_CVec_u8ZZNoneZ *val = (LDKCResult_CVec_CVec_u8ZZNoneZ*)(arg & ~1);
CHECK(val->result_ok);
LDKCVec_CVec_u8ZZ res_var = (*val->contents.result);
- ptrArray res_arr = init_arr(res_var.datalen, sizeof(uint32_t), "Native ptrArray Bytes");
+ ptrArray res_arr = NULL;
+ res_arr = init_arr(res_var.datalen, sizeof(uint32_t), "Native ptrArray Bytes");
int8_tArray *res_arr_ptr = (int8_tArray*)(res_arr + 4);
for (size_t m = 0; m < res_var.datalen; m++) {
LDKCVec_u8Z res_conv_12_var = res_var.data[m];
memcpy((uint8_t*)(res_conv_12_arr + 4), res_conv_12_var.data, res_conv_12_var.datalen);
res_arr_ptr[m] = res_conv_12_arr;
}
+
return res_arr;
}
void __attribute__((visibility("default"))) TS_LDKCResult_CVec_CVec_u8ZZNoneZ_get_err(uint32_t arg) {
LDKCResult_InMemorySignerDecodeErrorZ *val = (LDKCResult_InMemorySignerDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKInMemorySigner 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InMemorySignerDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_InMemorySignerDecodeErrorZ *val = (LDKCResult_InMemorySignerDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCVec_TxOutZ_new(uint32_tArray elems) {
uint32_t __attribute__((visibility("default"))) TS_C2Tuple_BlockHashChannelMonitorZ_get_b(uint32_t tuple) {
LDKC2Tuple_BlockHashChannelMonitorZ* tuple_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)(tuple & ~1);
LDKChannelMonitor ret_var = C2Tuple_BlockHashChannelMonitorZ_get_b(tuple_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *val = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKCVec_C2Tuple_BlockHashChannelMonitorZZ res_var = (*val->contents.result);
- uint32_tArray res_arr = init_arr(res_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray res_arr = NULL;
+ res_arr = init_arr(res_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *res_arr_ptr = (uint32_t*)(res_arr + 4);
for (size_t j = 0; j < res_var.datalen; j++) {
LDKC2Tuple_BlockHashChannelMonitorZ* res_conv_35_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ");
*res_conv_35_conv = C2Tuple_BlockHashChannelMonitorZ_clone(res_conv_35_conv);
res_arr_ptr[j] = ((uint64_t)res_conv_35_conv);
}
+
return res_arr;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_get_err(uint32_t arg) {
uint32_t err_conv = LDKIOError_to_js((*val->contents.err));
return err_conv;
}
-jboolean __attribute__((visibility("default"))) TS_LDKCResult_PaymentIdDecodeErrorZ_result_ok(uint32_t arg) {
- return ((LDKCResult_PaymentIdDecodeErrorZ*)arg)->result_ok;
-}
-uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PaymentIdDecodeErrorZ_get_ok(uint32_t arg) {
- LDKCResult_PaymentIdDecodeErrorZ *val = (LDKCResult_PaymentIdDecodeErrorZ*)(arg & ~1);
- CHECK(val->result_ok);
- LDKPaymentId res_var = (*val->contents.result);
- 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
- return res_ref;
-}
-uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PaymentIdDecodeErrorZ_get_err(uint32_t arg) {
- LDKCResult_PaymentIdDecodeErrorZ *val = (LDKCResult_PaymentIdDecodeErrorZ*)(arg & ~1);
- CHECK(!val->result_ok);
- LDKDecodeError err_var = (*val->contents.err);
- 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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
- return err_ref;
-}
uint32_t __attribute__((visibility("default"))) TS_LDKCOption_u16Z_ref_from_ptr(uint32_t ptr) {
LDKCOption_u16Z *obj = (LDKCOption_u16Z*)(ptr & ~1);
switch(obj->tag) {
}
case LDKAPIError_IncompatibleShutdownScript: {
LDKShutdownScript script_var = obj->incompatible_shutdown_script.script;
+ uint64_t script_ref = 0;
CHECK((((uint64_t)script_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&script_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t script_ref = (uint64_t)script_var.inner & ~1;
+ script_ref = (uint64_t)script_var.inner & ~1;
return 0 /* LDKAPIError - IncompatibleShutdownScript */; (void) script_ref;
}
default: abort();
}
case LDKPaymentSendFailure_PathParameterError: {
LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error_var = obj->path_parameter_error;
- uint32_tArray path_parameter_error_arr = init_arr(path_parameter_error_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray path_parameter_error_arr = NULL;
+ path_parameter_error_arr = init_arr(path_parameter_error_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *path_parameter_error_arr_ptr = (uint32_t*)(path_parameter_error_arr + 4);
for (size_t w = 0; w < path_parameter_error_var.datalen; w++) {
LDKCResult_NoneAPIErrorZ* path_parameter_error_conv_22_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
*path_parameter_error_conv_22_conv = CResult_NoneAPIErrorZ_clone(path_parameter_error_conv_22_conv);
path_parameter_error_arr_ptr[w] = (uint64_t)path_parameter_error_conv_22_conv;
}
+
return 0 /* LDKPaymentSendFailure - PathParameterError */; (void) path_parameter_error_arr;
}
case LDKPaymentSendFailure_AllFailedRetrySafe: {
LDKCVec_APIErrorZ all_failed_retry_safe_var = obj->all_failed_retry_safe;
- uint32_tArray all_failed_retry_safe_arr = init_arr(all_failed_retry_safe_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray all_failed_retry_safe_arr = NULL;
+ all_failed_retry_safe_arr = init_arr(all_failed_retry_safe_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *all_failed_retry_safe_arr_ptr = (uint32_t*)(all_failed_retry_safe_arr + 4);
for (size_t k = 0; k < all_failed_retry_safe_var.datalen; k++) {
uint64_t all_failed_retry_safe_conv_10_ref = ((uint64_t)&all_failed_retry_safe_var.data[k]) | 1;
all_failed_retry_safe_arr_ptr[k] = all_failed_retry_safe_conv_10_ref;
}
+
return 0 /* LDKPaymentSendFailure - AllFailedRetrySafe */; (void) all_failed_retry_safe_arr;
}
case LDKPaymentSendFailure_PartialFailure: {
- LDKCVec_CResult_NoneAPIErrorZZ partial_failure_var = obj->partial_failure;
- uint32_tArray partial_failure_arr = init_arr(partial_failure_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
- uint32_t *partial_failure_arr_ptr = (uint32_t*)(partial_failure_arr + 4);
- for (size_t w = 0; w < partial_failure_var.datalen; w++) {
- LDKCResult_NoneAPIErrorZ* partial_failure_conv_22_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
- *partial_failure_conv_22_conv = partial_failure_var.data[w];
- *partial_failure_conv_22_conv = CResult_NoneAPIErrorZ_clone(partial_failure_conv_22_conv);
- partial_failure_arr_ptr[w] = (uint64_t)partial_failure_conv_22_conv;
+ LDKCVec_CResult_NoneAPIErrorZZ results_var = obj->partial_failure.results;
+ uint32_tArray results_arr = NULL;
+ results_arr = init_arr(results_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_t *results_arr_ptr = (uint32_t*)(results_arr + 4);
+ for (size_t w = 0; w < results_var.datalen; w++) {
+ LDKCResult_NoneAPIErrorZ* results_conv_22_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
+ *results_conv_22_conv = results_var.data[w];
+ *results_conv_22_conv = CResult_NoneAPIErrorZ_clone(results_conv_22_conv);
+ results_arr_ptr[w] = (uint64_t)results_conv_22_conv;
+ }
+
+ LDKRouteParameters failed_paths_retry_var = obj->partial_failure.failed_paths_retry;
+ uint64_t failed_paths_retry_ref = 0;
+ if ((uint64_t)failed_paths_retry_var.inner > 4096) {
+ CHECK((((uint64_t)failed_paths_retry_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&failed_paths_retry_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ failed_paths_retry_ref = (uint64_t)failed_paths_retry_var.inner & ~1;
}
- return 0 /* LDKPaymentSendFailure - PartialFailure */; (void) partial_failure_arr;
+ int8_tArray payment_id_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(payment_id_arr + 4), obj->partial_failure.payment_id.data, 32);
+ return 0 /* LDKPaymentSendFailure - PartialFailure */; (void) results_arr; (void) failed_paths_retry_ref; (void) payment_id_arr;
}
default: abort();
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_PaymentIdPaymentSendFailureZ_result_ok(uint32_t arg) {
return ((LDKCResult_PaymentIdPaymentSendFailureZ*)arg)->result_ok;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PaymentIdPaymentSendFailureZ_get_ok(uint32_t arg) {
+int8_tArray __attribute__((visibility("default"))) TS_LDKCResult_PaymentIdPaymentSendFailureZ_get_ok(uint32_t arg) {
LDKCResult_PaymentIdPaymentSendFailureZ *val = (LDKCResult_PaymentIdPaymentSendFailureZ*)(arg & ~1);
CHECK(val->result_ok);
- LDKPaymentId res_var = (*val->contents.result);
- 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
- return res_ref;
+ 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_PaymentIdPaymentSendFailureZ_get_err(uint32_t arg) {
LDKCResult_PaymentIdPaymentSendFailureZ *val = (LDKCResult_PaymentIdPaymentSendFailureZ*)(arg & ~1);
return ret_arr;
}
-static inline struct LDKPaymentId C2Tuple_PaymentHashPaymentIdZ_get_b(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR tuple){
- return PaymentId_clone(&tuple->b);
+static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentIdZ_get_b(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR tuple){
+ return ThirtyTwoBytes_clone(&tuple->b);
}
-uint32_t __attribute__((visibility("default"))) TS_C2Tuple_PaymentHashPaymentIdZ_get_b(uint32_t tuple) {
+int8_tArray __attribute__((visibility("default"))) TS_C2Tuple_PaymentHashPaymentIdZ_get_b(uint32_t tuple) {
LDKC2Tuple_PaymentHashPaymentIdZ* tuple_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)(tuple & ~1);
- LDKPaymentId ret_var = C2Tuple_PaymentHashPaymentIdZ_get_b(tuple_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
- }
- return ret_ref;
+ int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), C2Tuple_PaymentHashPaymentIdZ_get_b(tuple_conv).data, 32);
+ return ret_arr;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_result_ok(uint32_t arg) {
LDKCResult_NoneChannelMonitorUpdateErrZ watch_channel_LDKWatch_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitor monitor) {
LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
LDKOutPoint funding_txo_var = funding_txo;
+ uint64_t funding_txo_ref = 0;
CHECK((((uint64_t)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&funding_txo_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t funding_txo_ref = (uint64_t)funding_txo_var.inner;
+ funding_txo_ref = (uint64_t)funding_txo_var.inner;
if (funding_txo_var.is_owned) {
funding_txo_ref |= 1;
}
LDKChannelMonitor monitor_var = monitor;
+ uint64_t monitor_ref = 0;
CHECK((((uint64_t)monitor_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&monitor_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t monitor_ref = (uint64_t)monitor_var.inner;
+ monitor_ref = (uint64_t)monitor_var.inner;
if (monitor_var.is_owned) {
monitor_ref |= 1;
}
LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_LDKWatch_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitorUpdate update) {
LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
LDKOutPoint funding_txo_var = funding_txo;
+ uint64_t funding_txo_ref = 0;
CHECK((((uint64_t)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&funding_txo_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t funding_txo_ref = (uint64_t)funding_txo_var.inner;
+ funding_txo_ref = (uint64_t)funding_txo_var.inner;
if (funding_txo_var.is_owned) {
funding_txo_ref |= 1;
}
LDKChannelMonitorUpdate update_var = update;
+ uint64_t update_ref = 0;
CHECK((((uint64_t)update_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&update_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t update_ref = (uint64_t)update_var.inner;
+ update_ref = (uint64_t)update_var.inner;
if (update_var.is_owned) {
update_ref |= 1;
}
if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr;
LDKCVec_MonitorEventZ ret_var = (this_arg_conv->release_pending_monitor_events)(this_arg_conv->this_arg);
- uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t o = 0; o < ret_var.datalen; o++) {
LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
uint64_t ret_conv_14_ref = (uint64_t)ret_conv_14_copy;
ret_arr_ptr[o] = ret_conv_14_ref;
}
+
FREE(ret_var.data);
return ret_arr;
}
if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
LDKShutdownScript ret_var = (this_arg_conv->get_shutdown_scriptpubkey)(this_arg_conv->this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
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;
- LDKSign* ret_ret =MALLOC(sizeof(LDKSign), "LDKSign");
+ LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
*ret_ret = (this_arg_conv->get_channel_signer)(this_arg_conv->this_arg, inbound, channel_value_satoshis);
return (uint64_t)ret_ret;
}
uint32_t __attribute__((visibility("default"))) TS_C2Tuple_BlockHashChannelManagerZ_get_b(uint32_t tuple) {
LDKC2Tuple_BlockHashChannelManagerZ* tuple_conv = (LDKC2Tuple_BlockHashChannelManagerZ*)(tuple & ~1);
LDKChannelManager ret_var = *C2Tuple_BlockHashChannelManagerZ_get_b(tuple_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner & ~1;
+ ret_ref = (uint64_t)ret_var.inner & ~1;
return ret_ref;
}
LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *val = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_ChannelConfigDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_ChannelConfigDecodeErrorZ *val = (LDKCResult_ChannelConfigDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKChannelConfig 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelConfigDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_ChannelConfigDecodeErrorZ *val = (LDKCResult_ChannelConfigDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_OutPointDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_OutPointDecodeErrorZ *val = (LDKCResult_OutPointDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKOutPoint 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_OutPointDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_OutPointDecodeErrorZ *val = (LDKCResult_OutPointDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
typedef struct LDKType_JCalls {
LDKCOption_TypeZ *obj = (LDKCOption_TypeZ*)(ptr & ~1);
switch(obj->tag) {
case LDKCOption_TypeZ_Some: {
- LDKType* some_ret =MALLOC(sizeof(LDKType), "LDKType");
+ LDKType* some_ret = MALLOC(sizeof(LDKType), "LDKType");
*some_ret = Type_clone(&obj->some);
return 0 /* LDKCOption_TypeZ - Some */; (void) (uint64_t)some_ret;
}
LDKCResult_COption_TypeZDecodeErrorZ *val = (LDKCResult_COption_TypeZDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
+ return err_ref;
+}
+uint32_t __attribute__((visibility("default"))) TS_LDKPaymentError_ref_from_ptr(uint32_t ptr) {
+ LDKPaymentError *obj = (LDKPaymentError*)(ptr & ~1);
+ switch(obj->tag) {
+ case LDKPaymentError_Invoice: {
+ LDKStr invoice_str = obj->invoice;
+ jstring invoice_conv = str_ref_to_ts(invoice_str.chars, invoice_str.len);
+ return 0 /* LDKPaymentError - Invoice */; (void) invoice_conv;
+ }
+ case LDKPaymentError_Routing: {
+ LDKLightningError routing_var = obj->routing;
+ uint64_t routing_ref = 0;
+ CHECK((((uint64_t)routing_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&routing_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ routing_ref = (uint64_t)routing_var.inner & ~1;
+ return 0 /* LDKPaymentError - Routing */; (void) routing_ref;
+ }
+ case LDKPaymentError_Sending: {
+ uint64_t sending_ref = ((uint64_t)&obj->sending) | 1;
+ return 0 /* LDKPaymentError - Sending */; (void) sending_ref;
+ }
+ default: abort();
+ }
+}
+jboolean __attribute__((visibility("default"))) TS_LDKCResult_PaymentIdPaymentErrorZ_result_ok(uint32_t arg) {
+ return ((LDKCResult_PaymentIdPaymentErrorZ*)arg)->result_ok;
+}
+int8_tArray __attribute__((visibility("default"))) TS_LDKCResult_PaymentIdPaymentErrorZ_get_ok(uint32_t arg) {
+ LDKCResult_PaymentIdPaymentErrorZ *val = (LDKCResult_PaymentIdPaymentErrorZ*)(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_PaymentIdPaymentErrorZ_get_err(uint32_t arg) {
+ LDKCResult_PaymentIdPaymentErrorZ *val = (LDKCResult_PaymentIdPaymentErrorZ*)(arg & ~1);
+ CHECK(!val->result_ok);
+ uint64_t err_ref = ((uint64_t)&(*val->contents.err)) | 1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_SiPrefixNoneZ_result_ok(uint32_t arg) {
LDKCResult_InvoiceNoneZ *val = (LDKCResult_InvoiceNoneZ*)(arg & ~1);
CHECK(val->result_ok);
LDKInvoice 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
void __attribute__((visibility("default"))) TS_LDKCResult_InvoiceNoneZ_get_err(uint32_t arg) {
LDKCResult_SignedRawInvoiceNoneZ *val = (LDKCResult_SignedRawInvoiceNoneZ*)(arg & ~1);
CHECK(val->result_ok);
LDKSignedRawInvoice 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
void __attribute__((visibility("default"))) TS_LDKCResult_SignedRawInvoiceNoneZ_get_err(uint32_t arg) {
uint32_t __attribute__((visibility("default"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(uint32_t tuple) {
LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* tuple_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(tuple & ~1);
LDKRawInvoice ret_var = C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(tuple_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
uint32_t __attribute__((visibility("default"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(uint32_t tuple) {
LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* tuple_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(tuple & ~1);
LDKInvoiceSignature ret_var = C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(tuple_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKCResult_PayeePubKeyErrorZ *val = (LDKCResult_PayeePubKeyErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKPayeePubKey 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PayeePubKeyErrorZ_get_err(uint32_t arg) {
LDKCResult_PositiveTimestampCreationErrorZ *val = (LDKCResult_PositiveTimestampCreationErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKPositiveTimestamp 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PositiveTimestampCreationErrorZ_get_err(uint32_t arg) {
LDKCResult_InvoiceSemanticErrorZ *val = (LDKCResult_InvoiceSemanticErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKInvoice 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InvoiceSemanticErrorZ_get_err(uint32_t arg) {
LDKCResult_DescriptionCreationErrorZ *val = (LDKCResult_DescriptionCreationErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKDescription 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_DescriptionCreationErrorZ_get_err(uint32_t arg) {
LDKCResult_ExpiryTimeCreationErrorZ *val = (LDKCResult_ExpiryTimeCreationErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKExpiryTime 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ExpiryTimeCreationErrorZ_get_err(uint32_t arg) {
LDKCResult_PrivateRouteCreationErrorZ *val = (LDKCResult_PrivateRouteCreationErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKPrivateRoute 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PrivateRouteCreationErrorZ_get_err(uint32_t arg) {
LDKCResult_ChannelMonitorUpdateDecodeErrorZ *val = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKChannelMonitorUpdate 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelMonitorUpdateDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_ChannelMonitorUpdateDecodeErrorZ *val = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_HTLCUpdateDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_HTLCUpdateDecodeErrorZ *val = (LDKCResult_HTLCUpdateDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKHTLCUpdate 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_HTLCUpdateDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_HTLCUpdateDecodeErrorZ *val = (LDKCResult_HTLCUpdateDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_NoneMonitorUpdateErrorZ_result_ok(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
static inline struct LDKOutPoint C2Tuple_OutPointScriptZ_get_a(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR tuple){
uint32_t __attribute__((visibility("default"))) TS_C2Tuple_OutPointScriptZ_get_a(uint32_t tuple) {
LDKC2Tuple_OutPointScriptZ* tuple_conv = (LDKC2Tuple_OutPointScriptZ*)(tuple & ~1);
LDKOutPoint ret_var = C2Tuple_OutPointScriptZ_get_a(tuple_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
uint32_tArray __attribute__((visibility("default"))) TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(uint32_t tuple) {
LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* tuple_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(tuple & ~1);
LDKCVec_C2Tuple_u32ScriptZZ ret_var = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(tuple_conv);
- uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t v = 0; v < ret_var.datalen; v++) {
LDKC2Tuple_u32ScriptZ* ret_conv_21_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ");
*ret_conv_21_conv = ret_var.data[v];
ret_arr_ptr[v] = ((uint64_t)ret_conv_21_conv);
}
+
FREE(ret_var.data);
return ret_arr;
}
return 0 /* LDKEvent - PaymentReceived */; (void) payment_hash_arr; (void) obj->payment_received.amt; (void) purpose_ref;
}
case LDKEvent_PaymentSent: {
+ int8_tArray payment_id_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(payment_id_arr + 4), obj->payment_sent.payment_id.data, 32);
int8_tArray payment_preimage_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(payment_preimage_arr + 4), obj->payment_sent.payment_preimage.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_sent.payment_hash.data, 32);
- return 0 /* LDKEvent - PaymentSent */; (void) payment_preimage_arr; (void) payment_hash_arr;
+ uint64_t fee_paid_msat_ref = ((uint64_t)&obj->payment_sent.fee_paid_msat) | 1;
+ return 0 /* LDKEvent - PaymentSent */; (void) payment_id_arr; (void) payment_preimage_arr; (void) payment_hash_arr; (void) fee_paid_msat_ref;
}
case LDKEvent_PaymentPathFailed: {
+ 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_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_path_failed.payment_hash.data, 32);
uint64_t network_update_ref = ((uint64_t)&obj->payment_path_failed.network_update) | 1;
LDKCVec_RouteHopZ path_var = obj->payment_path_failed.path;
- uint32_tArray path_arr = init_arr(path_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ 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.
- uint64_t path_conv_10_ref = (uint64_t)path_conv_10_var.inner & ~1;
+ path_conv_10_ref = (uint64_t)path_conv_10_var.inner & ~1;
path_arr_ptr[k] = path_conv_10_ref;
}
+
uint64_t short_channel_id_ref = ((uint64_t)&obj->payment_path_failed.short_channel_id) | 1;
- return 0 /* LDKEvent - PaymentPathFailed */; (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;
+ LDKRouteParameters retry_var = obj->payment_path_failed.retry;
+ uint64_t retry_ref = 0;
+ if ((uint64_t)retry_var.inner > 4096) {
+ CHECK((((uint64_t)retry_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&retry_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ retry_ref = (uint64_t)retry_var.inner & ~1;
+ }
+ 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_PendingHTLCsForwardable: {
return 0 /* LDKEvent - PendingHTLCsForwardable */; (void) obj->pending_htl_cs_forwardable.time_forwardable;
}
case LDKEvent_SpendableOutputs: {
LDKCVec_SpendableOutputDescriptorZ outputs_var = obj->spendable_outputs.outputs;
- uint32_tArray outputs_arr = init_arr(outputs_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray outputs_arr = NULL;
+ outputs_arr = init_arr(outputs_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *outputs_arr_ptr = (uint32_t*)(outputs_arr + 4);
for (size_t b = 0; b < outputs_var.datalen; b++) {
uint64_t outputs_conv_27_ref = ((uint64_t)&outputs_var.data[b]) | 1;
outputs_arr_ptr[b] = outputs_conv_27_ref;
}
+
return 0 /* LDKEvent - SpendableOutputs */; (void) outputs_arr;
}
case LDKEvent_PaymentForwarded: {
uint32_tArray __attribute__((visibility("default"))) TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(uint32_t tuple) {
LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* tuple_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(tuple & ~1);
LDKCVec_C2Tuple_u32TxOutZZ ret_var = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(tuple_conv);
- uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t u = 0; u < ret_var.datalen; u++) {
LDKC2Tuple_u32TxOutZ* ret_conv_20_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ");
*ret_conv_20_conv = ret_var.data[u];
ret_arr_ptr[u] = ((uint64_t)ret_conv_20_conv);
}
+
FREE(ret_var.data);
return ret_arr;
}
LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *val = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_NoneLightningErrorZ_result_ok(uint32_t arg) {
LDKCResult_NoneLightningErrorZ *val = (LDKCResult_NoneLightningErrorZ*)(arg & ~1);
CHECK(!val->result_ok);
LDKLightningError 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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
static inline struct LDKPublicKey C2Tuple_PublicKeyTypeZ_get_a(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR tuple){
}
uint32_t __attribute__((visibility("default"))) TS_C2Tuple_PublicKeyTypeZ_get_b(uint32_t tuple) {
LDKC2Tuple_PublicKeyTypeZ* tuple_conv = (LDKC2Tuple_PublicKeyTypeZ*)(tuple & ~1);
- LDKType* ret_ret =MALLOC(sizeof(LDKType), "LDKType");
+ LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType");
*ret_ret = C2Tuple_PublicKeyTypeZ_get_b(tuple_conv);
return (uint64_t)ret_ret;
}
LDKCResult_boolLightningErrorZ *val = (LDKCResult_boolLightningErrorZ*)(arg & ~1);
CHECK(!val->result_ok);
LDKLightningError 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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
static inline struct LDKChannelAnnouncement C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR tuple){
uint32_t __attribute__((visibility("default"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(uint32_t tuple) {
LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* tuple_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(tuple & ~1);
LDKChannelAnnouncement ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(tuple_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
uint32_t __attribute__((visibility("default"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(uint32_t tuple) {
LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* tuple_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(tuple & ~1);
LDKChannelUpdate ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(tuple_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
uint32_t __attribute__((visibility("default"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(uint32_t tuple) {
LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* tuple_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(tuple & ~1);
LDKChannelUpdate ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(tuple_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKCResult_CVec_u8ZPeerHandleErrorZ *val = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)(arg & ~1);
CHECK(!val->result_ok);
LDKPeerHandleError 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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_NonePeerHandleErrorZ_result_ok(uint32_t arg) {
LDKCResult_NonePeerHandleErrorZ *val = (LDKCResult_NonePeerHandleErrorZ*)(arg & ~1);
CHECK(!val->result_ok);
LDKPeerHandleError 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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_boolPeerHandleErrorZ_result_ok(uint32_t arg) {
LDKCResult_boolPeerHandleErrorZ *val = (LDKCResult_boolPeerHandleErrorZ*)(arg & ~1);
CHECK(!val->result_ok);
LDKPeerHandleError 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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_NodeIdDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_NodeIdDecodeErrorZ *val = (LDKCResult_NodeIdDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKNodeId 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NodeIdDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_NodeIdDecodeErrorZ *val = (LDKCResult_NodeIdDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
typedef struct LDKAccess_JCalls {
LDKCOption_AccessZ *obj = (LDKCOption_AccessZ*)(ptr & ~1);
switch(obj->tag) {
case LDKCOption_AccessZ_Some: {
- LDKAccess* some_ret =MALLOC(sizeof(LDKAccess), "LDKAccess");
+ LDKAccess* some_ret = MALLOC(sizeof(LDKAccess), "LDKAccess");
*some_ret = obj->some;
// Warning: We likely need to clone here, but no clone is available, so we just do it for Java instances
return 0 /* LDKCOption_AccessZ - Some */; (void) (uint64_t)some_ret;
LDKCResult_DirectionalChannelInfoDecodeErrorZ *val = (LDKCResult_DirectionalChannelInfoDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKDirectionalChannelInfo 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_DirectionalChannelInfoDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_DirectionalChannelInfoDecodeErrorZ *val = (LDKCResult_DirectionalChannelInfoDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_ChannelInfoDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_ChannelInfoDecodeErrorZ *val = (LDKCResult_ChannelInfoDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKChannelInfo 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelInfoDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_ChannelInfoDecodeErrorZ *val = (LDKCResult_ChannelInfoDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_RoutingFeesDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_RoutingFeesDecodeErrorZ *val = (LDKCResult_RoutingFeesDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKRoutingFees 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RoutingFeesDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_RoutingFeesDecodeErrorZ *val = (LDKCResult_RoutingFeesDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_NodeAnnouncementInfoDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_NodeAnnouncementInfoDecodeErrorZ *val = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKNodeAnnouncementInfo 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NodeAnnouncementInfoDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_NodeAnnouncementInfoDecodeErrorZ *val = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCVec_u64Z_new(int64_tArray elems) {
LDKCResult_NodeInfoDecodeErrorZ *val = (LDKCResult_NodeInfoDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKNodeInfo 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NodeInfoDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_NodeInfoDecodeErrorZ *val = (LDKCResult_NodeInfoDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_NetworkGraphDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_NetworkGraphDecodeErrorZ *val = (LDKCResult_NetworkGraphDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKNetworkGraph 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NetworkGraphDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_NetworkGraphDecodeErrorZ *val = (LDKCResult_NetworkGraphDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCOption_CVec_NetAddressZZ_ref_from_ptr(uint32_t ptr) {
switch(obj->tag) {
case LDKCOption_CVec_NetAddressZZ_Some: {
LDKCVec_NetAddressZ some_var = obj->some;
- uint32_tArray some_arr = init_arr(some_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray some_arr = NULL;
+ some_arr = init_arr(some_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *some_arr_ptr = (uint32_t*)(some_arr + 4);
for (size_t m = 0; m < some_var.datalen; m++) {
uint64_t some_conv_12_ref = ((uint64_t)&some_var.data[m]) | 1;
some_arr_ptr[m] = some_conv_12_ref;
}
+
return 0 /* LDKCOption_CVec_NetAddressZZ - Some */; (void) some_arr;
}
case LDKCOption_CVec_NetAddressZZ_None: {
default: abort();
}
}
-jboolean __attribute__((visibility("default"))) TS_LDKCResult_NetAddressu8Z_result_ok(uint32_t arg) {
- return ((LDKCResult_NetAddressu8Z*)arg)->result_ok;
-}
-uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NetAddressu8Z_get_ok(uint32_t arg) {
- LDKCResult_NetAddressu8Z *val = (LDKCResult_NetAddressu8Z*)(arg & ~1);
- CHECK(val->result_ok);
- uint64_t res_ref = ((uint64_t)&(*val->contents.result)) | 1;
- return res_ref;
-}
-int8_t __attribute__((visibility("default"))) TS_LDKCResult_NetAddressu8Z_get_err(uint32_t arg) {
- LDKCResult_NetAddressu8Z *val = (LDKCResult_NetAddressu8Z*)(arg & ~1);
- CHECK(!val->result_ok);
- return *val->contents.err;
-}
-jboolean __attribute__((visibility("default"))) TS_LDKCResult_CResult_NetAddressu8ZDecodeErrorZ_result_ok(uint32_t arg) {
- return ((LDKCResult_CResult_NetAddressu8ZDecodeErrorZ*)arg)->result_ok;
-}
-uint32_t __attribute__((visibility("default"))) TS_LDKCResult_CResult_NetAddressu8ZDecodeErrorZ_get_ok(uint32_t arg) {
- LDKCResult_CResult_NetAddressu8ZDecodeErrorZ *val = (LDKCResult_CResult_NetAddressu8ZDecodeErrorZ*)(arg & ~1);
- CHECK(val->result_ok);
- LDKCResult_NetAddressu8Z* res_conv = MALLOC(sizeof(LDKCResult_NetAddressu8Z), "LDKCResult_NetAddressu8Z");
- *res_conv = (*val->contents.result);
- *res_conv = CResult_NetAddressu8Z_clone(res_conv);
- return (uint64_t)res_conv;
-}
-uint32_t __attribute__((visibility("default"))) TS_LDKCResult_CResult_NetAddressu8ZDecodeErrorZ_get_err(uint32_t arg) {
- LDKCResult_CResult_NetAddressu8ZDecodeErrorZ *val = (LDKCResult_CResult_NetAddressu8ZDecodeErrorZ*)(arg & ~1);
- CHECK(!val->result_ok);
- LDKDecodeError err_var = (*val->contents.err);
- 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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
- return err_ref;
-}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_NetAddressDecodeErrorZ_result_ok(uint32_t arg) {
return ((LDKCResult_NetAddressDecodeErrorZ*)arg)->result_ok;
}
LDKCResult_NetAddressDecodeErrorZ *val = (LDKCResult_NetAddressDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCVec_UpdateAddHTLCZ_new(uint32_tArray elems) {
LDKCResult_AcceptChannelDecodeErrorZ *val = (LDKCResult_AcceptChannelDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKAcceptChannel 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_AcceptChannelDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_AcceptChannelDecodeErrorZ *val = (LDKCResult_AcceptChannelDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_AnnouncementSignaturesDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_AnnouncementSignaturesDecodeErrorZ *val = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKAnnouncementSignatures 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_AnnouncementSignaturesDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_AnnouncementSignaturesDecodeErrorZ *val = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_ChannelReestablishDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_ChannelReestablishDecodeErrorZ *val = (LDKCResult_ChannelReestablishDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKChannelReestablish 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelReestablishDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_ChannelReestablishDecodeErrorZ *val = (LDKCResult_ChannelReestablishDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_ClosingSignedDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_ClosingSignedDecodeErrorZ *val = (LDKCResult_ClosingSignedDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKClosingSigned 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ClosingSignedDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_ClosingSignedDecodeErrorZ *val = (LDKCResult_ClosingSignedDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_ClosingSignedFeeRangeDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *val = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKClosingSignedFeeRange 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *val = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_CommitmentSignedDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_CommitmentSignedDecodeErrorZ *val = (LDKCResult_CommitmentSignedDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKCommitmentSigned 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_CommitmentSignedDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_CommitmentSignedDecodeErrorZ *val = (LDKCResult_CommitmentSignedDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_FundingCreatedDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_FundingCreatedDecodeErrorZ *val = (LDKCResult_FundingCreatedDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKFundingCreated 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_FundingCreatedDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_FundingCreatedDecodeErrorZ *val = (LDKCResult_FundingCreatedDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_FundingSignedDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_FundingSignedDecodeErrorZ *val = (LDKCResult_FundingSignedDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKFundingSigned 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_FundingSignedDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_FundingSignedDecodeErrorZ *val = (LDKCResult_FundingSignedDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_FundingLockedDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_FundingLockedDecodeErrorZ *val = (LDKCResult_FundingLockedDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKFundingLocked 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_FundingLockedDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_FundingLockedDecodeErrorZ *val = (LDKCResult_FundingLockedDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_InitDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_InitDecodeErrorZ *val = (LDKCResult_InitDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKInit 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InitDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_InitDecodeErrorZ *val = (LDKCResult_InitDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_OpenChannelDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_OpenChannelDecodeErrorZ *val = (LDKCResult_OpenChannelDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKOpenChannel 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_OpenChannelDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_OpenChannelDecodeErrorZ *val = (LDKCResult_OpenChannelDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_RevokeAndACKDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_RevokeAndACKDecodeErrorZ *val = (LDKCResult_RevokeAndACKDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKRevokeAndACK 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_RevokeAndACKDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_RevokeAndACKDecodeErrorZ *val = (LDKCResult_RevokeAndACKDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_ShutdownDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_ShutdownDecodeErrorZ *val = (LDKCResult_ShutdownDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKShutdown 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ShutdownDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_ShutdownDecodeErrorZ *val = (LDKCResult_ShutdownDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_UpdateFailHTLCDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_UpdateFailHTLCDecodeErrorZ *val = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKUpdateFailHTLC 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UpdateFailHTLCDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_UpdateFailHTLCDecodeErrorZ *val = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *val = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKUpdateFailMalformedHTLC 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *val = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_UpdateFeeDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_UpdateFeeDecodeErrorZ *val = (LDKCResult_UpdateFeeDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKUpdateFee 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UpdateFeeDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_UpdateFeeDecodeErrorZ *val = (LDKCResult_UpdateFeeDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_UpdateFulfillHTLCDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_UpdateFulfillHTLCDecodeErrorZ *val = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKUpdateFulfillHTLC 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UpdateFulfillHTLCDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_UpdateFulfillHTLCDecodeErrorZ *val = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_UpdateAddHTLCDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_UpdateAddHTLCDecodeErrorZ *val = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKUpdateAddHTLC 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UpdateAddHTLCDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_UpdateAddHTLCDecodeErrorZ *val = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_PingDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_PingDecodeErrorZ *val = (LDKCResult_PingDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKPing 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PingDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_PingDecodeErrorZ *val = (LDKCResult_PingDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_PongDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_PongDecodeErrorZ *val = (LDKCResult_PongDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKPong 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_PongDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_PongDecodeErrorZ *val = (LDKCResult_PongDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *val = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKUnsignedChannelAnnouncement 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *val = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_ChannelAnnouncementDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_ChannelAnnouncementDecodeErrorZ *val = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKChannelAnnouncement 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelAnnouncementDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_ChannelAnnouncementDecodeErrorZ *val = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_UnsignedChannelUpdateDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_UnsignedChannelUpdateDecodeErrorZ *val = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKUnsignedChannelUpdate 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UnsignedChannelUpdateDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_UnsignedChannelUpdateDecodeErrorZ *val = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_ChannelUpdateDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_ChannelUpdateDecodeErrorZ *val = (LDKCResult_ChannelUpdateDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKChannelUpdate 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelUpdateDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_ChannelUpdateDecodeErrorZ *val = (LDKCResult_ChannelUpdateDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_ErrorMessageDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_ErrorMessageDecodeErrorZ *val = (LDKCResult_ErrorMessageDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKErrorMessage 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ErrorMessageDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_ErrorMessageDecodeErrorZ *val = (LDKCResult_ErrorMessageDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *val = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKUnsignedNodeAnnouncement 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *val = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_NodeAnnouncementDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_NodeAnnouncementDecodeErrorZ *val = (LDKCResult_NodeAnnouncementDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKNodeAnnouncement 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NodeAnnouncementDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_NodeAnnouncementDecodeErrorZ *val = (LDKCResult_NodeAnnouncementDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_QueryShortChannelIdsDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_QueryShortChannelIdsDecodeErrorZ *val = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKQueryShortChannelIds 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_QueryShortChannelIdsDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_QueryShortChannelIdsDecodeErrorZ *val = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *val = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKReplyShortChannelIdsEnd 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *val = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_QueryChannelRangeDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_QueryChannelRangeDecodeErrorZ *val = (LDKCResult_QueryChannelRangeDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKQueryChannelRange 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_QueryChannelRangeDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_QueryChannelRangeDecodeErrorZ *val = (LDKCResult_QueryChannelRangeDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_ReplyChannelRangeDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_ReplyChannelRangeDecodeErrorZ *val = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKReplyChannelRange 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ReplyChannelRangeDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_ReplyChannelRangeDecodeErrorZ *val = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_GossipTimestampFilterDecodeErrorZ_result_ok(uint32_t arg) {
LDKCResult_GossipTimestampFilterDecodeErrorZ *val = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKGossipTimestampFilter 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_GossipTimestampFilterDecodeErrorZ_get_err(uint32_t arg) {
LDKCResult_GossipTimestampFilterDecodeErrorZ *val = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)(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.
- uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+ err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKSignOrCreationError_ref_from_ptr(uint32_t ptr) {
LDKCResult_InvoiceSignOrCreationErrorZ *val = (LDKCResult_InvoiceSignOrCreationErrorZ*)(arg & ~1);
CHECK(val->result_ok);
LDKInvoice 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InvoiceSignOrCreationErrorZ_get_err(uint32_t arg) {
LDKCOption_C2Tuple_usizeTransactionZZ register_output_LDKFilter_jcall(const void* this_arg, LDKWatchedOutput output) {
LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
LDKWatchedOutput output_var = output;
+ uint64_t output_ref = 0;
CHECK((((uint64_t)output_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&output_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t output_ref = (uint64_t)output_var.inner;
+ output_ref = (uint64_t)output_var.inner;
if (output_var.is_owned) {
output_ref |= 1;
}
LDKCOption_FilterZ *obj = (LDKCOption_FilterZ*)(ptr & ~1);
switch(obj->tag) {
case LDKCOption_FilterZ_Some: {
- LDKFilter* some_ret =MALLOC(sizeof(LDKFilter), "LDKFilter");
+ LDKFilter* some_ret = MALLOC(sizeof(LDKFilter), "LDKFilter");
*some_ret = obj->some;
// Warning: We likely need to clone here, but no clone is available, so we just do it for Java instances
return 0 /* LDKCOption_FilterZ - Some */; (void) (uint64_t)some_ret;
LDKCResult_LockedChannelMonitorNoneZ *val = (LDKCResult_LockedChannelMonitorNoneZ*)(arg & ~1);
CHECK(val->result_ok);
LDKLockedChannelMonitor 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.
- uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+ res_ref = (uint64_t)res_var.inner & ~1;
return res_ref;
}
void __attribute__((visibility("default"))) TS_LDKCResult_LockedChannelMonitorNoneZ_get_err(uint32_t arg) {
if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
LDKMessageSendEventsProvider* this_arg_conv = (LDKMessageSendEventsProvider*)this_arg_ptr;
LDKCVec_MessageSendEventZ ret_var = (this_arg_conv->get_and_clear_pending_msg_events)(this_arg_conv->this_arg);
- uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t s = 0; s < ret_var.datalen; s++) {
LDKMessageSendEvent *ret_conv_18_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
uint64_t ret_conv_18_ref = (uint64_t)ret_conv_18_copy;
ret_arr_ptr[s] = ret_conv_18_ref;
}
+
FREE(ret_var.data);
return ret_arr;
}
}
void process_pending_events_LDKEventsProvider_jcall(const void* this_arg, LDKEventHandler handler) {
LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
- LDKEventHandler* handler_ret =MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
+ LDKEventHandler* handler_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
*handler_ret = handler;
js_invoke_function_1(j_calls->process_pending_events_meth, (uint64_t)handler_ret);
}
int8_tArray header_arr = init_arr(80, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(header_arr + 4), *header, 80);
LDKCVec_C2Tuple_usizeTransactionZZ txdata_var = txdata;
- uint32_tArray txdata_arr = init_arr(txdata_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray txdata_arr = NULL;
+ txdata_arr = init_arr(txdata_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *txdata_arr_ptr = (uint32_t*)(txdata_arr + 4);
for (size_t c = 0; c < txdata_var.datalen; c++) {
LDKC2Tuple_usizeTransactionZ* txdata_conv_28_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
*txdata_conv_28_conv = txdata_var.data[c];
txdata_arr_ptr[c] = ((uint64_t)txdata_conv_28_conv);
}
+
FREE(txdata_var.data);
js_invoke_function_3(j_calls->transactions_confirmed_meth, header_arr, txdata_arr, height);
}
if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
LDKCVec_TxidZ ret_var = (this_arg_conv->get_relevant_txids)(this_arg_conv->this_arg);
- ptrArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native ptrArray Bytes");
+ ptrArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native ptrArray Bytes");
int8_tArray *ret_arr_ptr = (int8_tArray*)(ret_arr + 4);
for (size_t m = 0; m < ret_var.datalen; m++) {
int8_tArray ret_conv_12_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(ret_conv_12_arr + 4), ret_var.data[m].data, 32);
ret_arr_ptr[m] = ret_conv_12_arr;
}
+
FREE(ret_var.data);
return ret_arr;
}
FREE(j_calls);
}
}
-LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint id, const LDKChannelMonitor * data) {
+LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) {
LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg;
- LDKOutPoint id_var = id;
- CHECK((((uint64_t)id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
- CHECK((((uint64_t)&id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t id_ref = (uint64_t)id_var.inner;
- if (id_var.is_owned) {
- id_ref |= 1;
+ LDKOutPoint channel_id_var = channel_id;
+ uint64_t channel_id_ref = 0;
+ CHECK((((uint64_t)channel_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&channel_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ channel_id_ref = (uint64_t)channel_id_var.inner;
+ if (channel_id_var.is_owned) {
+ channel_id_ref |= 1;
}
LDKChannelMonitor data_var = *data;
+ uint64_t data_ref = 0;
data_var = ChannelMonitor_clone(data);
CHECK((((uint64_t)data_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&data_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t data_ref = (uint64_t)data_var.inner;
+ data_ref = (uint64_t)data_var.inner;
if (data_var.is_owned) {
data_ref |= 1;
}
- uint32_t ret = js_invoke_function_2(j_calls->persist_new_channel_meth, id_ref, data_ref);
+ LDKMonitorUpdateId update_id_var = update_id;
+ uint64_t update_id_ref = 0;
+ CHECK((((uint64_t)update_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&update_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ update_id_ref = (uint64_t)update_id_var.inner;
+ if (update_id_var.is_owned) {
+ update_id_ref |= 1;
+ }
+ uint32_t ret = js_invoke_function_3(j_calls->persist_new_channel_meth, channel_id_ref, data_ref, update_id_ref);
void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
-LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint id, const LDKChannelMonitorUpdate * update, const LDKChannelMonitor * data) {
+LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, const LDKChannelMonitorUpdate * update, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) {
LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg;
- LDKOutPoint id_var = id;
- CHECK((((uint64_t)id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
- CHECK((((uint64_t)&id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t id_ref = (uint64_t)id_var.inner;
- if (id_var.is_owned) {
- id_ref |= 1;
+ LDKOutPoint channel_id_var = channel_id;
+ uint64_t channel_id_ref = 0;
+ CHECK((((uint64_t)channel_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&channel_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ channel_id_ref = (uint64_t)channel_id_var.inner;
+ if (channel_id_var.is_owned) {
+ channel_id_ref |= 1;
}
LDKChannelMonitorUpdate update_var = *update;
- update_var = ChannelMonitorUpdate_clone(update);
- CHECK((((uint64_t)update_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
- CHECK((((uint64_t)&update_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t update_ref = (uint64_t)update_var.inner;
- if (update_var.is_owned) {
- update_ref |= 1;
+ uint64_t update_ref = 0;
+ if ((uint64_t)update_var.inner > 4096) {
+ update_var = ChannelMonitorUpdate_clone(update);
+ CHECK((((uint64_t)update_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&update_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ update_ref = (uint64_t)update_var.inner;
+ if (update_var.is_owned) {
+ update_ref |= 1;
+ }
}
LDKChannelMonitor data_var = *data;
+ uint64_t data_ref = 0;
data_var = ChannelMonitor_clone(data);
CHECK((((uint64_t)data_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&data_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t data_ref = (uint64_t)data_var.inner;
+ data_ref = (uint64_t)data_var.inner;
if (data_var.is_owned) {
data_ref |= 1;
}
- uint32_t ret = js_invoke_function_3(j_calls->update_persisted_channel_meth, id_ref, update_ref, data_ref);
+ LDKMonitorUpdateId update_id_var = update_id;
+ uint64_t update_id_ref = 0;
+ CHECK((((uint64_t)update_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&update_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ update_id_ref = (uint64_t)update_id_var.inner;
+ if (update_id_var.is_owned) {
+ update_id_ref |= 1;
+ }
+ uint32_t ret = js_invoke_function_4(j_calls->update_persisted_channel_meth, channel_id_ref, update_ref, data_ref, update_id_ref);
void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
CHECK_ACCESS(ret_ptr);
LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
*res_ptr = LDKPersist_init(o);
return (long)res_ptr;
}
-uint32_t __attribute__((visibility("default"))) TS_Persist_persist_new_channel(uint32_t this_arg, uint32_t id, uint32_t data) {
+uint32_t __attribute__((visibility("default"))) TS_Persist_persist_new_channel(uint32_t this_arg, uint32_t channel_id, uint32_t data, uint32_t update_id) {
void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr;
- LDKOutPoint id_conv;
- id_conv.inner = (void*)(id & (~1));
- id_conv.is_owned = (id & 1) || (id == 0);
- id_conv = OutPoint_clone(&id_conv);
+ LDKOutPoint channel_id_conv;
+ channel_id_conv.inner = (void*)(channel_id & (~1));
+ channel_id_conv.is_owned = (channel_id & 1) || (channel_id == 0);
+ channel_id_conv = OutPoint_clone(&channel_id_conv);
LDKChannelMonitor data_conv;
data_conv.inner = (void*)(data & (~1));
data_conv.is_owned = false;
+ LDKMonitorUpdateId update_id_conv;
+ update_id_conv.inner = (void*)(update_id & (~1));
+ update_id_conv.is_owned = (update_id & 1) || (update_id == 0);
+ update_id_conv = MonitorUpdateId_clone(&update_id_conv);
LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
- *ret_conv = (this_arg_conv->persist_new_channel)(this_arg_conv->this_arg, id_conv, &data_conv);
+ *ret_conv = (this_arg_conv->persist_new_channel)(this_arg_conv->this_arg, channel_id_conv, &data_conv, update_id_conv);
return (uint64_t)ret_conv;
}
-uint32_t __attribute__((visibility("default"))) TS_Persist_update_persisted_channel(uint32_t this_arg, uint32_t id, uint32_t update, uint32_t data) {
+uint32_t __attribute__((visibility("default"))) TS_Persist_update_persisted_channel(uint32_t this_arg, uint32_t channel_id, uint32_t update, uint32_t data, uint32_t update_id) {
void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr;
- LDKOutPoint id_conv;
- id_conv.inner = (void*)(id & (~1));
- id_conv.is_owned = (id & 1) || (id == 0);
- id_conv = OutPoint_clone(&id_conv);
+ LDKOutPoint channel_id_conv;
+ channel_id_conv.inner = (void*)(channel_id & (~1));
+ channel_id_conv.is_owned = (channel_id & 1) || (channel_id == 0);
+ channel_id_conv = OutPoint_clone(&channel_id_conv);
LDKChannelMonitorUpdate update_conv;
update_conv.inner = (void*)(update & (~1));
update_conv.is_owned = false;
LDKChannelMonitor data_conv;
data_conv.inner = (void*)(data & (~1));
data_conv.is_owned = false;
+ LDKMonitorUpdateId update_id_conv;
+ update_id_conv.inner = (void*)(update_id & (~1));
+ update_id_conv.is_owned = (update_id & 1) || (update_id == 0);
+ update_id_conv = MonitorUpdateId_clone(&update_id_conv);
LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
- *ret_conv = (this_arg_conv->update_persisted_channel)(this_arg_conv->this_arg, id_conv, &update_conv, &data_conv);
+ *ret_conv = (this_arg_conv->update_persisted_channel)(this_arg_conv->this_arg, channel_id_conv, &update_conv, &data_conv, update_id_conv);
return (uint64_t)ret_conv;
}
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
LDKInitFeatures their_features_var = their_features;
+ uint64_t their_features_ref = 0;
CHECK((((uint64_t)their_features_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&their_features_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t their_features_ref = (uint64_t)their_features_var.inner;
+ their_features_ref = (uint64_t)their_features_var.inner;
if (their_features_var.is_owned) {
their_features_ref |= 1;
}
LDKOpenChannel msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = OpenChannel_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
LDKInitFeatures their_features_var = their_features;
+ uint64_t their_features_ref = 0;
CHECK((((uint64_t)their_features_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&their_features_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t their_features_ref = (uint64_t)their_features_var.inner;
+ their_features_ref = (uint64_t)their_features_var.inner;
if (their_features_var.is_owned) {
their_features_ref |= 1;
}
LDKAcceptChannel msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = AcceptChannel_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
LDKFundingCreated msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = FundingCreated_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
LDKFundingSigned msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = FundingSigned_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
LDKFundingLocked msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = FundingLocked_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
LDKInitFeatures their_features_var = *their_features;
+ uint64_t their_features_ref = 0;
their_features_var = InitFeatures_clone(their_features);
CHECK((((uint64_t)their_features_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&their_features_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t their_features_ref = (uint64_t)their_features_var.inner;
+ their_features_ref = (uint64_t)their_features_var.inner;
if (their_features_var.is_owned) {
their_features_ref |= 1;
}
LDKShutdown msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = Shutdown_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
LDKClosingSigned msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = ClosingSigned_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
LDKUpdateAddHTLC msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = UpdateAddHTLC_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
LDKUpdateFulfillHTLC msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = UpdateFulfillHTLC_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
LDKUpdateFailHTLC msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = UpdateFailHTLC_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
LDKUpdateFailMalformedHTLC msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = UpdateFailMalformedHTLC_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
LDKCommitmentSigned msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = CommitmentSigned_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
LDKRevokeAndACK msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = RevokeAndACK_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
LDKUpdateFee msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = UpdateFee_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
LDKAnnouncementSignatures msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = AnnouncementSignatures_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
LDKInit msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = Init_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
LDKChannelReestablish msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = ChannelReestablish_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
LDKChannelUpdate msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = ChannelUpdate_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
LDKErrorMessage msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = ErrorMessage_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
LDKCResult_boolLightningErrorZ handle_node_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKNodeAnnouncement * msg) {
LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
LDKNodeAnnouncement msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = NodeAnnouncement_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
LDKCResult_boolLightningErrorZ handle_channel_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKChannelAnnouncement * msg) {
LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
LDKChannelAnnouncement msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = ChannelAnnouncement_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
LDKCResult_boolLightningErrorZ handle_channel_update_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKChannelUpdate * msg) {
LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
LDKChannelUpdate msg_var = *msg;
+ uint64_t msg_ref = 0;
msg_var = ChannelUpdate_clone(msg);
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
LDKInit init_var = *init;
+ uint64_t init_ref = 0;
init_var = Init_clone(init);
CHECK((((uint64_t)init_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&init_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t init_ref = (uint64_t)init_var.inner;
+ init_ref = (uint64_t)init_var.inner;
if (init_var.is_owned) {
init_ref |= 1;
}
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
LDKReplyChannelRange msg_var = msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
LDKReplyShortChannelIdsEnd msg_var = msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
LDKQueryChannelRange msg_var = msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
LDKQueryShortChannelIds msg_var = msg;
+ uint64_t msg_ref = 0;
CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t msg_ref = (uint64_t)msg_var.inner;
+ msg_ref = (uint64_t)msg_var.inner;
if (msg_var.is_owned) {
msg_ref |= 1;
}
if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret_var = (this_arg_conv->get_next_channel_announcements)(this_arg_conv->this_arg, starting_point, batch_amount);
- uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t h = 0; h < ret_var.datalen; h++) {
LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv_59_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
*ret_conv_59_conv = ret_var.data[h];
ret_arr_ptr[h] = ((uint64_t)ret_conv_59_conv);
}
+
FREE(ret_var.data);
return ret_arr;
}
CHECK(*((uint32_t*)starting_point) == 33);
memcpy(starting_point_ref.compressed_form, (uint8_t*)(starting_point + 4), 33);
LDKCVec_NodeAnnouncementZ ret_var = (this_arg_conv->get_next_node_announcements)(this_arg_conv->this_arg, starting_point_ref, batch_amount);
- uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t s = 0; s < ret_var.datalen; s++) {
LDKNodeAnnouncement ret_conv_18_var = ret_var.data[s];
+ uint64_t ret_conv_18_ref = 0;
CHECK((((uint64_t)ret_conv_18_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_conv_18_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t ret_conv_18_ref = (uint64_t)ret_conv_18_var.inner;
+ ret_conv_18_ref = (uint64_t)ret_conv_18_var.inner;
if (ret_conv_18_var.is_owned) {
ret_conv_18_ref |= 1;
}
ret_arr_ptr[s] = ret_conv_18_ref;
}
+
FREE(ret_var.data);
return ret_arr;
}
}
LDKCResult_NoneLightningErrorZ handle_custom_message_LDKCustomMessageHandler_jcall(const void* this_arg, LDKType msg, LDKPublicKey sender_node_id) {
LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) this_arg;
- LDKType* msg_ret =MALLOC(sizeof(LDKType), "LDKType");
+ LDKType* msg_ret = MALLOC(sizeof(LDKType), "LDKType");
*msg_ret = msg;
int8_tArray sender_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(sender_node_id_arr + 4), sender_node_id.compressed_form, 33);
if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
LDKCustomMessageHandler* this_arg_conv = (LDKCustomMessageHandler*)this_arg_ptr;
LDKCVec_C2Tuple_PublicKeyTypeZZ ret_var = (this_arg_conv->get_and_clear_pending_msg)(this_arg_conv->this_arg);
- uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t z = 0; z < ret_var.datalen; z++) {
LDKC2Tuple_PublicKeyTypeZ* ret_conv_25_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ");
*ret_conv_25_conv = ret_var.data[z];
ret_arr_ptr[z] = ((uint64_t)ret_conv_25_conv);
}
+
FREE(ret_var.data);
return ret_arr;
}
typedef struct LDKScore_JCalls {
atomic_size_t refcnt;
uint32_t channel_penalty_msat_meth;
+ uint32_t payment_path_failed_meth;
+ uint32_t write_meth;
} LDKScore_JCalls;
static void LDKScore_JCalls_free(void* this_arg) {
LDKScore_JCalls *j_calls = (LDKScore_JCalls*) 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->write_meth);
FREE(j_calls);
}
}
-uint64_t channel_penalty_msat_LDKScore_jcall(const void* this_arg, uint64_t short_channel_id) {
+uint64_t channel_penalty_msat_LDKScore_jcall(const void* this_arg, uint64_t short_channel_id, const LDKNodeId * source, const LDKNodeId * target) {
+ LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
+ LDKNodeId source_var = *source;
+ uint64_t source_ref = 0;
+ source_var = NodeId_clone(source);
+ CHECK((((uint64_t)source_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&source_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ source_ref = (uint64_t)source_var.inner;
+ if (source_var.is_owned) {
+ source_ref |= 1;
+ }
+ LDKNodeId target_var = *target;
+ uint64_t target_ref = 0;
+ target_var = NodeId_clone(target);
+ CHECK((((uint64_t)target_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&target_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ target_ref = (uint64_t)target_var.inner;
+ 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);
+}
+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;
+ 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.
+ 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_2(j_calls->payment_path_failed_meth, path_arr, short_channel_id);
+}
+LDKCVec_u8Z write_LDKScore_jcall(const void* this_arg) {
LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
- return js_invoke_function_1(j_calls->channel_penalty_msat_meth, short_channel_id);
+ int8_tArray ret = js_invoke_function_0(j_calls->write_meth);
+ LDKCVec_u8Z ret_ref;
+ ret_ref.datalen = *((uint32_t*)ret);
+ ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
+ memcpy(ret_ref.data, (uint8_t*)(ret + 4), ret_ref.datalen);
+ return ret_ref;
}
static void LDKScore_JCalls_cloned(LDKScore* new_obj) {
LDKScore_JCalls *j_calls = (LDKScore_JCalls*) new_obj->this_arg;
LDKScore ret = {
.this_arg = (void*) calls,
.channel_penalty_msat = channel_penalty_msat_LDKScore_jcall,
+ .payment_path_failed = payment_path_failed_LDKScore_jcall,
+ .write = write_LDKScore_jcall,
.free = LDKScore_JCalls_free,
};
return ret;
*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) {
+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) {
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;
- int64_t ret_val = (this_arg_conv->channel_penalty_msat)(this_arg_conv->this_arg, short_channel_id);
+ LDKNodeId source_conv;
+ source_conv.inner = (void*)(source & (~1));
+ source_conv.is_owned = false;
+ LDKNodeId target_conv;
+ target_conv.inner = (void*)(target & (~1));
+ target_conv.is_owned = false;
+ int64_t ret_val = (this_arg_conv->channel_penalty_msat)(this_arg_conv->this_arg, short_channel_id, &source_conv, &target_conv);
return ret_val;
}
+void __attribute__((visibility("default"))) TS_Score_payment_path_failed(uint32_t this_arg, uint32_tArray path, int64_t short_channel_id) {
+ 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);
+ path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
+ path_constr.data[k] = path_conv_10_conv;
+ }
+ (this_arg_conv->payment_path_failed)(this_arg_conv->this_arg, path_constr, short_channel_id);
+}
+
+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); }
+ LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
+ LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
+ 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;
+}
+
typedef struct LDKChannelManagerPersister_JCalls {
atomic_size_t refcnt;
uint32_t persist_manager_meth;
LDKCResult_NoneErrorZ persist_manager_LDKChannelManagerPersister_jcall(const void* this_arg, const LDKChannelManager * channel_manager) {
LDKChannelManagerPersister_JCalls *j_calls = (LDKChannelManagerPersister_JCalls*) this_arg;
LDKChannelManager channel_manager_var = *channel_manager;
+ uint64_t channel_manager_ref = 0;
// Warning: we may need a move here but no clone is available for LDKChannelManager
CHECK((((uint64_t)channel_manager_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&channel_manager_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t channel_manager_ref = (uint64_t)channel_manager_var.inner;
+ channel_manager_ref = (uint64_t)channel_manager_var.inner;
if (channel_manager_var.is_owned) {
channel_manager_ref |= 1;
}
default: abort();
}
}
-jstring __attribute__((visibility("default"))) TS__ldk_get_compiled_version() {
+typedef struct LDKPayer_JCalls {
+ atomic_size_t refcnt;
+ uint32_t node_id_meth;
+ uint32_t first_hops_meth;
+ uint32_t send_payment_meth;
+ uint32_t retry_payment_meth;
+} LDKPayer_JCalls;
+static void LDKPayer_JCalls_free(void* this_arg) {
+ LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
+ if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
+ 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->retry_payment_meth);
+ FREE(j_calls);
+ }
+}
+LDKPublicKey node_id_LDKPayer_jcall(const void* this_arg) {
+ LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
+ int8_tArray ret = js_invoke_function_0(j_calls->node_id_meth);
+ LDKPublicKey ret_ref;
+ CHECK(*((uint32_t*)ret) == 33);
+ memcpy(ret_ref.compressed_form, (uint8_t*)(ret + 4), 33);
+ return ret_ref;
+}
+LDKCVec_ChannelDetailsZ first_hops_LDKPayer_jcall(const void* this_arg) {
+ LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
+ uint32_tArray ret = js_invoke_function_0(j_calls->first_hops_meth);
+ LDKCVec_ChannelDetailsZ ret_constr;
+ ret_constr.datalen = *((uint32_t*)ret);
+ if (ret_constr.datalen > 0)
+ ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
+ else
+ ret_constr.data = NULL;
+ uint32_t* ret_vals = (uint32_t*)(ret + 4);
+ for (size_t q = 0; q < ret_constr.datalen; q++) {
+ uint32_t ret_conv_16 = ret_vals[q];
+ LDKChannelDetails ret_conv_16_conv;
+ ret_conv_16_conv.inner = (void*)(ret_conv_16 & (~1));
+ ret_conv_16_conv.is_owned = (ret_conv_16 & 1) || (ret_conv_16 == 0);
+ ret_conv_16_conv = ChannelDetails_clone(&ret_conv_16_conv);
+ ret_constr.data[q] = ret_conv_16_conv;
+ }
+ return ret_constr;
+}
+LDKCResult_PaymentIdPaymentSendFailureZ send_payment_LDKPayer_jcall(const void* this_arg, const LDKRoute * route, LDKThirtyTwoBytes payment_hash, LDKThirtyTwoBytes payment_secret) {
+ 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.
+ route_ref = (uint64_t)route_var.inner;
+ if (route_var.is_owned) {
+ route_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.data, 32);
+ int8_tArray payment_secret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(payment_secret_arr + 4), payment_secret.data, 32);
+ uint32_t ret = js_invoke_function_3(j_calls->send_payment_meth, route_ref, payment_hash_arr, payment_secret_arr);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_PaymentIdPaymentSendFailureZ ret_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(ret_ptr);
+ ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone((LDKCResult_PaymentIdPaymentSendFailureZ*)(((uint64_t)ret) & ~1));
+ 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;
+ 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.
+ route_ref = (uint64_t)route_var.inner;
+ if (route_var.is_owned) {
+ route_ref |= 1;
+ }
+ 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);
+ uint32_t ret = js_invoke_function_2(j_calls->retry_payment_meth, route_ref, payment_id_arr);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NonePaymentSendFailureZ ret_conv = *(LDKCResult_NonePaymentSendFailureZ*)(ret_ptr);
+ ret_conv = CResult_NonePaymentSendFailureZ_clone((LDKCResult_NonePaymentSendFailureZ*)(((uint64_t)ret) & ~1));
+ return ret_conv;
+}
+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);
+}
+static inline LDKPayer LDKPayer_init (/*TODO: JS Object Reference */void* o) {
+ LDKPayer_JCalls *calls = MALLOC(sizeof(LDKPayer_JCalls), "LDKPayer_JCalls");
+ atomic_init(&calls->refcnt, 1);
+ //TODO: Assign calls->o from o
+
+ LDKPayer ret = {
+ .this_arg = (void*) calls,
+ .node_id = node_id_LDKPayer_jcall,
+ .first_hops = first_hops_LDKPayer_jcall,
+ .send_payment = send_payment_LDKPayer_jcall,
+ .retry_payment = retry_payment_LDKPayer_jcall,
+ .free = LDKPayer_JCalls_free,
+ };
+ return ret;
+}
+long __attribute__((visibility("default"))) TS_LDKPayer_new(/*TODO: JS Object Reference */void* o) {
+ LDKPayer *res_ptr = MALLOC(sizeof(LDKPayer), "LDKPayer");
+ *res_ptr = LDKPayer_init(o);
+ return (long)res_ptr;
+}
+int8_tArray __attribute__((visibility("default"))) TS_Payer_node_id(uint32_t this_arg) {
+ 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;
+ int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), (this_arg_conv->node_id)(this_arg_conv->this_arg).compressed_form, 33);
+ return ret_arr;
+}
+
+uint32_tArray __attribute__((visibility("default"))) TS_Payer_first_hops(uint32_t this_arg) {
+ 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;
+ LDKCVec_ChannelDetailsZ ret_var = (this_arg_conv->first_hops)(this_arg_conv->this_arg);
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
+ for (size_t q = 0; q < ret_var.datalen; q++) {
+ LDKChannelDetails ret_conv_16_var = ret_var.data[q];
+ uint64_t ret_conv_16_ref = 0;
+ CHECK((((uint64_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner;
+ if (ret_conv_16_var.is_owned) {
+ ret_conv_16_ref |= 1;
+ }
+ ret_arr_ptr[q] = ret_conv_16_ref;
+ }
+
+ FREE(ret_var.data);
+ return ret_arr;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_Payer_send_payment(uint32_t this_arg, uint32_t route, int8_tArray payment_hash, int8_tArray payment_secret) {
+ 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;
+ 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_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
+ *ret_conv = (this_arg_conv->send_payment)(this_arg_conv->this_arg, &route_conv, payment_hash_ref, payment_secret_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); }
+ LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
+ LDKRoute route_conv;
+ route_conv.inner = (void*)(route & (~1));
+ route_conv.is_owned = false;
+ LDKThirtyTwoBytes payment_id_ref;
+ CHECK(*((uint32_t*)payment_id) == 32);
+ memcpy(payment_id_ref.data, (uint8_t*)(payment_id + 4), 32);
+ LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
+ *ret_conv = (this_arg_conv->retry_payment)(this_arg_conv->this_arg, &route_conv, payment_id_ref);
+ return (uint64_t)ret_conv;
+}
+
+typedef struct LDKRouter_JCalls {
+ atomic_size_t refcnt;
+ uint32_t find_route_meth;
+} LDKRouter_JCalls;
+static void LDKRouter_JCalls_free(void* this_arg) {
+ LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg;
+ if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
+ js_free(j_calls->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) {
+ 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);
+ LDKRouteParameters params_var = *params;
+ uint64_t params_ref = 0;
+ params_var = RouteParameters_clone(params);
+ CHECK((((uint64_t)params_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)¶ms_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ params_ref = (uint64_t)params_var.inner;
+ if (params_var.is_owned) {
+ params_ref |= 1;
+ }
+ LDKCVec_ChannelDetailsZ *first_hops_var_ptr = first_hops;
+ uint32_tArray first_hops_arr = NULL;
+ if (first_hops != NULL) {
+ LDKCVec_ChannelDetailsZ first_hops_var = *first_hops_var_ptr;
+ first_hops_arr = init_arr(first_hops_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_t *first_hops_arr_ptr = (uint32_t*)(first_hops_arr + 4);
+ for (size_t q = 0; q < first_hops_var.datalen; q++) {
+ LDKChannelDetails first_hops_conv_16_var = first_hops_var.data[q];
+ uint64_t first_hops_conv_16_ref = 0;
+ CHECK((((uint64_t)first_hops_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&first_hops_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ first_hops_conv_16_ref = (uint64_t)first_hops_conv_16_var.inner;
+ if (first_hops_conv_16_var.is_owned) {
+ first_hops_conv_16_ref |= 1;
+ }
+ first_hops_arr_ptr[q] = first_hops_conv_16_ref;
+ }
+
+ }
+ // 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);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_RouteLightningErrorZ ret_conv = *(LDKCResult_RouteLightningErrorZ*)(ret_ptr);
+ ret_conv = CResult_RouteLightningErrorZ_clone((LDKCResult_RouteLightningErrorZ*)(((uint64_t)ret) & ~1));
+ return ret_conv;
+}
+static void LDKRouter_JCalls_cloned(LDKRouter* new_obj) {
+ LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) new_obj->this_arg;
+ atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
+}
+static inline LDKRouter LDKRouter_init (/*TODO: JS Object Reference */void* o) {
+ LDKRouter_JCalls *calls = MALLOC(sizeof(LDKRouter_JCalls), "LDKRouter_JCalls");
+ atomic_init(&calls->refcnt, 1);
+ //TODO: Assign calls->o from o
+
+ LDKRouter ret = {
+ .this_arg = (void*) calls,
+ .find_route = find_route_LDKRouter_jcall,
+ .free = LDKRouter_JCalls_free,
+ };
+ return ret;
+}
+long __attribute__((visibility("default"))) TS_LDKRouter_new(/*TODO: JS Object Reference */void* o) {
+ LDKRouter *res_ptr = MALLOC(sizeof(LDKRouter), "LDKRouter");
+ *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) {
+ 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;
+ LDKPublicKey payer_ref;
+ CHECK(*((uint32_t*)payer) == 33);
+ memcpy(payer_ref.compressed_form, (uint8_t*)(payer + 4), 33);
+ LDKRouteParameters params_conv;
+ params_conv.inner = (void*)(params & (~1));
+ params_conv.is_owned = false;
+ LDKCVec_ChannelDetailsZ first_hops_constr;
+ LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL;
+ if (first_hops != 0) {
+ first_hops_constr.datalen = *((uint32_t*)first_hops);
+ if (first_hops_constr.datalen > 0)
+ first_hops_constr.data = MALLOC(first_hops_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
+ else
+ first_hops_constr.data = NULL;
+ uint32_t* first_hops_vals = (uint32_t*)(first_hops + 4);
+ for (size_t q = 0; q < first_hops_constr.datalen; q++) {
+ uint32_t first_hops_conv_16 = first_hops_vals[q];
+ LDKChannelDetails first_hops_conv_16_conv;
+ first_hops_conv_16_conv.inner = (void*)(first_hops_conv_16 & (~1));
+ first_hops_conv_16_conv.is_owned = (first_hops_conv_16 & 1) || (first_hops_conv_16 == 0);
+ first_hops_constr.data[q] = first_hops_conv_16_conv;
+ }
+ first_hops_ptr = &first_hops_constr;
+ }
+ void* scorer_ptr = (void*)(((uint64_t)scorer) & ~1);
+ 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);
+ if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
+ return (uint64_t)ret_conv;
+}
+
+jstring __attribute__((visibility("default"))) TS__ldk_get_compiled_version() {
LDKStr ret_str = _ldk_get_compiled_version();
jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
Str_free(ret_str);
return (uint64_t)ret_conv;
}
+uint32_t __attribute__((visibility("default"))) TS_CResult_RouteParametersDecodeErrorZ_ok(uint32_t o) {
+ LDKRouteParameters o_conv;
+ o_conv.inner = (void*)(o & (~1));
+ o_conv.is_owned = (o & 1) || (o == 0);
+ o_conv = RouteParameters_clone(&o_conv);
+ LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
+ *ret_conv = CResult_RouteParametersDecodeErrorZ_ok(o_conv);
+ return (uint64_t)ret_conv;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_CResult_RouteParametersDecodeErrorZ_err(uint32_t e) {
+ LDKDecodeError e_conv;
+ e_conv.inner = (void*)(e & (~1));
+ e_conv.is_owned = (e & 1) || (e == 0);
+ e_conv = DecodeError_clone(&e_conv);
+ LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
+ *ret_conv = CResult_RouteParametersDecodeErrorZ_err(e_conv);
+ return (uint64_t)ret_conv;
+}
+
+void __attribute__((visibility("default"))) TS_CResult_RouteParametersDecodeErrorZ_free(uint32_t _res) {
+ if ((_res & 1) != 0) return;
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_RouteParametersDecodeErrorZ _res_conv = *(LDKCResult_RouteParametersDecodeErrorZ*)(_res_ptr);
+ FREE((void*)_res);
+ CResult_RouteParametersDecodeErrorZ_free(_res_conv);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_CResult_RouteParametersDecodeErrorZ_clone(uint32_t orig) {
+ LDKCResult_RouteParametersDecodeErrorZ* orig_conv = (LDKCResult_RouteParametersDecodeErrorZ*)(orig & ~1);
+ LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
+ *ret_conv = CResult_RouteParametersDecodeErrorZ_clone(orig_conv);
+ return (uint64_t)ret_conv;
+}
+
+void __attribute__((visibility("default"))) TS_CVec_RouteHintZ_free(uint32_tArray _res) {
+ LDKCVec_RouteHintZ _res_constr;
+ _res_constr.datalen = *((uint32_t*)_res);
+ if (_res_constr.datalen > 0)
+ _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
+ else
+ _res_constr.data = NULL;
+ uint32_t* _res_vals = (uint32_t*)(_res + 4);
+ for (size_t l = 0; l < _res_constr.datalen; l++) {
+ uint32_t _res_conv_11 = _res_vals[l];
+ LDKRouteHint _res_conv_11_conv;
+ _res_conv_11_conv.inner = (void*)(_res_conv_11 & (~1));
+ _res_conv_11_conv.is_owned = (_res_conv_11 & 1) || (_res_conv_11 == 0);
+ _res_constr.data[l] = _res_conv_11_conv;
+ }
+ CVec_RouteHintZ_free(_res_constr);
+}
+
uint32_t __attribute__((visibility("default"))) TS_COption_u64Z_some(int64_t o) {
LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
*ret_copy = COption_u64Z_some(o);
return ret_ref;
}
-void __attribute__((visibility("default"))) TS_CVec_ChannelDetailsZ_free(uint32_tArray _res) {
- LDKCVec_ChannelDetailsZ _res_constr;
- _res_constr.datalen = *((uint32_t*)_res);
- if (_res_constr.datalen > 0)
- _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
- else
- _res_constr.data = NULL;
- uint32_t* _res_vals = (uint32_t*)(_res + 4);
- for (size_t q = 0; q < _res_constr.datalen; q++) {
- uint32_t _res_conv_16 = _res_vals[q];
- LDKChannelDetails _res_conv_16_conv;
- _res_conv_16_conv.inner = (void*)(_res_conv_16 & (~1));
- _res_conv_16_conv.is_owned = (_res_conv_16 & 1) || (_res_conv_16 == 0);
- _res_constr.data[q] = _res_conv_16_conv;
- }
- CVec_ChannelDetailsZ_free(_res_constr);
+uint32_t __attribute__((visibility("default"))) TS_CResult_PayeeDecodeErrorZ_ok(uint32_t o) {
+ LDKPayee o_conv;
+ o_conv.inner = (void*)(o & (~1));
+ o_conv.is_owned = (o & 1) || (o == 0);
+ o_conv = Payee_clone(&o_conv);
+ LDKCResult_PayeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeeDecodeErrorZ), "LDKCResult_PayeeDecodeErrorZ");
+ *ret_conv = CResult_PayeeDecodeErrorZ_ok(o_conv);
+ return (uint64_t)ret_conv;
}
-void __attribute__((visibility("default"))) TS_CVec_RouteHintZ_free(uint32_tArray _res) {
- LDKCVec_RouteHintZ _res_constr;
+uint32_t __attribute__((visibility("default"))) TS_CResult_PayeeDecodeErrorZ_err(uint32_t e) {
+ LDKDecodeError e_conv;
+ e_conv.inner = (void*)(e & (~1));
+ e_conv.is_owned = (e & 1) || (e == 0);
+ e_conv = DecodeError_clone(&e_conv);
+ LDKCResult_PayeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeeDecodeErrorZ), "LDKCResult_PayeeDecodeErrorZ");
+ *ret_conv = CResult_PayeeDecodeErrorZ_err(e_conv);
+ return (uint64_t)ret_conv;
+}
+
+void __attribute__((visibility("default"))) TS_CResult_PayeeDecodeErrorZ_free(uint32_t _res) {
+ if ((_res & 1) != 0) return;
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_PayeeDecodeErrorZ _res_conv = *(LDKCResult_PayeeDecodeErrorZ*)(_res_ptr);
+ FREE((void*)_res);
+ CResult_PayeeDecodeErrorZ_free(_res_conv);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_CResult_PayeeDecodeErrorZ_clone(uint32_t orig) {
+ LDKCResult_PayeeDecodeErrorZ* orig_conv = (LDKCResult_PayeeDecodeErrorZ*)(orig & ~1);
+ LDKCResult_PayeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeeDecodeErrorZ), "LDKCResult_PayeeDecodeErrorZ");
+ *ret_conv = CResult_PayeeDecodeErrorZ_clone(orig_conv);
+ return (uint64_t)ret_conv;
+}
+
+void __attribute__((visibility("default"))) TS_CVec_RouteHintHopZ_free(uint32_tArray _res) {
+ LDKCVec_RouteHintHopZ _res_constr;
_res_constr.datalen = *((uint32_t*)_res);
if (_res_constr.datalen > 0)
- _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
+ _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements");
else
_res_constr.data = NULL;
uint32_t* _res_vals = (uint32_t*)(_res + 4);
- for (size_t l = 0; l < _res_constr.datalen; l++) {
- uint32_t _res_conv_11 = _res_vals[l];
- LDKRouteHint _res_conv_11_conv;
- _res_conv_11_conv.inner = (void*)(_res_conv_11 & (~1));
- _res_conv_11_conv.is_owned = (_res_conv_11 & 1) || (_res_conv_11 == 0);
- _res_constr.data[l] = _res_conv_11_conv;
+ for (size_t o = 0; o < _res_constr.datalen; o++) {
+ uint32_t _res_conv_14 = _res_vals[o];
+ LDKRouteHintHop _res_conv_14_conv;
+ _res_conv_14_conv.inner = (void*)(_res_conv_14 & (~1));
+ _res_conv_14_conv.is_owned = (_res_conv_14 & 1) || (_res_conv_14 == 0);
+ _res_constr.data[o] = _res_conv_14_conv;
}
- CVec_RouteHintZ_free(_res_constr);
+ CVec_RouteHintHopZ_free(_res_constr);
}
-uint32_t __attribute__((visibility("default"))) TS_CResult_RouteLightningErrorZ_ok(uint32_t o) {
- LDKRoute o_conv;
+uint32_t __attribute__((visibility("default"))) TS_CResult_RouteHintDecodeErrorZ_ok(uint32_t o) {
+ LDKRouteHint o_conv;
o_conv.inner = (void*)(o & (~1));
o_conv.is_owned = (o & 1) || (o == 0);
- o_conv = Route_clone(&o_conv);
- LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
- *ret_conv = CResult_RouteLightningErrorZ_ok(o_conv);
+ o_conv = RouteHint_clone(&o_conv);
+ LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
+ *ret_conv = CResult_RouteHintDecodeErrorZ_ok(o_conv);
return (uint64_t)ret_conv;
}
-uint32_t __attribute__((visibility("default"))) TS_CResult_RouteLightningErrorZ_err(uint32_t e) {
- LDKLightningError e_conv;
+uint32_t __attribute__((visibility("default"))) TS_CResult_RouteHintDecodeErrorZ_err(uint32_t e) {
+ LDKDecodeError e_conv;
e_conv.inner = (void*)(e & (~1));
e_conv.is_owned = (e & 1) || (e == 0);
- e_conv = LightningError_clone(&e_conv);
- LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
- *ret_conv = CResult_RouteLightningErrorZ_err(e_conv);
+ e_conv = DecodeError_clone(&e_conv);
+ LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
+ *ret_conv = CResult_RouteHintDecodeErrorZ_err(e_conv);
return (uint64_t)ret_conv;
}
-void __attribute__((visibility("default"))) TS_CResult_RouteLightningErrorZ_free(uint32_t _res) {
+void __attribute__((visibility("default"))) TS_CResult_RouteHintDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
CHECK_ACCESS(_res_ptr);
- LDKCResult_RouteLightningErrorZ _res_conv = *(LDKCResult_RouteLightningErrorZ*)(_res_ptr);
+ LDKCResult_RouteHintDecodeErrorZ _res_conv = *(LDKCResult_RouteHintDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
- CResult_RouteLightningErrorZ_free(_res_conv);
+ CResult_RouteHintDecodeErrorZ_free(_res_conv);
}
-uint32_t __attribute__((visibility("default"))) TS_CResult_RouteLightningErrorZ_clone(uint32_t orig) {
- LDKCResult_RouteLightningErrorZ* orig_conv = (LDKCResult_RouteLightningErrorZ*)(orig & ~1);
- LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
- *ret_conv = CResult_RouteLightningErrorZ_clone(orig_conv);
+uint32_t __attribute__((visibility("default"))) TS_CResult_RouteHintDecodeErrorZ_clone(uint32_t orig) {
+ LDKCResult_RouteHintDecodeErrorZ* orig_conv = (LDKCResult_RouteHintDecodeErrorZ*)(orig & ~1);
+ LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
+ *ret_conv = CResult_RouteHintDecodeErrorZ_clone(orig_conv);
return (uint64_t)ret_conv;
}
-uint32_t __attribute__((visibility("default"))) TS_CResult_TxOutAccessErrorZ_ok(uint32_t o) {
- void* o_ptr = (void*)(((uint64_t)o) & ~1);
- CHECK_ACCESS(o_ptr);
- LDKTxOut o_conv = *(LDKTxOut*)(o_ptr);
- o_conv = TxOut_clone((LDKTxOut*)(((uint64_t)o) & ~1));
- LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
- *ret_conv = CResult_TxOutAccessErrorZ_ok(o_conv);
- return (uint64_t)ret_conv;
-}
+uint32_t __attribute__((visibility("default"))) TS_CResult_RouteHintHopDecodeErrorZ_ok(uint32_t o) {
+ LDKRouteHintHop o_conv;
+ o_conv.inner = (void*)(o & (~1));
+ o_conv.is_owned = (o & 1) || (o == 0);
+ o_conv = RouteHintHop_clone(&o_conv);
+ LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
+ *ret_conv = CResult_RouteHintHopDecodeErrorZ_ok(o_conv);
+ return (uint64_t)ret_conv;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_CResult_RouteHintHopDecodeErrorZ_err(uint32_t e) {
+ LDKDecodeError e_conv;
+ e_conv.inner = (void*)(e & (~1));
+ e_conv.is_owned = (e & 1) || (e == 0);
+ e_conv = DecodeError_clone(&e_conv);
+ LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
+ *ret_conv = CResult_RouteHintHopDecodeErrorZ_err(e_conv);
+ return (uint64_t)ret_conv;
+}
+
+void __attribute__((visibility("default"))) TS_CResult_RouteHintHopDecodeErrorZ_free(uint32_t _res) {
+ if ((_res & 1) != 0) return;
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_RouteHintHopDecodeErrorZ _res_conv = *(LDKCResult_RouteHintHopDecodeErrorZ*)(_res_ptr);
+ FREE((void*)_res);
+ CResult_RouteHintHopDecodeErrorZ_free(_res_conv);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_CResult_RouteHintHopDecodeErrorZ_clone(uint32_t orig) {
+ LDKCResult_RouteHintHopDecodeErrorZ* orig_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)(orig & ~1);
+ LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
+ *ret_conv = CResult_RouteHintHopDecodeErrorZ_clone(orig_conv);
+ return (uint64_t)ret_conv;
+}
+
+void __attribute__((visibility("default"))) TS_CVec_ChannelDetailsZ_free(uint32_tArray _res) {
+ LDKCVec_ChannelDetailsZ _res_constr;
+ _res_constr.datalen = *((uint32_t*)_res);
+ if (_res_constr.datalen > 0)
+ _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
+ else
+ _res_constr.data = NULL;
+ uint32_t* _res_vals = (uint32_t*)(_res + 4);
+ for (size_t q = 0; q < _res_constr.datalen; q++) {
+ uint32_t _res_conv_16 = _res_vals[q];
+ LDKChannelDetails _res_conv_16_conv;
+ _res_conv_16_conv.inner = (void*)(_res_conv_16 & (~1));
+ _res_conv_16_conv.is_owned = (_res_conv_16 & 1) || (_res_conv_16 == 0);
+ _res_constr.data[q] = _res_conv_16_conv;
+ }
+ CVec_ChannelDetailsZ_free(_res_constr);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_CResult_RouteLightningErrorZ_ok(uint32_t o) {
+ LDKRoute o_conv;
+ o_conv.inner = (void*)(o & (~1));
+ o_conv.is_owned = (o & 1) || (o == 0);
+ o_conv = Route_clone(&o_conv);
+ LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
+ *ret_conv = CResult_RouteLightningErrorZ_ok(o_conv);
+ return (uint64_t)ret_conv;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_CResult_RouteLightningErrorZ_err(uint32_t e) {
+ LDKLightningError e_conv;
+ e_conv.inner = (void*)(e & (~1));
+ e_conv.is_owned = (e & 1) || (e == 0);
+ e_conv = LightningError_clone(&e_conv);
+ LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
+ *ret_conv = CResult_RouteLightningErrorZ_err(e_conv);
+ return (uint64_t)ret_conv;
+}
+
+void __attribute__((visibility("default"))) TS_CResult_RouteLightningErrorZ_free(uint32_t _res) {
+ if ((_res & 1) != 0) return;
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_RouteLightningErrorZ _res_conv = *(LDKCResult_RouteLightningErrorZ*)(_res_ptr);
+ FREE((void*)_res);
+ CResult_RouteLightningErrorZ_free(_res_conv);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_CResult_RouteLightningErrorZ_clone(uint32_t orig) {
+ LDKCResult_RouteLightningErrorZ* orig_conv = (LDKCResult_RouteLightningErrorZ*)(orig & ~1);
+ LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
+ *ret_conv = CResult_RouteLightningErrorZ_clone(orig_conv);
+ return (uint64_t)ret_conv;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_CResult_TxOutAccessErrorZ_ok(uint32_t o) {
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKTxOut o_conv = *(LDKTxOut*)(o_ptr);
+ o_conv = TxOut_clone((LDKTxOut*)(((uint64_t)o) & ~1));
+ LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
+ *ret_conv = CResult_TxOutAccessErrorZ_ok(o_conv);
+ return (uint64_t)ret_conv;
+}
uint32_t __attribute__((visibility("default"))) TS_CResult_TxOutAccessErrorZ_err(uint32_t e) {
LDKAccessError e_conv = LDKAccessError_from_js(e);
CResult_InvoiceFeaturesDecodeErrorZ_free(_res_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);
+ // 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_ScoringParametersDecodeErrorZ_err(uint32_t e) {
+ LDKDecodeError e_conv;
+ e_conv.inner = (void*)(e & (~1));
+ e_conv.is_owned = (e & 1) || (e == 0);
+ e_conv = DecodeError_clone(&e_conv);
+ LDKCResult_ScoringParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScoringParametersDecodeErrorZ), "LDKCResult_ScoringParametersDecodeErrorZ");
+ *ret_conv = CResult_ScoringParametersDecodeErrorZ_err(e_conv);
+ return (uint64_t)ret_conv;
+}
+
+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_ScoringParametersDecodeErrorZ _res_conv = *(LDKCResult_ScoringParametersDecodeErrorZ*)(_res_ptr);
+ FREE((void*)_res);
+ CResult_ScoringParametersDecodeErrorZ_free(_res_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);
+ // 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_ScorerDecodeErrorZ_err(uint32_t e) {
+ LDKDecodeError e_conv;
+ e_conv.inner = (void*)(e & (~1));
+ e_conv.is_owned = (e & 1) || (e == 0);
+ e_conv = DecodeError_clone(&e_conv);
+ LDKCResult_ScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScorerDecodeErrorZ), "LDKCResult_ScorerDecodeErrorZ");
+ *ret_conv = CResult_ScorerDecodeErrorZ_err(e_conv);
+ return (uint64_t)ret_conv;
+}
+
+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_ScorerDecodeErrorZ _res_conv = *(LDKCResult_ScorerDecodeErrorZ*)(_res_ptr);
+ FREE((void*)_res);
+ CResult_ScorerDecodeErrorZ_free(_res_conv);
+}
+
uint32_t __attribute__((visibility("default"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(uint32_t o) {
LDKDelayedPaymentOutputDescriptor o_conv;
o_conv.inner = (void*)(o & (~1));
return (uint64_t)ret_conv;
}
-uint32_t __attribute__((visibility("default"))) TS_CResult_PaymentIdDecodeErrorZ_ok(uint32_t o) {
- LDKPaymentId o_conv;
- o_conv.inner = (void*)(o & (~1));
- o_conv.is_owned = (o & 1) || (o == 0);
- o_conv = PaymentId_clone(&o_conv);
- LDKCResult_PaymentIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdDecodeErrorZ), "LDKCResult_PaymentIdDecodeErrorZ");
- *ret_conv = CResult_PaymentIdDecodeErrorZ_ok(o_conv);
- return (uint64_t)ret_conv;
-}
-
-uint32_t __attribute__((visibility("default"))) TS_CResult_PaymentIdDecodeErrorZ_err(uint32_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = (void*)(e & (~1));
- e_conv.is_owned = (e & 1) || (e == 0);
- e_conv = DecodeError_clone(&e_conv);
- LDKCResult_PaymentIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdDecodeErrorZ), "LDKCResult_PaymentIdDecodeErrorZ");
- *ret_conv = CResult_PaymentIdDecodeErrorZ_err(e_conv);
- return (uint64_t)ret_conv;
-}
-
-void __attribute__((visibility("default"))) TS_CResult_PaymentIdDecodeErrorZ_free(uint32_t _res) {
- if ((_res & 1) != 0) return;
- void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
- CHECK_ACCESS(_res_ptr);
- LDKCResult_PaymentIdDecodeErrorZ _res_conv = *(LDKCResult_PaymentIdDecodeErrorZ*)(_res_ptr);
- FREE((void*)_res);
- CResult_PaymentIdDecodeErrorZ_free(_res_conv);
-}
-
-uint32_t __attribute__((visibility("default"))) TS_CResult_PaymentIdDecodeErrorZ_clone(uint32_t orig) {
- LDKCResult_PaymentIdDecodeErrorZ* orig_conv = (LDKCResult_PaymentIdDecodeErrorZ*)(orig & ~1);
- LDKCResult_PaymentIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdDecodeErrorZ), "LDKCResult_PaymentIdDecodeErrorZ");
- *ret_conv = CResult_PaymentIdDecodeErrorZ_clone(orig_conv);
- return (uint64_t)ret_conv;
-}
-
uint32_t __attribute__((visibility("default"))) TS_COption_u16Z_some(int16_t o) {
LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z");
*ret_copy = COption_u16Z_some(o);
return (uint64_t)ret_conv;
}
-uint32_t __attribute__((visibility("default"))) TS_CResult_PaymentIdPaymentSendFailureZ_ok(uint32_t o) {
- LDKPaymentId o_conv;
- o_conv.inner = (void*)(o & (~1));
- o_conv.is_owned = (o & 1) || (o == 0);
- o_conv = PaymentId_clone(&o_conv);
+uint32_t __attribute__((visibility("default"))) TS_CResult_PaymentIdPaymentSendFailureZ_ok(int8_tArray o) {
+ LDKThirtyTwoBytes o_ref;
+ CHECK(*((uint32_t*)o) == 32);
+ memcpy(o_ref.data, (uint8_t*)(o + 4), 32);
LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
- *ret_conv = CResult_PaymentIdPaymentSendFailureZ_ok(o_conv);
+ *ret_conv = CResult_PaymentIdPaymentSendFailureZ_ok(o_ref);
return (uint64_t)ret_conv;
}
return ((uint64_t)ret_conv);
}
-uint32_t __attribute__((visibility("default"))) TS_C2Tuple_PaymentHashPaymentIdZ_new(int8_tArray a, uint32_t b) {
+uint32_t __attribute__((visibility("default"))) TS_C2Tuple_PaymentHashPaymentIdZ_new(int8_tArray a, int8_tArray b) {
LDKThirtyTwoBytes a_ref;
CHECK(*((uint32_t*)a) == 32);
memcpy(a_ref.data, (uint8_t*)(a + 4), 32);
- LDKPaymentId b_conv;
- b_conv.inner = (void*)(b & (~1));
- b_conv.is_owned = (b & 1) || (b == 0);
- b_conv = PaymentId_clone(&b_conv);
+ LDKThirtyTwoBytes b_ref;
+ CHECK(*((uint32_t*)b) == 32);
+ memcpy(b_ref.data, (uint8_t*)(b + 4), 32);
LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ");
- *ret_conv = C2Tuple_PaymentHashPaymentIdZ_new(a_ref, b_conv);
+ *ret_conv = C2Tuple_PaymentHashPaymentIdZ_new(a_ref, b_ref);
return ((uint64_t)ret_conv);
}
return (uint64_t)ret_conv;
}
+uint32_t __attribute__((visibility("default"))) TS_CResult_PaymentIdPaymentErrorZ_ok(int8_tArray o) {
+ LDKThirtyTwoBytes o_ref;
+ CHECK(*((uint32_t*)o) == 32);
+ memcpy(o_ref.data, (uint8_t*)(o + 4), 32);
+ LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
+ *ret_conv = CResult_PaymentIdPaymentErrorZ_ok(o_ref);
+ return (uint64_t)ret_conv;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_CResult_PaymentIdPaymentErrorZ_err(uint32_t e) {
+ void* e_ptr = (void*)(((uint64_t)e) & ~1);
+ CHECK_ACCESS(e_ptr);
+ LDKPaymentError e_conv = *(LDKPaymentError*)(e_ptr);
+ e_conv = PaymentError_clone((LDKPaymentError*)(((uint64_t)e) & ~1));
+ LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
+ *ret_conv = CResult_PaymentIdPaymentErrorZ_err(e_conv);
+ return (uint64_t)ret_conv;
+}
+
+void __attribute__((visibility("default"))) TS_CResult_PaymentIdPaymentErrorZ_free(uint32_t _res) {
+ if ((_res & 1) != 0) return;
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_PaymentIdPaymentErrorZ _res_conv = *(LDKCResult_PaymentIdPaymentErrorZ*)(_res_ptr);
+ FREE((void*)_res);
+ CResult_PaymentIdPaymentErrorZ_free(_res_conv);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_CResult_PaymentIdPaymentErrorZ_clone(uint32_t orig) {
+ LDKCResult_PaymentIdPaymentErrorZ* orig_conv = (LDKCResult_PaymentIdPaymentErrorZ*)(orig & ~1);
+ LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
+ *ret_conv = CResult_PaymentIdPaymentErrorZ_clone(orig_conv);
+ return (uint64_t)ret_conv;
+}
+
uint32_t __attribute__((visibility("default"))) TS_CResult_SiPrefixNoneZ_ok(uint32_t o) {
LDKSiPrefix o_conv = LDKSiPrefix_from_js(o);
LDKCResult_SiPrefixNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixNoneZ), "LDKCResult_SiPrefixNoneZ");
return ret_ref;
}
-uint32_t __attribute__((visibility("default"))) TS_CResult_NetAddressu8Z_ok(uint32_t o) {
- void* o_ptr = (void*)(((uint64_t)o) & ~1);
- CHECK_ACCESS(o_ptr);
- LDKNetAddress o_conv = *(LDKNetAddress*)(o_ptr);
- o_conv = NetAddress_clone((LDKNetAddress*)(((uint64_t)o) & ~1));
- LDKCResult_NetAddressu8Z* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressu8Z), "LDKCResult_NetAddressu8Z");
- *ret_conv = CResult_NetAddressu8Z_ok(o_conv);
- return (uint64_t)ret_conv;
-}
-
-uint32_t __attribute__((visibility("default"))) TS_CResult_NetAddressu8Z_err(int8_t e) {
- LDKCResult_NetAddressu8Z* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressu8Z), "LDKCResult_NetAddressu8Z");
- *ret_conv = CResult_NetAddressu8Z_err(e);
- return (uint64_t)ret_conv;
-}
-
-void __attribute__((visibility("default"))) TS_CResult_NetAddressu8Z_free(uint32_t _res) {
- if ((_res & 1) != 0) return;
- void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
- CHECK_ACCESS(_res_ptr);
- LDKCResult_NetAddressu8Z _res_conv = *(LDKCResult_NetAddressu8Z*)(_res_ptr);
- FREE((void*)_res);
- CResult_NetAddressu8Z_free(_res_conv);
-}
-
-uint32_t __attribute__((visibility("default"))) TS_CResult_NetAddressu8Z_clone(uint32_t orig) {
- LDKCResult_NetAddressu8Z* orig_conv = (LDKCResult_NetAddressu8Z*)(orig & ~1);
- LDKCResult_NetAddressu8Z* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressu8Z), "LDKCResult_NetAddressu8Z");
- *ret_conv = CResult_NetAddressu8Z_clone(orig_conv);
- return (uint64_t)ret_conv;
-}
-
-uint32_t __attribute__((visibility("default"))) TS_CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(uint32_t o) {
- void* o_ptr = (void*)(((uint64_t)o) & ~1);
- CHECK_ACCESS(o_ptr);
- LDKCResult_NetAddressu8Z o_conv = *(LDKCResult_NetAddressu8Z*)(o_ptr);
- o_conv = CResult_NetAddressu8Z_clone((LDKCResult_NetAddressu8Z*)(((uint64_t)o) & ~1));
- LDKCResult_CResult_NetAddressu8ZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CResult_NetAddressu8ZDecodeErrorZ), "LDKCResult_CResult_NetAddressu8ZDecodeErrorZ");
- *ret_conv = CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(o_conv);
- return (uint64_t)ret_conv;
-}
-
-uint32_t __attribute__((visibility("default"))) TS_CResult_CResult_NetAddressu8ZDecodeErrorZ_err(uint32_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = (void*)(e & (~1));
- e_conv.is_owned = (e & 1) || (e == 0);
- e_conv = DecodeError_clone(&e_conv);
- LDKCResult_CResult_NetAddressu8ZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CResult_NetAddressu8ZDecodeErrorZ), "LDKCResult_CResult_NetAddressu8ZDecodeErrorZ");
- *ret_conv = CResult_CResult_NetAddressu8ZDecodeErrorZ_err(e_conv);
- return (uint64_t)ret_conv;
-}
-
-void __attribute__((visibility("default"))) TS_CResult_CResult_NetAddressu8ZDecodeErrorZ_free(uint32_t _res) {
- if ((_res & 1) != 0) return;
- void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
- CHECK_ACCESS(_res_ptr);
- LDKCResult_CResult_NetAddressu8ZDecodeErrorZ _res_conv = *(LDKCResult_CResult_NetAddressu8ZDecodeErrorZ*)(_res_ptr);
- FREE((void*)_res);
- CResult_CResult_NetAddressu8ZDecodeErrorZ_free(_res_conv);
-}
-
-uint32_t __attribute__((visibility("default"))) TS_CResult_CResult_NetAddressu8ZDecodeErrorZ_clone(uint32_t orig) {
- LDKCResult_CResult_NetAddressu8ZDecodeErrorZ* orig_conv = (LDKCResult_CResult_NetAddressu8ZDecodeErrorZ*)(orig & ~1);
- LDKCResult_CResult_NetAddressu8ZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CResult_NetAddressu8ZDecodeErrorZ), "LDKCResult_CResult_NetAddressu8ZDecodeErrorZ");
- *ret_conv = CResult_CResult_NetAddressu8ZDecodeErrorZ_clone(orig_conv);
- return (uint64_t)ret_conv;
-}
-
uint32_t __attribute__((visibility("default"))) TS_CResult_NetAddressDecodeErrorZ_ok(uint32_t o) {
void* o_ptr = (void*)(((uint64_t)o) & ~1);
CHECK_ACCESS(o_ptr);
return ret_ref;
}
-uint32_t __attribute__((visibility("default"))) TS_Event_payment_sent(int8_tArray payment_preimage, int8_tArray payment_hash) {
+uint32_t __attribute__((visibility("default"))) TS_Event_payment_sent(int8_tArray payment_id, int8_tArray payment_preimage, int8_tArray payment_hash, uint32_t fee_paid_msat) {
+ LDKThirtyTwoBytes payment_id_ref;
+ CHECK(*((uint32_t*)payment_id) == 32);
+ memcpy(payment_id_ref.data, (uint8_t*)(payment_id + 4), 32);
LDKThirtyTwoBytes payment_preimage_ref;
CHECK(*((uint32_t*)payment_preimage) == 32);
memcpy(payment_preimage_ref.data, (uint8_t*)(payment_preimage + 4), 32);
LDKThirtyTwoBytes payment_hash_ref;
CHECK(*((uint32_t*)payment_hash) == 32);
memcpy(payment_hash_ref.data, (uint8_t*)(payment_hash + 4), 32);
+ void* fee_paid_msat_ptr = (void*)(((uint64_t)fee_paid_msat) & ~1);
+ CHECK_ACCESS(fee_paid_msat_ptr);
+ LDKCOption_u64Z fee_paid_msat_conv = *(LDKCOption_u64Z*)(fee_paid_msat_ptr);
+ fee_paid_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)fee_paid_msat) & ~1));
LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
- *ret_copy = Event_payment_sent(payment_preimage_ref, payment_hash_ref);
+ *ret_copy = Event_payment_sent(payment_id_ref, payment_preimage_ref, payment_hash_ref, fee_paid_msat_conv);
uint64_t ret_ref = (uint64_t)ret_copy;
return ret_ref;
}
-uint32_t __attribute__((visibility("default"))) TS_Event_payment_path_failed(int8_tArray payment_hash, jboolean rejected_by_dest, uint32_t network_update, jboolean all_paths_failed, uint32_tArray path, uint32_t short_channel_id) {
+uint32_t __attribute__((visibility("default"))) TS_Event_payment_path_failed(int8_tArray payment_id, int8_tArray payment_hash, jboolean rejected_by_dest, uint32_t network_update, jboolean all_paths_failed, uint32_tArray path, uint32_t short_channel_id, uint32_t retry) {
+ 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);
CHECK_ACCESS(short_channel_id_ptr);
LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(short_channel_id_ptr);
short_channel_id_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)short_channel_id) & ~1));
+ LDKRouteParameters retry_conv;
+ retry_conv.inner = (void*)(retry & (~1));
+ retry_conv.is_owned = (retry & 1) || (retry == 0);
+ retry_conv = RouteParameters_clone(&retry_conv);
LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
- *ret_copy = Event_payment_path_failed(payment_hash_ref, rejected_by_dest, network_update_conv, all_paths_failed, path_constr, short_channel_id_conv);
+ *ret_copy = Event_payment_path_failed(payment_id_ref, payment_hash_ref, rejected_by_dest, network_update_conv, all_paths_failed, path_constr, short_channel_id_conv, retry_conv);
uint64_t ret_ref = (uint64_t)ret_copy;
return ret_ref;
}
uint32_t __attribute__((visibility("default"))) TS_ChannelHandshakeConfig_new(int32_t minimum_depth_arg, int16_t our_to_self_delay_arg, int64_t our_htlc_minimum_msat_arg) {
LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
uint32_t __attribute__((visibility("default"))) TS_ChannelHandshakeConfig_default() {
LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_default();
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
uint32_t __attribute__((visibility("default"))) TS_ChannelHandshakeLimits_new(int64_t min_funding_satoshis_arg, int64_t max_htlc_minimum_msat_arg, int64_t min_max_htlc_value_in_flight_msat_arg, int64_t max_channel_reserve_satoshis_arg, int16_t min_max_accepted_htlcs_arg, int32_t max_minimum_depth_arg, jboolean force_announced_channel_preference_arg, int16_t their_to_self_delay_arg) {
LDKChannelHandshakeLimits ret_var = 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);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
uint32_t __attribute__((visibility("default"))) TS_ChannelHandshakeLimits_default() {
LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_default();
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
uint32_t __attribute__((visibility("default"))) TS_ChannelConfig_new(int32_t forwarding_fee_proportional_millionths_arg, int32_t forwarding_fee_base_msat_arg, int16_t cltv_expiry_delta_arg, jboolean announced_channel_arg, jboolean commit_upfront_shutdown_pubkey_arg, int64_t max_dust_htlc_exposure_msat_arg, int64_t force_close_avoidance_max_fee_satoshis_arg) {
LDKChannelConfig ret_var = 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);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelConfig ret_var = ChannelConfig_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
uint32_t __attribute__((visibility("default"))) TS_ChannelConfig_default() {
LDKChannelConfig ret_var = ChannelConfig_default();
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKChannelHandshakeConfig ret_var = UserConfig_get_own_channel_config(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKChannelHandshakeLimits ret_var = UserConfig_get_peer_channel_config_limits(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKChannelConfig ret_var = UserConfig_get_channel_options(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
channel_options_arg_conv.is_owned = (channel_options_arg & 1) || (channel_options_arg == 0);
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);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKUserConfig ret_var = UserConfig_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
uint32_t __attribute__((visibility("default"))) TS_UserConfig_default() {
LDKUserConfig ret_var = UserConfig_default();
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKBestBlock ret_var = BestBlock_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
uint32_t __attribute__((visibility("default"))) TS_BestBlock_from_genesis(uint32_t network) {
LDKNetwork network_conv = LDKNetwork_from_js(network);
LDKBestBlock ret_var = BestBlock_from_genesis(network_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK(*((uint32_t*)block_hash) == 32);
memcpy(block_hash_ref.data, (uint8_t*)(block_hash + 4), 32);
LDKBestBlock ret_var = BestBlock_new(block_hash_ref, height);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKOutPoint ret_var = WatchedOutput_get_outpoint(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
script_pubkey_arg_ref.data = MALLOC(script_pubkey_arg_ref.datalen, "LDKCVec_u8Z Bytes");
memcpy(script_pubkey_arg_ref.data, (uint8_t*)(script_pubkey_arg + 4), script_pubkey_arg_ref.datalen);
LDKWatchedOutput ret_var = WatchedOutput_new(block_hash_arg_ref, outpoint_arg_conv, script_pubkey_arg_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKWatchedOutput ret_var = WatchedOutput_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
FeeEstimator_free(this_ptr_conv);
}
+void __attribute__((visibility("default"))) TS_MonitorUpdateId_free(uint32_t this_obj) {
+ LDKMonitorUpdateId this_obj_conv;
+ this_obj_conv.inner = (void*)(this_obj & (~1));
+ this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+ MonitorUpdateId_free(this_obj_conv);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_MonitorUpdateId_clone(uint32_t orig) {
+ LDKMonitorUpdateId orig_conv;
+ orig_conv.inner = (void*)(orig & (~1));
+ orig_conv.is_owned = false;
+ LDKMonitorUpdateId ret_var = MonitorUpdateId_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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
+int64_t __attribute__((visibility("default"))) TS_MonitorUpdateId_hash(uint32_t o) {
+ LDKMonitorUpdateId o_conv;
+ o_conv.inner = (void*)(o & (~1));
+ o_conv.is_owned = false;
+ int64_t ret_val = MonitorUpdateId_hash(&o_conv);
+ return ret_val;
+}
+
+jboolean __attribute__((visibility("default"))) TS_MonitorUpdateId_eq(uint32_t a, uint32_t b) {
+ LDKMonitorUpdateId a_conv;
+ a_conv.inner = (void*)(a & (~1));
+ a_conv.is_owned = false;
+ LDKMonitorUpdateId b_conv;
+ b_conv.inner = (void*)(b & (~1));
+ b_conv.is_owned = false;
+ jboolean ret_val = MonitorUpdateId_eq(&a_conv, &b_conv);
+ return ret_val;
+}
+
void __attribute__((visibility("default"))) TS_Persist_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
CHECK_ACCESS(persister_ptr);
LDKPersist persister_conv = *(LDKPersist*)(persister_ptr);
LDKChainMonitor ret_var = ChainMonitor_new(chain_source_conv, broadcaster_conv, logger_conv, feeest_conv, persister_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
ignored_channels_constr.data[q] = ignored_channels_conv_16_conv;
}
LDKCVec_BalanceZ ret_var = ChainMonitor_get_claimable_balances(&this_arg_conv, ignored_channels_constr);
- uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t j = 0; j < ret_var.datalen; j++) {
LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
uint64_t ret_conv_9_ref = (uint64_t)ret_conv_9_copy;
ret_arr_ptr[j] = ret_conv_9_ref;
}
+
FREE(ret_var.data);
return ret_arr;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCVec_OutPointZ ret_var = ChainMonitor_list_monitors(&this_arg_conv);
- uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t k = 0; k < ret_var.datalen; k++) {
LDKOutPoint ret_conv_10_var = ret_var.data[k];
+ uint64_t ret_conv_10_ref = 0;
CHECK((((uint64_t)ret_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t ret_conv_10_ref = (uint64_t)ret_conv_10_var.inner;
+ ret_conv_10_ref = (uint64_t)ret_conv_10_var.inner;
if (ret_conv_10_var.is_owned) {
ret_conv_10_ref |= 1;
}
ret_arr_ptr[k] = ret_conv_10_ref;
}
+
FREE(ret_var.data);
return ret_arr;
}
+uint32_t __attribute__((visibility("default"))) TS_ChainMonitor_channel_monitor_updated(uint32_t this_arg, uint32_t funding_txo, uint32_t completed_update_id) {
+ LDKChainMonitor this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ LDKOutPoint funding_txo_conv;
+ funding_txo_conv.inner = (void*)(funding_txo & (~1));
+ funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0);
+ funding_txo_conv = OutPoint_clone(&funding_txo_conv);
+ LDKMonitorUpdateId completed_update_id_conv;
+ completed_update_id_conv.inner = (void*)(completed_update_id & (~1));
+ completed_update_id_conv.is_owned = (completed_update_id & 1) || (completed_update_id == 0);
+ completed_update_id_conv = MonitorUpdateId_clone(&completed_update_id_conv);
+ LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
+ *ret_conv = ChainMonitor_channel_monitor_updated(&this_arg_conv, funding_txo_conv, completed_update_id_conv);
+ return (uint64_t)ret_conv;
+}
+
uint32_t __attribute__((visibility("default"))) TS_ChainMonitor_as_Listen(uint32_t this_arg) {
LDKChainMonitor this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKListen* ret_ret =MALLOC(sizeof(LDKListen), "LDKListen");
+ LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen");
*ret_ret = ChainMonitor_as_Listen(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKChainMonitor this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKConfirm* ret_ret =MALLOC(sizeof(LDKConfirm), "LDKConfirm");
+ LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm");
*ret_ret = ChainMonitor_as_Confirm(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKChainMonitor this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKWatch* ret_ret =MALLOC(sizeof(LDKWatch), "LDKWatch");
+ LDKWatch* ret_ret = MALLOC(sizeof(LDKWatch), "LDKWatch");
*ret_ret = ChainMonitor_as_Watch(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKChainMonitor this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKEventsProvider* ret_ret =MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
+ LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
*ret_ret = ChainMonitor_as_EventsProvider(&this_arg_conv);
return (uint64_t)ret_ret;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
MonitorUpdateError_free(this_obj_conv);
}
-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;
- LDKMonitorUpdateError ret_var = MonitorUpdateError_clone(&orig_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;
+ 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;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
+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;
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
return ret_ref;
}
+uint32_t __attribute__((visibility("default"))) TS_MonitorEvent_update_completed(uint32_t funding_txo, int64_t monitor_update_id) {
+ LDKOutPoint funding_txo_conv;
+ funding_txo_conv.inner = (void*)(funding_txo & (~1));
+ funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0);
+ funding_txo_conv = OutPoint_clone(&funding_txo_conv);
+ LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
+ *ret_copy = MonitorEvent_update_completed(funding_txo_conv, monitor_update_id);
+ uint64_t ret_ref = (uint64_t)ret_copy;
+ return ret_ref;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_MonitorEvent_update_failed(uint32_t a) {
+ LDKOutPoint a_conv;
+ a_conv.inner = (void*)(a & (~1));
+ a_conv.is_owned = (a & 1) || (a == 0);
+ a_conv = OutPoint_clone(&a_conv);
+ LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
+ *ret_copy = MonitorEvent_update_failed(a_conv);
+ uint64_t ret_ref = (uint64_t)ret_copy;
+ return ret_ref;
+}
+
+int8_tArray __attribute__((visibility("default"))) TS_MonitorEvent_write(uint32_t obj) {
+ LDKMonitorEvent* obj_conv = (LDKMonitorEvent*)obj;
+ LDKCVec_u8Z ret_var = MonitorEvent_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_HTLCUpdate_free(uint32_t this_obj) {
LDKHTLCUpdate this_obj_conv;
this_obj_conv.inner = (void*)(this_obj & (~1));
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKHTLCUpdate ret_var = HTLCUpdate_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelMonitor ret_var = ChannelMonitor_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ret_var = ChannelMonitor_get_outputs_to_watch(&this_arg_conv);
- uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t o = 0; o < ret_var.datalen; o++) {
LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv_40_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ");
*ret_conv_40_conv = ret_var.data[o];
ret_arr_ptr[o] = ((uint64_t)ret_conv_40_conv);
}
+
FREE(ret_var.data);
return ret_arr;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCVec_MonitorEventZ ret_var = ChannelMonitor_get_and_clear_pending_monitor_events(&this_arg_conv);
- uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t o = 0; o < ret_var.datalen; o++) {
LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
uint64_t ret_conv_14_ref = (uint64_t)ret_conv_14_copy;
ret_arr_ptr[o] = ret_conv_14_ref;
}
+
FREE(ret_var.data);
return ret_arr;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCVec_EventZ ret_var = ChannelMonitor_get_and_clear_pending_events(&this_arg_conv);
- uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t h = 0; h < ret_var.datalen; h++) {
LDKEvent *ret_conv_7_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
uint64_t ret_conv_7_ref = (uint64_t)ret_conv_7_copy;
ret_arr_ptr[h] = ret_conv_7_ref;
}
+
FREE(ret_var.data);
return ret_arr;
}
if (!(logger & 1)) { CHECK_ACCESS(logger_ptr); }
LDKLogger* logger_conv = (LDKLogger*)logger_ptr;
LDKCVec_TransactionZ ret_var = ChannelMonitor_get_latest_holder_commitment_txn(&this_arg_conv, logger_conv);
- ptrArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native ptrArray Bytes");
+ ptrArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native ptrArray Bytes");
int8_tArray *ret_arr_ptr = (int8_tArray*)(ret_arr + 4);
for (size_t m = 0; m < ret_var.datalen; m++) {
LDKTransaction ret_conv_12_var = ret_var.data[m];
Transaction_free(ret_conv_12_var);
ret_arr_ptr[m] = ret_conv_12_arr;
}
+
FREE(ret_var.data);
return ret_arr;
}
CHECK_ACCESS(logger_ptr);
LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_block_connected(&this_arg_conv, header_ref, txdata_constr, height, broadcaster_conv, fee_estimator_conv, logger_conv);
- uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t n = 0; n < ret_var.datalen; n++) {
LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
*ret_conv_39_conv = ret_var.data[n];
ret_arr_ptr[n] = ((uint64_t)ret_conv_39_conv);
}
+
FREE(ret_var.data);
return ret_arr;
}
CHECK_ACCESS(logger_ptr);
LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_transactions_confirmed(&this_arg_conv, header_ref, txdata_constr, height, broadcaster_conv, fee_estimator_conv, logger_conv);
- uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t n = 0; n < ret_var.datalen; n++) {
LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
*ret_conv_39_conv = ret_var.data[n];
ret_arr_ptr[n] = ((uint64_t)ret_conv_39_conv);
}
+
FREE(ret_var.data);
return ret_arr;
}
CHECK_ACCESS(logger_ptr);
LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_best_block_updated(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv);
- uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t n = 0; n < ret_var.datalen; n++) {
LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
*ret_conv_39_conv = ret_var.data[n];
ret_arr_ptr[n] = ((uint64_t)ret_conv_39_conv);
}
+
FREE(ret_var.data);
return ret_arr;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCVec_TxidZ ret_var = ChannelMonitor_get_relevant_txids(&this_arg_conv);
- ptrArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native ptrArray Bytes");
+ ptrArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native ptrArray Bytes");
int8_tArray *ret_arr_ptr = (int8_tArray*)(ret_arr + 4);
for (size_t m = 0; m < ret_var.datalen; m++) {
int8_tArray ret_conv_12_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(ret_conv_12_arr + 4), ret_var.data[m].data, 32);
ret_arr_ptr[m] = ret_conv_12_arr;
}
+
FREE(ret_var.data);
return ret_arr;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKBestBlock ret_var = ChannelMonitor_current_best_block(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCVec_BalanceZ ret_var = ChannelMonitor_get_claimable_balances(&this_arg_conv);
- uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t j = 0; j < ret_var.datalen; j++) {
LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
uint64_t ret_conv_9_ref = (uint64_t)ret_conv_9_copy;
ret_arr_ptr[j] = ret_conv_9_ref;
}
+
FREE(ret_var.data);
return ret_arr;
}
CHECK(*((uint32_t*)txid_arg) == 32);
memcpy(txid_arg_ref.data, (uint8_t*)(txid_arg + 4), 32);
LDKOutPoint ret_var = OutPoint_new(txid_arg_ref, index_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKOutPoint ret_var = OutPoint_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKOutPoint ret_var = DelayedPaymentOutputDescriptor_get_outpoint(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK(*((uint32_t*)channel_keys_id_arg) == 32);
memcpy(channel_keys_id_arg_ref.data, (uint8_t*)(channel_keys_id_arg + 4), 32);
LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_new(outpoint_arg_conv, per_commitment_point_arg_ref, to_self_delay_arg, output_arg_conv, revocation_pubkey_arg_ref, channel_keys_id_arg_ref, channel_value_satoshis_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKOutPoint ret_var = StaticPaymentOutputDescriptor_get_outpoint(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK(*((uint32_t*)channel_keys_id_arg) == 32);
memcpy(channel_keys_id_arg_ref.data, (uint8_t*)(channel_keys_id_arg + 4), 32);
LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_new(outpoint_arg_conv, output_arg_conv, channel_keys_id_arg_ref, channel_value_satoshis_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
void* orig_ptr = (void*)(((uint64_t)orig) & ~1);
if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); }
LDKSign* orig_conv = (LDKSign*)orig_ptr;
- LDKSign* ret_ret =MALLOC(sizeof(LDKSign), "LDKSign");
+ LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
*ret_ret = Sign_clone(orig_conv);
return (uint64_t)ret_ret;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKInMemorySigner ret_var = InMemorySigner_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK(*((uint32_t*)channel_keys_id) == 32);
memcpy(channel_keys_id_ref.data, (uint8_t*)(channel_keys_id + 4), 32);
LDKInMemorySigner ret_var = InMemorySigner_new(funding_key_ref, revocation_base_key_ref, payment_key_ref, delayed_payment_base_key_ref, htlc_base_key_ref, commitment_seed_ref, channel_value_satoshis, channel_keys_id_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKChannelPublicKeys ret_var = InMemorySigner_counterparty_pubkeys(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKOutPoint ret_var = InMemorySigner_funding_outpoint(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKChannelTransactionParameters ret_var = InMemorySigner_get_channel_parameters(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKInMemorySigner this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKBaseSign* ret_ret =MALLOC(sizeof(LDKBaseSign), "LDKBaseSign");
+ LDKBaseSign* ret_ret = MALLOC(sizeof(LDKBaseSign), "LDKBaseSign");
*ret_ret = InMemorySigner_as_BaseSign(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKInMemorySigner this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKSign* ret_ret =MALLOC(sizeof(LDKSign), "LDKSign");
+ LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
*ret_ret = InMemorySigner_as_Sign(&this_arg_conv);
return (uint64_t)ret_ret;
}
memcpy(seed_arr, (uint8_t*)(seed + 4), 32);
unsigned char (*seed_ref)[32] = &seed_arr;
LDKKeysManager ret_var = KeysManager_new(seed_ref, starting_time_secs, starting_time_nanos);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
memcpy(params_arr, (uint8_t*)(params + 4), 32);
unsigned char (*params_ref)[32] = ¶ms_arr;
LDKInMemorySigner ret_var = KeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKKeysManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKKeysInterface* ret_ret =MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface");
+ LDKKeysInterface* ret_ret = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface");
*ret_ret = KeysManager_as_KeysInterface(&this_arg_conv);
return (uint64_t)ret_ret;
}
-void __attribute__((visibility("default"))) TS_PaymentId_free(uint32_t this_obj) {
- LDKPaymentId this_obj_conv;
- this_obj_conv.inner = (void*)(this_obj & (~1));
- this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
- PaymentId_free(this_obj_conv);
-}
-
-int64_t __attribute__((visibility("default"))) TS_PaymentId_hash(uint32_t o) {
- LDKPaymentId o_conv;
- o_conv.inner = (void*)(o & (~1));
- o_conv.is_owned = false;
- int64_t ret_val = PaymentId_hash(&o_conv);
- return ret_val;
-}
-
-uint32_t __attribute__((visibility("default"))) TS_PaymentId_clone(uint32_t orig) {
- LDKPaymentId orig_conv;
- orig_conv.inner = (void*)(orig & (~1));
- orig_conv.is_owned = false;
- LDKPaymentId ret_var = PaymentId_clone(&orig_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
- }
- return ret_ref;
-}
-
-jboolean __attribute__((visibility("default"))) TS_PaymentId_eq(uint32_t a, uint32_t b) {
- LDKPaymentId a_conv;
- a_conv.inner = (void*)(a & (~1));
- a_conv.is_owned = false;
- LDKPaymentId b_conv;
- b_conv.inner = (void*)(b & (~1));
- b_conv.is_owned = false;
- jboolean ret_val = PaymentId_eq(&a_conv, &b_conv);
- return ret_val;
-}
-
-int8_tArray __attribute__((visibility("default"))) TS_PaymentId_write(uint32_t obj) {
- LDKPaymentId obj_conv;
- obj_conv.inner = (void*)(obj & (~1));
- obj_conv.is_owned = false;
- LDKCVec_u8Z ret_var = PaymentId_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_PaymentId_read(int8_tArray ser) {
- LDKu8slice ser_ref;
- ser_ref.datalen = *((uint32_t*)ser);
- ser_ref.data = (int8_t*)(ser + 4);
- LDKCResult_PaymentIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdDecodeErrorZ), "LDKCResult_PaymentIdDecodeErrorZ");
- *ret_conv = PaymentId_read(ser_ref);
- return (uint64_t)ret_conv;
-}
-
void __attribute__((visibility("default"))) TS_ChannelManager_free(uint32_t this_obj) {
LDKChannelManager this_obj_conv;
this_obj_conv.inner = (void*)(this_obj & (~1));
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKBestBlock ret_var = ChainParameters_get_best_block(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
best_block_arg_conv.is_owned = (best_block_arg & 1) || (best_block_arg == 0);
best_block_arg_conv = BestBlock_clone(&best_block_arg_conv);
LDKChainParameters ret_var = ChainParameters_new(network_arg_conv, best_block_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChainParameters ret_var = ChainParameters_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
uint32_t __attribute__((visibility("default"))) TS_CounterpartyForwardingInfo_new(int32_t fee_base_msat_arg, int32_t fee_proportional_millionths_arg, int16_t cltv_expiry_delta_arg) {
LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_new(fee_base_msat_arg, fee_proportional_millionths_arg, cltv_expiry_delta_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKInitFeatures ret_var = ChannelCounterparty_get_features(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKCounterpartyForwardingInfo ret_var = ChannelCounterparty_get_forwarding_info(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
forwarding_info_arg_conv.is_owned = (forwarding_info_arg & 1) || (forwarding_info_arg == 0);
forwarding_info_arg_conv = CounterpartyForwardingInfo_clone(&forwarding_info_arg_conv);
LDKChannelCounterparty ret_var = ChannelCounterparty_new(node_id_arg_ref, features_arg_conv, unspendable_punishment_reserve_arg, forwarding_info_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelCounterparty ret_var = ChannelCounterparty_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKChannelCounterparty ret_var = ChannelDetails_get_counterparty(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKOutPoint ret_var = ChannelDetails_get_funding_txo(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
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);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelDetails ret_var = ChannelDetails_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
return ret_ref;
}
-uint32_t __attribute__((visibility("default"))) TS_PaymentSendFailure_partial_failure(uint32_tArray a) {
- LDKCVec_CResult_NoneAPIErrorZZ a_constr;
- a_constr.datalen = *((uint32_t*)a);
- if (a_constr.datalen > 0)
- a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
+uint32_t __attribute__((visibility("default"))) TS_PaymentSendFailure_partial_failure(uint32_tArray results, uint32_t failed_paths_retry, int8_tArray payment_id) {
+ LDKCVec_CResult_NoneAPIErrorZZ results_constr;
+ results_constr.datalen = *((uint32_t*)results);
+ if (results_constr.datalen > 0)
+ results_constr.data = MALLOC(results_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
else
- a_constr.data = NULL;
- uint32_t* a_vals = (uint32_t*)(a + 4);
- for (size_t w = 0; w < a_constr.datalen; w++) {
- uint32_t a_conv_22 = a_vals[w];
- void* a_conv_22_ptr = (void*)(((uint64_t)a_conv_22) & ~1);
- CHECK_ACCESS(a_conv_22_ptr);
- LDKCResult_NoneAPIErrorZ a_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(a_conv_22_ptr);
- a_conv_22_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)(((uint64_t)a_conv_22) & ~1));
- a_constr.data[w] = a_conv_22_conv;
- }
+ results_constr.data = NULL;
+ uint32_t* results_vals = (uint32_t*)(results + 4);
+ for (size_t w = 0; w < results_constr.datalen; w++) {
+ uint32_t results_conv_22 = results_vals[w];
+ void* results_conv_22_ptr = (void*)(((uint64_t)results_conv_22) & ~1);
+ CHECK_ACCESS(results_conv_22_ptr);
+ LDKCResult_NoneAPIErrorZ results_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(results_conv_22_ptr);
+ results_constr.data[w] = results_conv_22_conv;
+ }
+ LDKRouteParameters failed_paths_retry_conv;
+ failed_paths_retry_conv.inner = (void*)(failed_paths_retry & (~1));
+ failed_paths_retry_conv.is_owned = (failed_paths_retry & 1) || (failed_paths_retry == 0);
+ failed_paths_retry_conv = RouteParameters_clone(&failed_paths_retry_conv);
+ LDKThirtyTwoBytes payment_id_ref;
+ CHECK(*((uint32_t*)payment_id) == 32);
+ memcpy(payment_id_ref.data, (uint8_t*)(payment_id + 4), 32);
LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
- *ret_copy = PaymentSendFailure_partial_failure(a_constr);
+ *ret_copy = PaymentSendFailure_partial_failure(results_constr, failed_paths_retry_conv, payment_id_ref);
uint64_t ret_ref = (uint64_t)ret_copy;
return ret_ref;
}
params_conv.is_owned = (params & 1) || (params == 0);
params_conv = ChainParameters_clone(¶ms_conv);
LDKChannelManager ret_var = ChannelManager_new(fee_est_conv, chain_monitor_conv, tx_broadcaster_conv, logger_conv, keys_manager_conv, config_conv, params_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKUserConfig ret_var = ChannelManager_get_current_default_configuration(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_channels(&this_arg_conv);
- uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t q = 0; q < ret_var.datalen; q++) {
LDKChannelDetails ret_conv_16_var = ret_var.data[q];
+ uint64_t ret_conv_16_ref = 0;
CHECK((((uint64_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner;
+ ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner;
if (ret_conv_16_var.is_owned) {
ret_conv_16_ref |= 1;
}
ret_arr_ptr[q] = ret_conv_16_ref;
}
+
FREE(ret_var.data);
return ret_arr;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_usable_channels(&this_arg_conv);
- uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t q = 0; q < ret_var.datalen; q++) {
LDKChannelDetails ret_conv_16_var = ret_var.data[q];
+ uint64_t ret_conv_16_ref = 0;
CHECK((((uint64_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner;
+ ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner;
if (ret_conv_16_var.is_owned) {
ret_conv_16_ref |= 1;
}
ret_arr_ptr[q] = ret_conv_16_ref;
}
+
FREE(ret_var.data);
return ret_arr;
}
return (uint64_t)ret_conv;
}
-uint32_t __attribute__((visibility("default"))) TS_ChannelManager_retry_payment(uint32_t this_arg, uint32_t route, uint32_t payment_id) {
+uint32_t __attribute__((visibility("default"))) TS_ChannelManager_retry_payment(uint32_t this_arg, uint32_t route, int8_tArray payment_id) {
LDKChannelManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKRoute route_conv;
route_conv.inner = (void*)(route & (~1));
route_conv.is_owned = false;
- LDKPaymentId payment_id_conv;
- payment_id_conv.inner = (void*)(payment_id & (~1));
- payment_id_conv.is_owned = (payment_id & 1) || (payment_id == 0);
- payment_id_conv = PaymentId_clone(&payment_id_conv);
+ LDKThirtyTwoBytes payment_id_ref;
+ CHECK(*((uint32_t*)payment_id) == 32);
+ memcpy(payment_id_ref.data, (uint8_t*)(payment_id + 4), 32);
LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
- *ret_conv = ChannelManager_retry_payment(&this_arg_conv, &route_conv, payment_id_conv);
+ *ret_conv = ChannelManager_retry_payment(&this_arg_conv, &route_conv, payment_id_ref);
return (uint64_t)ret_conv;
}
return ret_arr;
}
-void __attribute__((visibility("default"))) TS_ChannelManager_channel_monitor_updated(uint32_t this_arg, uint32_t funding_txo, int64_t highest_applied_update_id) {
- LDKChannelManager this_arg_conv;
- this_arg_conv.inner = (void*)(this_arg & (~1));
- this_arg_conv.is_owned = false;
- LDKOutPoint funding_txo_conv;
- funding_txo_conv.inner = (void*)(funding_txo & (~1));
- funding_txo_conv.is_owned = false;
- ChannelManager_channel_monitor_updated(&this_arg_conv, &funding_txo_conv, highest_applied_update_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, int64_t user_payment_id) {
LDKChannelManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
LDKChannelManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKMessageSendEventsProvider* ret_ret =MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
+ LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
*ret_ret = ChannelManager_as_MessageSendEventsProvider(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKChannelManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKEventsProvider* ret_ret =MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
+ LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
*ret_ret = ChannelManager_as_EventsProvider(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKChannelManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKListen* ret_ret =MALLOC(sizeof(LDKListen), "LDKListen");
+ LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen");
*ret_ret = ChannelManager_as_Listen(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKChannelManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKConfirm* ret_ret =MALLOC(sizeof(LDKConfirm), "LDKConfirm");
+ LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm");
*ret_ret = ChannelManager_as_Confirm(&this_arg_conv);
return (uint64_t)ret_ret;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKBestBlock ret_var = ChannelManager_current_best_block(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKChannelManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKChannelMessageHandler* ret_ret =MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
+ LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
*ret_ret = ChannelManager_as_ChannelMessageHandler(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKChannelManagerReadArgs this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- uint64_t ret_ret = (uint64_t)ChannelManagerReadArgs_get_keys_manager(&this_ptr_conv);
+ // WARNING: This object doesn't live past this scope, needs clone!
+ uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_keys_manager(&this_ptr_conv)) | 1;
return ret_ret;
}
LDKChannelManagerReadArgs this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- uint64_t ret_ret = (uint64_t)ChannelManagerReadArgs_get_fee_estimator(&this_ptr_conv);
+ // WARNING: This object doesn't live past this scope, needs clone!
+ uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_fee_estimator(&this_ptr_conv)) | 1;
return ret_ret;
}
LDKChannelManagerReadArgs this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- uint64_t ret_ret = (uint64_t)ChannelManagerReadArgs_get_chain_monitor(&this_ptr_conv);
+ // WARNING: This object doesn't live past this scope, needs clone!
+ uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_chain_monitor(&this_ptr_conv)) | 1;
return ret_ret;
}
LDKChannelManagerReadArgs this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- uint64_t ret_ret = (uint64_t)ChannelManagerReadArgs_get_tx_broadcaster(&this_ptr_conv);
+ // WARNING: This object doesn't live past this scope, needs clone!
+ uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_tx_broadcaster(&this_ptr_conv)) | 1;
return ret_ret;
}
LDKChannelManagerReadArgs this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- uint64_t ret_ret = (uint64_t)ChannelManagerReadArgs_get_logger(&this_ptr_conv);
+ // WARNING: This object doesn't live past this scope, needs clone!
+ uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_logger(&this_ptr_conv)) | 1;
return ret_ret;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKUserConfig ret_var = ChannelManagerReadArgs_get_default_config(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
channel_monitors_constr.data[q] = channel_monitors_conv_16_conv;
}
LDKChannelManagerReadArgs ret_var = ChannelManagerReadArgs_new(keys_manager_conv, fee_estimator_conv, chain_monitor_conv, tx_broadcaster_conv, logger_conv, default_config_conv, channel_monitors_constr);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKDecodeError ret_var = DecodeError_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKInitFeatures ret_var = Init_get_features(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0);
features_arg_conv = InitFeatures_clone(&features_arg_conv);
LDKInit ret_var = Init_new(features_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKInit ret_var = Init_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
memcpy(channel_id_arg_ref.data, (uint8_t*)(channel_id_arg + 4), 32);
LDKStr data_arg_conv = str_ref_to_owned_c(data_arg);
LDKErrorMessage ret_var = ErrorMessage_new(channel_id_arg_ref, data_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKErrorMessage ret_var = ErrorMessage_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
uint32_t __attribute__((visibility("default"))) TS_Ping_new(int16_t ponglen_arg, int16_t byteslen_arg) {
LDKPing ret_var = Ping_new(ponglen_arg, byteslen_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKPing ret_var = Ping_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
uint32_t __attribute__((visibility("default"))) TS_Pong_new(int16_t byteslen_arg) {
LDKPong ret_var = Pong_new(byteslen_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKPong ret_var = Pong_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKOpenChannel ret_var = OpenChannel_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKAcceptChannel ret_var = AcceptChannel_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK(*((uint32_t*)signature_arg) == 64);
memcpy(signature_arg_ref.compact_form, (uint8_t*)(signature_arg + 4), 64);
LDKFundingCreated ret_var = FundingCreated_new(temporary_channel_id_arg_ref, funding_txid_arg_ref, funding_output_index_arg, signature_arg_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKFundingCreated ret_var = FundingCreated_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK(*((uint32_t*)signature_arg) == 64);
memcpy(signature_arg_ref.compact_form, (uint8_t*)(signature_arg + 4), 64);
LDKFundingSigned ret_var = FundingSigned_new(channel_id_arg_ref, signature_arg_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKFundingSigned ret_var = FundingSigned_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK(*((uint32_t*)next_per_commitment_point_arg) == 33);
memcpy(next_per_commitment_point_arg_ref.compressed_form, (uint8_t*)(next_per_commitment_point_arg + 4), 33);
LDKFundingLocked ret_var = FundingLocked_new(channel_id_arg_ref, next_per_commitment_point_arg_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKFundingLocked ret_var = FundingLocked_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
scriptpubkey_arg_ref.data = MALLOC(scriptpubkey_arg_ref.datalen, "LDKCVec_u8Z Bytes");
memcpy(scriptpubkey_arg_ref.data, (uint8_t*)(scriptpubkey_arg + 4), scriptpubkey_arg_ref.datalen);
LDKShutdown ret_var = Shutdown_new(channel_id_arg_ref, scriptpubkey_arg_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKShutdown ret_var = Shutdown_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
uint32_t __attribute__((visibility("default"))) TS_ClosingSignedFeeRange_new(int64_t min_fee_satoshis_arg, int64_t max_fee_satoshis_arg) {
LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_new(min_fee_satoshis_arg, max_fee_satoshis_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKClosingSignedFeeRange ret_var = ClosingSigned_get_fee_range(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
fee_range_arg_conv.is_owned = (fee_range_arg & 1) || (fee_range_arg == 0);
fee_range_arg_conv = ClosingSignedFeeRange_clone(&fee_range_arg_conv);
LDKClosingSigned ret_var = ClosingSigned_new(channel_id_arg_ref, fee_satoshis_arg, signature_arg_ref, fee_range_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKClosingSigned ret_var = ClosingSigned_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKUpdateAddHTLC ret_var = UpdateAddHTLC_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK(*((uint32_t*)payment_preimage_arg) == 32);
memcpy(payment_preimage_arg_ref.data, (uint8_t*)(payment_preimage_arg + 4), 32);
LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_new(channel_id_arg_ref, htlc_id_arg, payment_preimage_arg_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKUpdateFailHTLC ret_var = UpdateFailHTLC_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKUpdateFailMalformedHTLC ret_var = UpdateFailMalformedHTLC_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
htlc_signatures_arg_constr.data[m] = htlc_signatures_arg_conv_12_ref;
}
LDKCommitmentSigned ret_var = CommitmentSigned_new(channel_id_arg_ref, signature_arg_ref, htlc_signatures_arg_constr);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKCommitmentSigned ret_var = CommitmentSigned_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK(*((uint32_t*)next_per_commitment_point_arg) == 33);
memcpy(next_per_commitment_point_arg_ref.compressed_form, (uint8_t*)(next_per_commitment_point_arg + 4), 33);
LDKRevokeAndACK ret_var = RevokeAndACK_new(channel_id_arg_ref, per_commitment_secret_arg_ref, next_per_commitment_point_arg_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKRevokeAndACK ret_var = RevokeAndACK_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK(*((uint32_t*)channel_id_arg) == 32);
memcpy(channel_id_arg_ref.data, (uint8_t*)(channel_id_arg + 4), 32);
LDKUpdateFee ret_var = UpdateFee_new(channel_id_arg_ref, feerate_per_kw_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKUpdateFee ret_var = UpdateFee_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK(*((uint32_t*)my_current_per_commitment_point_arg) == 33);
memcpy(my_current_per_commitment_point_arg_ref.compressed_form, (uint8_t*)(my_current_per_commitment_point_arg + 4), 33);
LDKDataLossProtect ret_var = DataLossProtect_new(your_last_per_commitment_secret_arg_ref, my_current_per_commitment_point_arg_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKDataLossProtect ret_var = DataLossProtect_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelReestablish ret_var = ChannelReestablish_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK(*((uint32_t*)bitcoin_signature_arg) == 64);
memcpy(bitcoin_signature_arg_ref.compact_form, (uint8_t*)(bitcoin_signature_arg + 4), 64);
LDKAnnouncementSignatures ret_var = AnnouncementSignatures_new(channel_id_arg_ref, short_channel_id_arg, node_signature_arg_ref, bitcoin_signature_arg_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKAnnouncementSignatures ret_var = AnnouncementSignatures_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
return ret_arr;
}
-uint32_t __attribute__((visibility("default"))) TS_Result_read(int8_tArray ser) {
- LDKu8slice ser_ref;
- ser_ref.datalen = *((uint32_t*)ser);
- ser_ref.data = (int8_t*)(ser + 4);
- LDKCResult_CResult_NetAddressu8ZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CResult_NetAddressu8ZDecodeErrorZ), "LDKCResult_CResult_NetAddressu8ZDecodeErrorZ");
- *ret_conv = Result_read(ser_ref);
- return (uint64_t)ret_conv;
-}
-
uint32_t __attribute__((visibility("default"))) TS_NetAddress_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = *((uint32_t*)ser);
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKNodeFeatures ret_var = UnsignedNodeAnnouncement_get_features(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKUnsignedNodeAnnouncement ret_var = NodeAnnouncement_get_contents(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
contents_arg_conv.is_owned = (contents_arg & 1) || (contents_arg == 0);
contents_arg_conv = UnsignedNodeAnnouncement_clone(&contents_arg_conv);
LDKNodeAnnouncement ret_var = NodeAnnouncement_new(signature_arg_ref, contents_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKNodeAnnouncement ret_var = NodeAnnouncement_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKChannelFeatures ret_var = UnsignedChannelAnnouncement_get_features(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKUnsignedChannelAnnouncement ret_var = UnsignedChannelAnnouncement_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKUnsignedChannelAnnouncement ret_var = ChannelAnnouncement_get_contents(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
contents_arg_conv.is_owned = (contents_arg & 1) || (contents_arg == 0);
contents_arg_conv = UnsignedChannelAnnouncement_clone(&contents_arg_conv);
LDKChannelAnnouncement ret_var = ChannelAnnouncement_new(node_signature_1_arg_ref, node_signature_2_arg_ref, bitcoin_signature_1_arg_ref, bitcoin_signature_2_arg_ref, contents_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelAnnouncement ret_var = ChannelAnnouncement_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKUnsignedChannelUpdate ret_var = ChannelUpdate_get_contents(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
contents_arg_conv.is_owned = (contents_arg & 1) || (contents_arg == 0);
contents_arg_conv = UnsignedChannelUpdate_clone(&contents_arg_conv);
LDKChannelUpdate ret_var = ChannelUpdate_new(signature_arg_ref, contents_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelUpdate ret_var = ChannelUpdate_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK(*((uint32_t*)chain_hash_arg) == 32);
memcpy(chain_hash_arg_ref.data, (uint8_t*)(chain_hash_arg + 4), 32);
LDKQueryChannelRange ret_var = QueryChannelRange_new(chain_hash_arg_ref, first_blocknum_arg, number_of_blocks_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKQueryChannelRange ret_var = QueryChannelRange_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
short_channel_ids_arg_constr.data[i] = short_channel_ids_arg_conv_8;
}
LDKReplyChannelRange ret_var = ReplyChannelRange_new(chain_hash_arg_ref, first_blocknum_arg, number_of_blocks_arg, sync_complete_arg, short_channel_ids_arg_constr);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKReplyChannelRange ret_var = ReplyChannelRange_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
short_channel_ids_arg_constr.data[i] = short_channel_ids_arg_conv_8;
}
LDKQueryShortChannelIds ret_var = QueryShortChannelIds_new(chain_hash_arg_ref, short_channel_ids_arg_constr);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKQueryShortChannelIds ret_var = QueryShortChannelIds_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK(*((uint32_t*)chain_hash_arg) == 32);
memcpy(chain_hash_arg_ref.data, (uint8_t*)(chain_hash_arg + 4), 32);
LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_new(chain_hash_arg_ref, full_information_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK(*((uint32_t*)chain_hash_arg) == 32);
memcpy(chain_hash_arg_ref.data, (uint8_t*)(chain_hash_arg + 4), 32);
LDKGossipTimestampFilter ret_var = GossipTimestampFilter_new(chain_hash_arg_ref, first_timestamp_arg, timestamp_range_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKGossipTimestampFilter ret_var = GossipTimestampFilter_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKErrorAction action_arg_conv = *(LDKErrorAction*)(action_arg_ptr);
action_arg_conv = ErrorAction_clone((LDKErrorAction*)(((uint64_t)action_arg) & ~1));
LDKLightningError ret_var = LightningError_new(err_arg_conv, action_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKLightningError ret_var = LightningError_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKCVec_UpdateAddHTLCZ ret_var = CommitmentUpdate_get_update_add_htlcs(&this_ptr_conv);
- uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t p = 0; p < ret_var.datalen; p++) {
LDKUpdateAddHTLC ret_conv_15_var = ret_var.data[p];
+ uint64_t ret_conv_15_ref = 0;
CHECK((((uint64_t)ret_conv_15_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_conv_15_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t ret_conv_15_ref = (uint64_t)ret_conv_15_var.inner;
+ ret_conv_15_ref = (uint64_t)ret_conv_15_var.inner;
if (ret_conv_15_var.is_owned) {
ret_conv_15_ref |= 1;
}
ret_arr_ptr[p] = ret_conv_15_ref;
}
+
FREE(ret_var.data);
return ret_arr;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKCVec_UpdateFulfillHTLCZ ret_var = CommitmentUpdate_get_update_fulfill_htlcs(&this_ptr_conv);
- uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t t = 0; t < ret_var.datalen; t++) {
LDKUpdateFulfillHTLC ret_conv_19_var = ret_var.data[t];
+ uint64_t ret_conv_19_ref = 0;
CHECK((((uint64_t)ret_conv_19_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_conv_19_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t ret_conv_19_ref = (uint64_t)ret_conv_19_var.inner;
+ ret_conv_19_ref = (uint64_t)ret_conv_19_var.inner;
if (ret_conv_19_var.is_owned) {
ret_conv_19_ref |= 1;
}
ret_arr_ptr[t] = ret_conv_19_ref;
}
+
FREE(ret_var.data);
return ret_arr;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKCVec_UpdateFailHTLCZ ret_var = CommitmentUpdate_get_update_fail_htlcs(&this_ptr_conv);
- uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t q = 0; q < ret_var.datalen; q++) {
LDKUpdateFailHTLC ret_conv_16_var = ret_var.data[q];
+ uint64_t ret_conv_16_ref = 0;
CHECK((((uint64_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner;
+ ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner;
if (ret_conv_16_var.is_owned) {
ret_conv_16_ref |= 1;
}
ret_arr_ptr[q] = ret_conv_16_ref;
}
+
FREE(ret_var.data);
return ret_arr;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKCVec_UpdateFailMalformedHTLCZ ret_var = CommitmentUpdate_get_update_fail_malformed_htlcs(&this_ptr_conv);
- uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t z = 0; z < ret_var.datalen; z++) {
LDKUpdateFailMalformedHTLC ret_conv_25_var = ret_var.data[z];
+ uint64_t ret_conv_25_ref = 0;
CHECK((((uint64_t)ret_conv_25_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_conv_25_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t ret_conv_25_ref = (uint64_t)ret_conv_25_var.inner;
+ ret_conv_25_ref = (uint64_t)ret_conv_25_var.inner;
if (ret_conv_25_var.is_owned) {
ret_conv_25_ref |= 1;
}
ret_arr_ptr[z] = ret_conv_25_ref;
}
+
FREE(ret_var.data);
return ret_arr;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKUpdateFee ret_var = CommitmentUpdate_get_update_fee(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKCommitmentSigned ret_var = CommitmentUpdate_get_commitment_signed(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
commitment_signed_arg_conv.is_owned = (commitment_signed_arg & 1) || (commitment_signed_arg == 0);
commitment_signed_arg_conv = CommitmentSigned_clone(&commitment_signed_arg_conv);
LDKCommitmentUpdate ret_var = CommitmentUpdate_new(update_add_htlcs_arg_constr, update_fulfill_htlcs_arg_constr, update_fail_htlcs_arg_constr, update_fail_malformed_htlcs_arg_constr, update_fee_arg_conv, commitment_signed_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKCommitmentUpdate ret_var = CommitmentUpdate_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
uint32_t __attribute__((visibility("default"))) TS_IgnoringMessageHandler_new() {
LDKIgnoringMessageHandler ret_var = IgnoringMessageHandler_new();
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKIgnoringMessageHandler this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKMessageSendEventsProvider* ret_ret =MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
+ LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
*ret_ret = IgnoringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKIgnoringMessageHandler this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKRoutingMessageHandler* ret_ret =MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
+ LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
*ret_ret = IgnoringMessageHandler_as_RoutingMessageHandler(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKIgnoringMessageHandler this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKCustomMessageReader* ret_ret =MALLOC(sizeof(LDKCustomMessageReader), "LDKCustomMessageReader");
+ LDKCustomMessageReader* ret_ret = MALLOC(sizeof(LDKCustomMessageReader), "LDKCustomMessageReader");
*ret_ret = IgnoringMessageHandler_as_CustomMessageReader(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKIgnoringMessageHandler this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKCustomMessageHandler* ret_ret =MALLOC(sizeof(LDKCustomMessageHandler), "LDKCustomMessageHandler");
+ LDKCustomMessageHandler* ret_ret = MALLOC(sizeof(LDKCustomMessageHandler), "LDKCustomMessageHandler");
*ret_ret = IgnoringMessageHandler_as_CustomMessageHandler(&this_arg_conv);
return (uint64_t)ret_ret;
}
uint32_t __attribute__((visibility("default"))) TS_ErroringMessageHandler_new() {
LDKErroringMessageHandler ret_var = ErroringMessageHandler_new();
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKErroringMessageHandler this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKMessageSendEventsProvider* ret_ret =MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
+ LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
*ret_ret = ErroringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKErroringMessageHandler this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKChannelMessageHandler* ret_ret =MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
+ LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
*ret_ret = ErroringMessageHandler_as_ChannelMessageHandler(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKMessageHandler this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- uint64_t ret_ret = (uint64_t)MessageHandler_get_chan_handler(&this_ptr_conv);
+ // WARNING: This object doesn't live past this scope, needs clone!
+ uint64_t ret_ret = ((uint64_t)MessageHandler_get_chan_handler(&this_ptr_conv)) | 1;
return ret_ret;
}
LDKMessageHandler this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- uint64_t ret_ret = (uint64_t)MessageHandler_get_route_handler(&this_ptr_conv);
+ // WARNING: This object doesn't live past this scope, needs clone!
+ uint64_t ret_ret = ((uint64_t)MessageHandler_get_route_handler(&this_ptr_conv)) | 1;
return ret_ret;
}
CHECK_ACCESS(route_handler_arg_ptr);
LDKRoutingMessageHandler route_handler_arg_conv = *(LDKRoutingMessageHandler*)(route_handler_arg_ptr);
LDKMessageHandler ret_var = MessageHandler_new(chan_handler_arg_conv, route_handler_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
void* orig_ptr = (void*)(((uint64_t)orig) & ~1);
if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); }
LDKSocketDescriptor* orig_conv = (LDKSocketDescriptor*)orig_ptr;
- LDKSocketDescriptor* ret_ret =MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
+ LDKSocketDescriptor* ret_ret = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
*ret_ret = SocketDescriptor_clone(orig_conv);
return (uint64_t)ret_ret;
}
uint32_t __attribute__((visibility("default"))) TS_PeerHandleError_new(jboolean no_connection_possible_arg) {
LDKPeerHandleError ret_var = PeerHandleError_new(no_connection_possible_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKPeerHandleError ret_var = PeerHandleError_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK_ACCESS(custom_message_handler_ptr);
LDKCustomMessageHandler custom_message_handler_conv = *(LDKCustomMessageHandler*)(custom_message_handler_ptr);
LDKPeerManager ret_var = PeerManager_new(message_handler_conv, our_node_secret_ref, ephemeral_random_data_ref, logger_conv, custom_message_handler_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCVec_PublicKeyZ ret_var = PeerManager_get_peer_node_ids(&this_arg_conv);
- ptrArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native ptrArray Bytes");
+ ptrArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native ptrArray Bytes");
int8_tArray *ret_arr_ptr = (int8_tArray*)(ret_arr + 4);
for (size_t m = 0; m < ret_var.datalen; m++) {
int8_tArray ret_conv_12_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(ret_conv_12_arr + 4), ret_var.data[m].compressed_form, 33);
ret_arr_ptr[m] = ret_conv_12_arr;
}
+
FREE(ret_var.data);
return ret_arr;
}
PeerManager_disconnect_by_node_id(&this_arg_conv, node_id_ref, no_connection_possible);
}
+void __attribute__((visibility("default"))) TS_PeerManager_disconnect_all_peers(uint32_t this_arg) {
+ LDKPeerManager this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ PeerManager_disconnect_all_peers(&this_arg_conv);
+}
+
void __attribute__((visibility("default"))) TS_PeerManager_timer_tick_occurred(uint32_t this_arg) {
LDKPeerManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
CHECK(*((uint32_t*)broadcaster_delayed_payment_key_arg) == 33);
memcpy(broadcaster_delayed_payment_key_arg_ref.compressed_form, (uint8_t*)(broadcaster_delayed_payment_key_arg + 4), 33);
LDKTxCreationKeys ret_var = TxCreationKeys_new(per_commitment_point_arg_ref, revocation_key_arg_ref, broadcaster_htlc_key_arg_ref, countersignatory_htlc_key_arg_ref, broadcaster_delayed_payment_key_arg_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKTxCreationKeys ret_var = TxCreationKeys_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK(*((uint32_t*)htlc_basepoint_arg) == 33);
memcpy(htlc_basepoint_arg_ref.compressed_form, (uint8_t*)(htlc_basepoint_arg + 4), 33);
LDKChannelPublicKeys ret_var = ChannelPublicKeys_new(funding_pubkey_arg_ref, revocation_basepoint_arg_ref, payment_point_arg_ref, delayed_payment_basepoint_arg_ref, htlc_basepoint_arg_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelPublicKeys ret_var = ChannelPublicKeys_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKCOption_u32Z transaction_output_index_arg_conv = *(LDKCOption_u32Z*)(transaction_output_index_arg_ptr);
transaction_output_index_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)(((uint64_t)transaction_output_index_arg) & ~1));
LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_new(offered_arg, amount_msat_arg, cltv_expiry_arg, payment_hash_arg_ref, transaction_output_index_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKChannelPublicKeys ret_var = ChannelTransactionParameters_get_holder_pubkeys(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKCounterpartyChannelTransactionParameters ret_var = ChannelTransactionParameters_get_counterparty_parameters(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKOutPoint ret_var = ChannelTransactionParameters_get_funding_outpoint(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
funding_outpoint_arg_conv.is_owned = (funding_outpoint_arg & 1) || (funding_outpoint_arg == 0);
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);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKChannelPublicKeys ret_var = CounterpartyChannelTransactionParameters_get_pubkeys(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
pubkeys_arg_conv.is_owned = (pubkeys_arg & 1) || (pubkeys_arg == 0);
pubkeys_arg_conv = ChannelPublicKeys_clone(&pubkeys_arg_conv);
LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_new(pubkeys_arg_conv, selected_contest_delay_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_holder_broadcastable(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_counterparty_broadcastable(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_broadcaster_pubkeys(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_countersignatory_pubkeys(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKOutPoint ret_var = DirectedChannelTransactionParameters_funding_outpoint(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK(*((uint32_t*)counterparty_funding_key) == 33);
memcpy(counterparty_funding_key_ref.compressed_form, (uint8_t*)(counterparty_funding_key + 4), 33);
LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_new(commitment_tx_conv, counterparty_sig_ref, counterparty_htlc_sigs_constr, holder_funding_key_ref, counterparty_funding_key_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK(*((uint32_t*)txid_arg) == 32);
memcpy(txid_arg_ref.data, (uint8_t*)(txid_arg + 4), 32);
LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_new(transaction_arg_ref, txid_arg_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKClosingTransaction ret_var = ClosingTransaction_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
funding_outpoint_conv.is_owned = (funding_outpoint & 1) || (funding_outpoint == 0);
funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv);
LDKClosingTransaction ret_var = ClosingTransaction_new(to_holder_value_sat, to_counterparty_value_sat, to_holder_script_ref, to_counterparty_script_ref, funding_outpoint_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKTrustedClosingTransaction ret_var = ClosingTransaction_trust(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKCommitmentTransaction ret_var = CommitmentTransaction_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKTrustedCommitmentTransaction ret_var = CommitmentTransaction_trust(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKBuiltCommitmentTransaction ret_var = TrustedCommitmentTransaction_built_transaction(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKTxCreationKeys ret_var = TrustedCommitmentTransaction_keys(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKInitFeatures ret_var = InitFeatures_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKNodeFeatures ret_var = NodeFeatures_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelFeatures ret_var = ChannelFeatures_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKInvoiceFeatures ret_var = InvoiceFeatures_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
uint32_t __attribute__((visibility("default"))) TS_InitFeatures_empty() {
LDKInitFeatures ret_var = InitFeatures_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
uint32_t __attribute__((visibility("default"))) TS_InitFeatures_known() {
LDKInitFeatures ret_var = InitFeatures_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
uint32_t __attribute__((visibility("default"))) TS_NodeFeatures_empty() {
LDKNodeFeatures ret_var = NodeFeatures_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
uint32_t __attribute__((visibility("default"))) TS_NodeFeatures_known() {
LDKNodeFeatures ret_var = NodeFeatures_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
uint32_t __attribute__((visibility("default"))) TS_ChannelFeatures_empty() {
LDKChannelFeatures ret_var = ChannelFeatures_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
uint32_t __attribute__((visibility("default"))) TS_ChannelFeatures_known() {
LDKChannelFeatures ret_var = ChannelFeatures_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
uint32_t __attribute__((visibility("default"))) TS_InvoiceFeatures_empty() {
LDKInvoiceFeatures ret_var = InvoiceFeatures_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
uint32_t __attribute__((visibility("default"))) TS_InvoiceFeatures_known() {
LDKInvoiceFeatures ret_var = InvoiceFeatures_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKShutdownScript ret_var = ShutdownScript_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
script_arg_ref.data = MALLOC(script_arg_ref.datalen, "LDKCVec_u8Z Bytes");
memcpy(script_arg_ref.data, (uint8_t*)(script_arg + 4), script_arg_ref.datalen);
LDKInvalidShutdownScript ret_var = InvalidShutdownScript_new(script_arg_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKInvalidShutdownScript ret_var = InvalidShutdownScript_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
memcpy(pubkey_hash_arr, (uint8_t*)(pubkey_hash + 4), 20);
unsigned char (*pubkey_hash_ref)[20] = &pubkey_hash_arr;
LDKShutdownScript ret_var = ShutdownScript_new_p2wpkh(pubkey_hash_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
memcpy(script_hash_arr, (uint8_t*)(script_hash + 4), 32);
unsigned char (*script_hash_ref)[32] = &script_hash_arr;
LDKShutdownScript ret_var = ShutdownScript_new_p2wsh(script_hash_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
void* orig_ptr = (void*)(((uint64_t)orig) & ~1);
if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); }
LDKType* orig_conv = (LDKType*)orig_ptr;
- LDKType* ret_ret =MALLOC(sizeof(LDKType), "LDKType");
+ LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType");
*ret_ret = Type_clone(orig_conv);
return (uint64_t)ret_ret;
}
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);
+ 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.
+ 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;
+ 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));
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKNodeId ret_var = NodeId_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK(*((uint32_t*)pubkey) == 33);
memcpy(pubkey_ref.compressed_form, (uint8_t*)(pubkey + 4), 33);
LDKNodeId ret_var = NodeId_from_pubkey(pubkey_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKNetworkGraph ret_var = NetworkGraph_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKNetGraphMsgHandler this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKEventHandler* ret_ret =MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
+ LDKEventHandler* ret_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
*ret_ret = NetGraphMsgHandler_as_EventHandler(&this_arg_conv);
return (uint64_t)ret_ret;
}
NetGraphMsgHandler_free(this_obj_conv);
}
-uint32_t __attribute__((visibility("default"))) TS_NetGraphMsgHandler_get_network_graph(uint32_t this_ptr) {
- LDKNetGraphMsgHandler this_ptr_conv;
- this_ptr_conv.inner = (void*)(this_ptr & (~1));
- this_ptr_conv.is_owned = false;
- LDKNetworkGraph ret_var = NetGraphMsgHandler_get_network_graph(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
- }
- return ret_ref;
-}
-
-void __attribute__((visibility("default"))) TS_NetGraphMsgHandler_set_network_graph(uint32_t this_ptr, uint32_t val) {
- LDKNetGraphMsgHandler this_ptr_conv;
- this_ptr_conv.inner = (void*)(this_ptr & (~1));
- this_ptr_conv.is_owned = false;
- LDKNetworkGraph val_conv;
- val_conv.inner = (void*)(val & (~1));
- val_conv.is_owned = (val & 1) || (val == 0);
- val_conv = NetworkGraph_clone(&val_conv);
- NetGraphMsgHandler_set_network_graph(&this_ptr_conv, val_conv);
-}
-
uint32_t __attribute__((visibility("default"))) TS_NetGraphMsgHandler_new(uint32_t network_graph, uint32_t chain_access, uint32_t logger) {
LDKNetworkGraph network_graph_conv;
network_graph_conv.inner = (void*)(network_graph & (~1));
- network_graph_conv.is_owned = (network_graph & 1) || (network_graph == 0);
- network_graph_conv = NetworkGraph_clone(&network_graph_conv);
+ network_graph_conv.is_owned = false;
void* chain_access_ptr = (void*)(((uint64_t)chain_access) & ~1);
CHECK_ACCESS(chain_access_ptr);
LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
CHECK_ACCESS(logger_ptr);
LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
- LDKNetGraphMsgHandler ret_var = NetGraphMsgHandler_new(network_graph_conv, chain_access_conv, logger_conv);
+ LDKNetGraphMsgHandler ret_var = NetGraphMsgHandler_new(&network_graph_conv, chain_access_conv, logger_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKNetGraphMsgHandler this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKRoutingMessageHandler* ret_ret =MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
+ LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
*ret_ret = NetGraphMsgHandler_as_RoutingMessageHandler(&this_arg_conv);
return (uint64_t)ret_ret;
}
LDKNetGraphMsgHandler this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKMessageSendEventsProvider* ret_ret =MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
+ LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
*ret_ret = NetGraphMsgHandler_as_MessageSendEventsProvider(&this_arg_conv);
return (uint64_t)ret_ret;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKRoutingFees ret_var = DirectionalChannelInfo_get_fees(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKChannelUpdate ret_var = DirectionalChannelInfo_get_last_update_message(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
last_update_message_arg_conv.is_owned = (last_update_message_arg & 1) || (last_update_message_arg == 0);
last_update_message_arg_conv = ChannelUpdate_clone(&last_update_message_arg_conv);
LDKDirectionalChannelInfo ret_var = DirectionalChannelInfo_new(last_update_arg, enabled_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg_conv, fees_arg_conv, last_update_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKDirectionalChannelInfo ret_var = DirectionalChannelInfo_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKChannelFeatures ret_var = ChannelInfo_get_features(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKNodeId ret_var = ChannelInfo_get_node_one(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKDirectionalChannelInfo ret_var = ChannelInfo_get_one_to_two(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKNodeId ret_var = ChannelInfo_get_node_two(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKDirectionalChannelInfo ret_var = ChannelInfo_get_two_to_one(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKChannelAnnouncement ret_var = ChannelInfo_get_announcement_message(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
announcement_message_arg_conv.is_owned = (announcement_message_arg & 1) || (announcement_message_arg == 0);
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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKChannelInfo ret_var = ChannelInfo_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
uint32_t __attribute__((visibility("default"))) TS_RoutingFees_new(int32_t base_msat_arg, int32_t proportional_millionths_arg) {
LDKRoutingFees ret_var = RoutingFees_new(base_msat_arg, proportional_millionths_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKRoutingFees ret_var = RoutingFees_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKNodeFeatures ret_var = NodeAnnouncementInfo_get_features(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKNodeAnnouncement ret_var = NodeAnnouncementInfo_get_announcement_message(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
announcement_message_arg_conv.is_owned = (announcement_message_arg & 1) || (announcement_message_arg == 0);
announcement_message_arg_conv = NodeAnnouncement_clone(&announcement_message_arg_conv);
LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_new(features_arg_conv, last_update_arg, rgb_arg_ref, alias_arg_ref, addresses_arg_constr, 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKRoutingFees ret_var = NodeInfo_get_lowest_inbound_channel_fees(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKNodeAnnouncementInfo ret_var = NodeInfo_get_announcement_info(&this_ptr_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
announcement_info_arg_conv.is_owned = (announcement_info_arg & 1) || (announcement_info_arg == 0);
announcement_info_arg_conv = NodeAnnouncementInfo_clone(&announcement_info_arg_conv);
LDKNodeInfo ret_var = NodeInfo_new(channels_arg_constr, lowest_inbound_channel_fees_arg_conv, announcement_info_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKNodeInfo ret_var = NodeInfo_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
CHECK(*((uint32_t*)genesis_hash) == 32);
memcpy(genesis_hash_ref.data, (uint8_t*)(genesis_hash + 4), 32);
LDKNetworkGraph ret_var = NetworkGraph_new(genesis_hash_ref);
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKReadOnlyNetworkGraph ret_var = NetworkGraph_read_only(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKNodeFeatures ret_var = RouteHop_get_node_features(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKChannelFeatures ret_var = RouteHop_get_channel_features(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
channel_features_arg_conv.is_owned = (channel_features_arg & 1) || (channel_features_arg == 0);
channel_features_arg_conv = ChannelFeatures_clone(&channel_features_arg_conv);
LDKRouteHop ret_var = RouteHop_new(pubkey_arg_ref, node_features_arg_conv, short_channel_id_arg, channel_features_arg_conv, fee_msat_arg, cltv_expiry_delta_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKRouteHop ret_var = RouteHop_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKCVec_CVec_RouteHopZZ ret_var = Route_get_paths(&this_ptr_conv);
- ptrArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native ptrArray Bytes");
+ ptrArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native ptrArray Bytes");
uint32_tArray *ret_arr_ptr = (uint32_tArray*)(ret_arr + 4);
for (size_t m = 0; m < ret_var.datalen; m++) {
LDKCVec_RouteHopZ ret_conv_12_var = ret_var.data[m];
- uint32_tArray ret_conv_12_arr = init_arr(ret_conv_12_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray ret_conv_12_arr = NULL;
+ ret_conv_12_arr = init_arr(ret_conv_12_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_conv_12_arr_ptr = (uint32_t*)(ret_conv_12_arr + 4);
for (size_t k = 0; k < ret_conv_12_var.datalen; k++) {
LDKRouteHop ret_conv_12_conv_10_var = ret_conv_12_var.data[k];
+ uint64_t ret_conv_12_conv_10_ref = 0;
CHECK((((uint64_t)ret_conv_12_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_conv_12_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t ret_conv_12_conv_10_ref = (uint64_t)ret_conv_12_conv_10_var.inner;
+ ret_conv_12_conv_10_ref = (uint64_t)ret_conv_12_conv_10_var.inner;
if (ret_conv_12_conv_10_var.is_owned) {
ret_conv_12_conv_10_ref |= 1;
}
ret_conv_12_arr_ptr[k] = ret_conv_12_conv_10_ref;
}
+
FREE(ret_conv_12_var.data);
ret_arr_ptr[m] = ret_conv_12_arr;
}
+
FREE(ret_var.data);
return ret_arr;
}
Route_set_paths(&this_ptr_conv, val_constr);
}
-uint32_t __attribute__((visibility("default"))) TS_Route_new(ptrArray paths_arg) {
+uint32_t __attribute__((visibility("default"))) TS_Route_get_payee(uint32_t this_ptr) {
+ LDKRoute this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKPayee ret_var = Route_get_payee(&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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ }
+ return ret_ref;
+}
+
+void __attribute__((visibility("default"))) TS_Route_set_payee(uint32_t this_ptr, uint32_t val) {
+ LDKRoute this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKPayee val_conv;
+ val_conv.inner = (void*)(val & (~1));
+ val_conv.is_owned = (val & 1) || (val == 0);
+ val_conv = Payee_clone(&val_conv);
+ Route_set_payee(&this_ptr_conv, val_conv);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_Route_new(ptrArray paths_arg, uint32_t payee_arg) {
LDKCVec_CVec_RouteHopZZ paths_arg_constr;
paths_arg_constr.datalen = *((uint32_t*)paths_arg);
if (paths_arg_constr.datalen > 0)
}
paths_arg_constr.data[m] = paths_arg_conv_12_constr;
}
- LDKRoute ret_var = Route_new(paths_arg_constr);
+ LDKPayee payee_arg_conv;
+ payee_arg_conv.inner = (void*)(payee_arg & (~1));
+ payee_arg_conv.is_owned = (payee_arg & 1) || (payee_arg == 0);
+ payee_arg_conv = Payee_clone(&payee_arg_conv);
+ LDKRoute ret_var = Route_new(paths_arg_constr, payee_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKRoute ret_var = Route_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
return (uint64_t)ret_conv;
}
-void __attribute__((visibility("default"))) TS_RouteHint_free(uint32_t this_obj) {
- LDKRouteHint this_obj_conv;
+void __attribute__((visibility("default"))) TS_RouteParameters_free(uint32_t this_obj) {
+ LDKRouteParameters this_obj_conv;
+ this_obj_conv.inner = (void*)(this_obj & (~1));
+ this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+ RouteParameters_free(this_obj_conv);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_RouteParameters_get_payee(uint32_t this_ptr) {
+ LDKRouteParameters this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKPayee ret_var = RouteParameters_get_payee(&this_ptr_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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
+void __attribute__((visibility("default"))) TS_RouteParameters_set_payee(uint32_t this_ptr, uint32_t val) {
+ LDKRouteParameters this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKPayee val_conv;
+ val_conv.inner = (void*)(val & (~1));
+ val_conv.is_owned = (val & 1) || (val == 0);
+ val_conv = Payee_clone(&val_conv);
+ RouteParameters_set_payee(&this_ptr_conv, val_conv);
+}
+
+int64_t __attribute__((visibility("default"))) TS_RouteParameters_get_final_value_msat(uint32_t this_ptr) {
+ LDKRouteParameters this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ int64_t ret_val = RouteParameters_get_final_value_msat(&this_ptr_conv);
+ return ret_val;
+}
+
+void __attribute__((visibility("default"))) TS_RouteParameters_set_final_value_msat(uint32_t this_ptr, int64_t val) {
+ LDKRouteParameters this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ RouteParameters_set_final_value_msat(&this_ptr_conv, val);
+}
+
+int32_t __attribute__((visibility("default"))) TS_RouteParameters_get_final_cltv_expiry_delta(uint32_t this_ptr) {
+ LDKRouteParameters this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ int32_t ret_val = RouteParameters_get_final_cltv_expiry_delta(&this_ptr_conv);
+ return ret_val;
+}
+
+void __attribute__((visibility("default"))) TS_RouteParameters_set_final_cltv_expiry_delta(uint32_t this_ptr, int32_t val) {
+ LDKRouteParameters this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ RouteParameters_set_final_cltv_expiry_delta(&this_ptr_conv, val);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_RouteParameters_new(uint32_t payee_arg, int64_t final_value_msat_arg, int32_t final_cltv_expiry_delta_arg) {
+ LDKPayee payee_arg_conv;
+ payee_arg_conv.inner = (void*)(payee_arg & (~1));
+ payee_arg_conv.is_owned = (payee_arg & 1) || (payee_arg == 0);
+ payee_arg_conv = Payee_clone(&payee_arg_conv);
+ LDKRouteParameters ret_var = RouteParameters_new(payee_arg_conv, final_value_msat_arg, final_cltv_expiry_delta_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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_RouteParameters_clone(uint32_t orig) {
+ LDKRouteParameters orig_conv;
+ orig_conv.inner = (void*)(orig & (~1));
+ orig_conv.is_owned = false;
+ LDKRouteParameters ret_var = RouteParameters_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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
+int8_tArray __attribute__((visibility("default"))) TS_RouteParameters_write(uint32_t obj) {
+ LDKRouteParameters obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z ret_var = RouteParameters_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_RouteParameters_read(int8_tArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = *((uint32_t*)ser);
+ ser_ref.data = (int8_t*)(ser + 4);
+ LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
+ *ret_conv = RouteParameters_read(ser_ref);
+ return (uint64_t)ret_conv;
+}
+
+void __attribute__((visibility("default"))) TS_Payee_free(uint32_t this_obj) {
+ LDKPayee this_obj_conv;
+ this_obj_conv.inner = (void*)(this_obj & (~1));
+ this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+ Payee_free(this_obj_conv);
+}
+
+int8_tArray __attribute__((visibility("default"))) TS_Payee_get_pubkey(uint32_t this_ptr) {
+ LDKPayee this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), Payee_get_pubkey(&this_ptr_conv).compressed_form, 33);
+ return ret_arr;
+}
+
+void __attribute__((visibility("default"))) TS_Payee_set_pubkey(uint32_t this_ptr, int8_tArray val) {
+ LDKPayee this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKPublicKey val_ref;
+ CHECK(*((uint32_t*)val) == 33);
+ memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33);
+ Payee_set_pubkey(&this_ptr_conv, val_ref);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_Payee_get_features(uint32_t this_ptr) {
+ LDKPayee this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKInvoiceFeatures ret_var = Payee_get_features(&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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ }
+ return ret_ref;
+}
+
+void __attribute__((visibility("default"))) TS_Payee_set_features(uint32_t this_ptr, uint32_t val) {
+ LDKPayee this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKInvoiceFeatures val_conv;
+ val_conv.inner = (void*)(val & (~1));
+ val_conv.is_owned = (val & 1) || (val == 0);
+ val_conv = InvoiceFeatures_clone(&val_conv);
+ Payee_set_features(&this_ptr_conv, val_conv);
+}
+
+uint32_tArray __attribute__((visibility("default"))) TS_Payee_get_route_hints(uint32_t this_ptr) {
+ LDKPayee this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKCVec_RouteHintZ ret_var = Payee_get_route_hints(&this_ptr_conv);
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
+ for (size_t l = 0; l < ret_var.datalen; l++) {
+ LDKRouteHint ret_conv_11_var = ret_var.data[l];
+ uint64_t ret_conv_11_ref = 0;
+ CHECK((((uint64_t)ret_conv_11_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&ret_conv_11_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ ret_conv_11_ref = (uint64_t)ret_conv_11_var.inner;
+ if (ret_conv_11_var.is_owned) {
+ ret_conv_11_ref |= 1;
+ }
+ ret_arr_ptr[l] = ret_conv_11_ref;
+ }
+
+ FREE(ret_var.data);
+ return ret_arr;
+}
+
+void __attribute__((visibility("default"))) TS_Payee_set_route_hints(uint32_t this_ptr, uint32_tArray val) {
+ LDKPayee this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKCVec_RouteHintZ val_constr;
+ val_constr.datalen = *((uint32_t*)val);
+ if (val_constr.datalen > 0)
+ val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
+ else
+ val_constr.data = NULL;
+ uint32_t* val_vals = (uint32_t*)(val + 4);
+ for (size_t l = 0; l < val_constr.datalen; l++) {
+ uint32_t val_conv_11 = val_vals[l];
+ LDKRouteHint val_conv_11_conv;
+ val_conv_11_conv.inner = (void*)(val_conv_11 & (~1));
+ val_conv_11_conv.is_owned = (val_conv_11 & 1) || (val_conv_11 == 0);
+ val_conv_11_conv = RouteHint_clone(&val_conv_11_conv);
+ val_constr.data[l] = val_conv_11_conv;
+ }
+ Payee_set_route_hints(&this_ptr_conv, val_constr);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_Payee_get_expiry_time(uint32_t this_ptr) {
+ LDKPayee this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
+ *ret_copy = Payee_get_expiry_time(&this_ptr_conv);
+ uint64_t ret_ref = (uint64_t)ret_copy;
+ return ret_ref;
+}
+
+void __attribute__((visibility("default"))) TS_Payee_set_expiry_time(uint32_t this_ptr, uint32_t val) {
+ LDKPayee this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
+ val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)val) & ~1));
+ Payee_set_expiry_time(&this_ptr_conv, val_conv);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_Payee_new(int8_tArray pubkey_arg, uint32_t features_arg, uint32_tArray route_hints_arg, uint32_t expiry_time_arg) {
+ LDKPublicKey pubkey_arg_ref;
+ CHECK(*((uint32_t*)pubkey_arg) == 33);
+ memcpy(pubkey_arg_ref.compressed_form, (uint8_t*)(pubkey_arg + 4), 33);
+ LDKInvoiceFeatures features_arg_conv;
+ features_arg_conv.inner = (void*)(features_arg & (~1));
+ features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0);
+ features_arg_conv = InvoiceFeatures_clone(&features_arg_conv);
+ LDKCVec_RouteHintZ route_hints_arg_constr;
+ route_hints_arg_constr.datalen = *((uint32_t*)route_hints_arg);
+ if (route_hints_arg_constr.datalen > 0)
+ route_hints_arg_constr.data = MALLOC(route_hints_arg_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
+ else
+ route_hints_arg_constr.data = NULL;
+ uint32_t* route_hints_arg_vals = (uint32_t*)(route_hints_arg + 4);
+ for (size_t l = 0; l < route_hints_arg_constr.datalen; l++) {
+ uint32_t route_hints_arg_conv_11 = route_hints_arg_vals[l];
+ LDKRouteHint route_hints_arg_conv_11_conv;
+ route_hints_arg_conv_11_conv.inner = (void*)(route_hints_arg_conv_11 & (~1));
+ route_hints_arg_conv_11_conv.is_owned = (route_hints_arg_conv_11 & 1) || (route_hints_arg_conv_11 == 0);
+ route_hints_arg_conv_11_conv = RouteHint_clone(&route_hints_arg_conv_11_conv);
+ route_hints_arg_constr.data[l] = route_hints_arg_conv_11_conv;
+ }
+ void* expiry_time_arg_ptr = (void*)(((uint64_t)expiry_time_arg) & ~1);
+ CHECK_ACCESS(expiry_time_arg_ptr);
+ LDKCOption_u64Z expiry_time_arg_conv = *(LDKCOption_u64Z*)(expiry_time_arg_ptr);
+ expiry_time_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)expiry_time_arg) & ~1));
+ LDKPayee ret_var = Payee_new(pubkey_arg_ref, features_arg_conv, route_hints_arg_constr, expiry_time_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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_Payee_clone(uint32_t orig) {
+ LDKPayee orig_conv;
+ orig_conv.inner = (void*)(orig & (~1));
+ orig_conv.is_owned = false;
+ LDKPayee ret_var = Payee_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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
+int64_t __attribute__((visibility("default"))) TS_Payee_hash(uint32_t o) {
+ LDKPayee o_conv;
+ o_conv.inner = (void*)(o & (~1));
+ o_conv.is_owned = false;
+ int64_t ret_val = Payee_hash(&o_conv);
+ return ret_val;
+}
+
+jboolean __attribute__((visibility("default"))) TS_Payee_eq(uint32_t a, uint32_t b) {
+ LDKPayee a_conv;
+ a_conv.inner = (void*)(a & (~1));
+ a_conv.is_owned = false;
+ LDKPayee b_conv;
+ b_conv.inner = (void*)(b & (~1));
+ b_conv.is_owned = false;
+ jboolean ret_val = Payee_eq(&a_conv, &b_conv);
+ return ret_val;
+}
+
+int8_tArray __attribute__((visibility("default"))) TS_Payee_write(uint32_t obj) {
+ LDKPayee obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z ret_var = Payee_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_Payee_read(int8_tArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = *((uint32_t*)ser);
+ ser_ref.data = (int8_t*)(ser + 4);
+ LDKCResult_PayeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeeDecodeErrorZ), "LDKCResult_PayeeDecodeErrorZ");
+ *ret_conv = Payee_read(ser_ref);
+ return (uint64_t)ret_conv;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_Payee_from_node_id(int8_tArray pubkey) {
+ LDKPublicKey pubkey_ref;
+ CHECK(*((uint32_t*)pubkey) == 33);
+ memcpy(pubkey_ref.compressed_form, (uint8_t*)(pubkey + 4), 33);
+ LDKPayee ret_var = Payee_from_node_id(pubkey_ref);
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_Payee_for_keysend(int8_tArray pubkey) {
+ LDKPublicKey pubkey_ref;
+ CHECK(*((uint32_t*)pubkey) == 33);
+ memcpy(pubkey_ref.compressed_form, (uint8_t*)(pubkey + 4), 33);
+ LDKPayee ret_var = Payee_for_keysend(pubkey_ref);
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
+void __attribute__((visibility("default"))) TS_RouteHint_free(uint32_t this_obj) {
+ LDKRouteHint this_obj_conv;
this_obj_conv.inner = (void*)(this_obj & (~1));
this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
RouteHint_free(this_obj_conv);
}
+uint32_tArray __attribute__((visibility("default"))) TS_RouteHint_get_a(uint32_t this_ptr) {
+ LDKRouteHint this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKCVec_RouteHintHopZ ret_var = RouteHint_get_a(&this_ptr_conv);
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
+ for (size_t o = 0; o < ret_var.datalen; o++) {
+ LDKRouteHintHop ret_conv_14_var = ret_var.data[o];
+ uint64_t ret_conv_14_ref = 0;
+ CHECK((((uint64_t)ret_conv_14_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&ret_conv_14_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ ret_conv_14_ref = (uint64_t)ret_conv_14_var.inner;
+ if (ret_conv_14_var.is_owned) {
+ ret_conv_14_ref |= 1;
+ }
+ ret_arr_ptr[o] = ret_conv_14_ref;
+ }
+
+ FREE(ret_var.data);
+ return ret_arr;
+}
+
+void __attribute__((visibility("default"))) TS_RouteHint_set_a(uint32_t this_ptr, uint32_tArray val) {
+ LDKRouteHint this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKCVec_RouteHintHopZ val_constr;
+ val_constr.datalen = *((uint32_t*)val);
+ if (val_constr.datalen > 0)
+ val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements");
+ else
+ val_constr.data = NULL;
+ uint32_t* val_vals = (uint32_t*)(val + 4);
+ for (size_t o = 0; o < val_constr.datalen; o++) {
+ uint32_t val_conv_14 = val_vals[o];
+ LDKRouteHintHop val_conv_14_conv;
+ val_conv_14_conv.inner = (void*)(val_conv_14 & (~1));
+ val_conv_14_conv.is_owned = (val_conv_14 & 1) || (val_conv_14 == 0);
+ val_conv_14_conv = RouteHintHop_clone(&val_conv_14_conv);
+ val_constr.data[o] = val_conv_14_conv;
+ }
+ RouteHint_set_a(&this_ptr_conv, val_constr);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_RouteHint_new(uint32_tArray a_arg) {
+ LDKCVec_RouteHintHopZ a_arg_constr;
+ a_arg_constr.datalen = *((uint32_t*)a_arg);
+ if (a_arg_constr.datalen > 0)
+ a_arg_constr.data = MALLOC(a_arg_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements");
+ else
+ a_arg_constr.data = NULL;
+ uint32_t* a_arg_vals = (uint32_t*)(a_arg + 4);
+ for (size_t o = 0; o < a_arg_constr.datalen; o++) {
+ uint32_t a_arg_conv_14 = a_arg_vals[o];
+ LDKRouteHintHop a_arg_conv_14_conv;
+ a_arg_conv_14_conv.inner = (void*)(a_arg_conv_14 & (~1));
+ a_arg_conv_14_conv.is_owned = (a_arg_conv_14 & 1) || (a_arg_conv_14 == 0);
+ a_arg_conv_14_conv = RouteHintHop_clone(&a_arg_conv_14_conv);
+ a_arg_constr.data[o] = a_arg_conv_14_conv;
+ }
+ LDKRouteHint ret_var = RouteHint_new(a_arg_constr);
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
uint32_t __attribute__((visibility("default"))) TS_RouteHint_clone(uint32_t orig) {
LDKRouteHint orig_conv;
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKRouteHint ret_var = RouteHint_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
return ret_val;
}
+int8_tArray __attribute__((visibility("default"))) TS_RouteHint_write(uint32_t obj) {
+ LDKRouteHint obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z ret_var = RouteHint_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_RouteHint_read(int8_tArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = *((uint32_t*)ser);
+ ser_ref.data = (int8_t*)(ser + 4);
+ LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
+ *ret_conv = RouteHint_read(ser_ref);
+ return (uint64_t)ret_conv;
+}
+
void __attribute__((visibility("default"))) TS_RouteHintHop_free(uint32_t this_obj) {
LDKRouteHintHop this_obj_conv;
this_obj_conv.inner = (void*)(this_obj & (~1));
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKRoutingFees ret_var = RouteHintHop_get_fees(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKCOption_u64Z htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_maximum_msat_arg_ptr);
htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)htlc_maximum_msat_arg) & ~1));
LDKRouteHintHop ret_var = RouteHintHop_new(src_node_id_arg_ref, short_channel_id_arg, fees_arg_conv, cltv_expiry_delta_arg, htlc_minimum_msat_arg_conv, htlc_maximum_msat_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKRouteHintHop ret_var = RouteHintHop_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
return ret_val;
}
-uint32_t __attribute__((visibility("default"))) TS_get_keysend_route(int8_tArray our_node_pubkey, uint32_t network, int8_tArray payee, uint32_tArray first_hops, uint32_tArray last_hops, int64_t final_value_msat, int32_t final_cltv, uint32_t logger, uint32_t scorer) {
- LDKPublicKey our_node_pubkey_ref;
- CHECK(*((uint32_t*)our_node_pubkey) == 33);
- memcpy(our_node_pubkey_ref.compressed_form, (uint8_t*)(our_node_pubkey + 4), 33);
- LDKNetworkGraph network_conv;
- network_conv.inner = (void*)(network & (~1));
- network_conv.is_owned = false;
- LDKPublicKey payee_ref;
- CHECK(*((uint32_t*)payee) == 33);
- memcpy(payee_ref.compressed_form, (uint8_t*)(payee + 4), 33);
- LDKCVec_ChannelDetailsZ first_hops_constr;
- LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL;
- if (first_hops != 0) {
- first_hops_constr.datalen = *((uint32_t*)first_hops);
- if (first_hops_constr.datalen > 0)
- first_hops_constr.data = MALLOC(first_hops_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
- else
- first_hops_constr.data = NULL;
- uint32_t* first_hops_vals = (uint32_t*)(first_hops + 4);
- for (size_t q = 0; q < first_hops_constr.datalen; q++) {
- uint32_t first_hops_conv_16 = first_hops_vals[q];
- LDKChannelDetails first_hops_conv_16_conv;
- first_hops_conv_16_conv.inner = (void*)(first_hops_conv_16 & (~1));
- first_hops_conv_16_conv.is_owned = (first_hops_conv_16 & 1) || (first_hops_conv_16 == 0);
- first_hops_constr.data[q] = first_hops_conv_16_conv;
- }
- first_hops_ptr = &first_hops_constr;
- }
- LDKCVec_RouteHintZ last_hops_constr;
- last_hops_constr.datalen = *((uint32_t*)last_hops);
- if (last_hops_constr.datalen > 0)
- last_hops_constr.data = MALLOC(last_hops_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
- else
- last_hops_constr.data = NULL;
- uint32_t* last_hops_vals = (uint32_t*)(last_hops + 4);
- for (size_t l = 0; l < last_hops_constr.datalen; l++) {
- uint32_t last_hops_conv_11 = last_hops_vals[l];
- LDKRouteHint last_hops_conv_11_conv;
- last_hops_conv_11_conv.inner = (void*)(last_hops_conv_11 & (~1));
- last_hops_conv_11_conv.is_owned = (last_hops_conv_11 & 1) || (last_hops_conv_11 == 0);
- last_hops_conv_11_conv = RouteHint_clone(&last_hops_conv_11_conv);
- last_hops_constr.data[l] = last_hops_conv_11_conv;
- }
- void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
- CHECK_ACCESS(logger_ptr);
- LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
- void* scorer_ptr = (void*)(((uint64_t)scorer) & ~1);
- 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 = get_keysend_route(our_node_pubkey_ref, &network_conv, payee_ref, first_hops_ptr, last_hops_constr, final_value_msat, final_cltv, logger_conv, scorer_conv);
- if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
+int8_tArray __attribute__((visibility("default"))) TS_RouteHintHop_write(uint32_t obj) {
+ LDKRouteHintHop obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z ret_var = RouteHintHop_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_RouteHintHop_read(int8_tArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = *((uint32_t*)ser);
+ ser_ref.data = (int8_t*)(ser + 4);
+ LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
+ *ret_conv = RouteHintHop_read(ser_ref);
return (uint64_t)ret_conv;
}
-uint32_t __attribute__((visibility("default"))) TS_get_route(int8_tArray our_node_pubkey, uint32_t network, int8_tArray payee, uint32_t payee_features, uint32_tArray first_hops, uint32_tArray last_hops, int64_t final_value_msat, int32_t final_cltv, uint32_t logger, uint32_t scorer) {
+uint32_t __attribute__((visibility("default"))) TS_find_route(int8_tArray our_node_pubkey, uint32_t params, uint32_t network, uint32_tArray first_hops, uint32_t logger, uint32_t scorer) {
LDKPublicKey our_node_pubkey_ref;
CHECK(*((uint32_t*)our_node_pubkey) == 33);
memcpy(our_node_pubkey_ref.compressed_form, (uint8_t*)(our_node_pubkey + 4), 33);
+ LDKRouteParameters params_conv;
+ params_conv.inner = (void*)(params & (~1));
+ params_conv.is_owned = false;
LDKNetworkGraph network_conv;
network_conv.inner = (void*)(network & (~1));
network_conv.is_owned = false;
- LDKPublicKey payee_ref;
- CHECK(*((uint32_t*)payee) == 33);
- memcpy(payee_ref.compressed_form, (uint8_t*)(payee + 4), 33);
- LDKInvoiceFeatures payee_features_conv;
- payee_features_conv.inner = (void*)(payee_features & (~1));
- payee_features_conv.is_owned = (payee_features & 1) || (payee_features == 0);
- payee_features_conv = InvoiceFeatures_clone(&payee_features_conv);
LDKCVec_ChannelDetailsZ first_hops_constr;
LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL;
if (first_hops != 0) {
}
first_hops_ptr = &first_hops_constr;
}
- LDKCVec_RouteHintZ last_hops_constr;
- last_hops_constr.datalen = *((uint32_t*)last_hops);
- if (last_hops_constr.datalen > 0)
- last_hops_constr.data = MALLOC(last_hops_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
- else
- last_hops_constr.data = NULL;
- uint32_t* last_hops_vals = (uint32_t*)(last_hops + 4);
- for (size_t l = 0; l < last_hops_constr.datalen; l++) {
- uint32_t last_hops_conv_11 = last_hops_vals[l];
- LDKRouteHint last_hops_conv_11_conv;
- last_hops_conv_11_conv.inner = (void*)(last_hops_conv_11 & (~1));
- last_hops_conv_11_conv.is_owned = (last_hops_conv_11 & 1) || (last_hops_conv_11 == 0);
- last_hops_conv_11_conv = RouteHint_clone(&last_hops_conv_11_conv);
- last_hops_constr.data[l] = last_hops_conv_11_conv;
- }
void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
CHECK_ACCESS(logger_ptr);
LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
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 = get_route(our_node_pubkey_ref, &network_conv, payee_ref, payee_features_conv, first_hops_ptr, last_hops_constr, final_value_msat, final_cltv, logger_conv, scorer_conv);
+ *ret_conv = find_route(our_node_pubkey_ref, ¶ms_conv, &network_conv, first_hops_ptr, logger_conv, scorer_conv);
if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
return (uint64_t)ret_conv;
}
Scorer_free(this_obj_conv);
}
-uint32_t __attribute__((visibility("default"))) TS_Scorer_new(int64_t base_penalty_msat) {
- LDKScorer ret_var = Scorer_new(base_penalty_msat);
+void __attribute__((visibility("default"))) TS_ScoringParameters_free(uint32_t this_obj) {
+ LDKScoringParameters this_obj_conv;
+ this_obj_conv.inner = (void*)(this_obj & (~1));
+ this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+ ScoringParameters_free(this_obj_conv);
+}
+
+int64_t __attribute__((visibility("default"))) TS_ScoringParameters_get_base_penalty_msat(uint32_t this_ptr) {
+ LDKScoringParameters this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ int64_t ret_val = ScoringParameters_get_base_penalty_msat(&this_ptr_conv);
+ return ret_val;
+}
+
+void __attribute__((visibility("default"))) TS_ScoringParameters_set_base_penalty_msat(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;
+ ScoringParameters_set_base_penalty_msat(&this_ptr_conv, val);
+}
+
+int64_t __attribute__((visibility("default"))) TS_ScoringParameters_get_failure_penalty_msat(uint32_t this_ptr) {
+ LDKScoringParameters this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ int64_t ret_val = ScoringParameters_get_failure_penalty_msat(&this_ptr_conv);
+ return ret_val;
+}
+
+void __attribute__((visibility("default"))) TS_ScoringParameters_set_failure_penalty_msat(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;
+ ScoringParameters_set_failure_penalty_msat(&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));
+ this_ptr_conv.is_owned = false;
+ int64_t ret_val = ScoringParameters_get_failure_penalty_half_life(&this_ptr_conv);
+ return ret_val;
+}
+
+void __attribute__((visibility("default"))) TS_ScoringParameters_set_failure_penalty_half_life(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;
+ 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);
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
+int8_tArray __attribute__((visibility("default"))) TS_ScoringParameters_write(uint32_t obj) {
+ LDKScoringParameters obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z ret_var = ScoringParameters_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_ScoringParameters_read(int8_tArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = *((uint32_t*)ser);
+ ser_ref.data = (int8_t*)(ser + 4);
+ LDKCResult_ScoringParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScoringParametersDecodeErrorZ), "LDKCResult_ScoringParametersDecodeErrorZ");
+ *ret_conv = ScoringParameters_read(ser_ref);
+ return (uint64_t)ret_conv;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_Scorer_new(uint32_t params) {
+ LDKScoringParameters params_conv;
+ params_conv.inner = (void*)(params & (~1));
+ params_conv.is_owned = (params & 1) || (params == 0);
+ // Warning: we need a move here but no clone is available for LDKScoringParameters
+ LDKScorer ret_var = Scorer_new(params_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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_Scorer_default() {
+ LDKScorer ret_var = Scorer_default();
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
return ret_ref;
}
-uint32_t __attribute__((visibility("default"))) TS_Scorer_default() {
- LDKScorer ret_var = Scorer_default();
+uint32_t __attribute__((visibility("default"))) TS_ScoringParameters_default() {
+ LDKScoringParameters ret_var = ScoringParameters_default();
+ 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKScorer this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKScore* ret_ret =MALLOC(sizeof(LDKScore), "LDKScore");
+ LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore");
*ret_ret = Scorer_as_Score(&this_arg_conv);
return (uint64_t)ret_ret;
}
+int8_tArray __attribute__((visibility("default"))) TS_Scorer_write(uint32_t obj) {
+ LDKScorer obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z ret_var = Scorer_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_Scorer_read(int8_tArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = *((uint32_t*)ser);
+ ser_ref.data = (int8_t*)(ser + 4);
+ LDKCResult_ScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScorerDecodeErrorZ), "LDKCResult_ScorerDecodeErrorZ");
+ *ret_conv = Scorer_read(ser_ref);
+ return (uint64_t)ret_conv;
+}
+
void __attribute__((visibility("default"))) TS_FilesystemPersister_free(uint32_t this_obj) {
LDKFilesystemPersister this_obj_conv;
this_obj_conv.inner = (void*)(this_obj & (~1));
uint32_t __attribute__((visibility("default"))) TS_FilesystemPersister_new(jstring path_to_channel_data) {
LDKStr path_to_channel_data_conv = str_ref_to_owned_c(path_to_channel_data);
LDKFilesystemPersister ret_var = FilesystemPersister_new(path_to_channel_data_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
LDKFilesystemPersister this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKPersist* ret_ret =MALLOC(sizeof(LDKPersist), "LDKPersist");
+ LDKPersist* ret_ret = MALLOC(sizeof(LDKPersist), "LDKPersist");
*ret_ret = FilesystemPersister_as_Persist(&this_arg_conv);
return (uint64_t)ret_ret;
}
CHECK_ACCESS(logger_ptr);
LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
LDKBackgroundProcessor ret_var = BackgroundProcessor_start(persister_conv, event_handler_conv, &chain_monitor_conv, &channel_manager_conv, net_graph_msg_handler_conv, &peer_manager_conv, logger_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKInvoice ret_var = Invoice_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKSignedRawInvoice ret_var = SignedRawInvoice_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKRawDataPart ret_var = RawInvoice_get_data(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKRawInvoice ret_var = RawInvoice_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKPositiveTimestamp ret_var = RawDataPart_get_timestamp(&this_ptr_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKRawDataPart ret_var = RawDataPart_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKPositiveTimestamp ret_var = PositiveTimestamp_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKSha256 ret_var = Sha256_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKDescription ret_var = Description_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
PayeePubKey_free(this_obj_conv);
}
+int8_tArray __attribute__((visibility("default"))) TS_PayeePubKey_get_a(uint32_t this_ptr) {
+ LDKPayeePubKey this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), PayeePubKey_get_a(&this_ptr_conv).compressed_form, 33);
+ return ret_arr;
+}
+
+void __attribute__((visibility("default"))) TS_PayeePubKey_set_a(uint32_t this_ptr, int8_tArray val) {
+ LDKPayeePubKey this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKPublicKey val_ref;
+ CHECK(*((uint32_t*)val) == 33);
+ memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33);
+ PayeePubKey_set_a(&this_ptr_conv, val_ref);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_PayeePubKey_new(int8_tArray a_arg) {
+ LDKPublicKey a_arg_ref;
+ CHECK(*((uint32_t*)a_arg) == 33);
+ memcpy(a_arg_ref.compressed_form, (uint8_t*)(a_arg + 4), 33);
+ LDKPayeePubKey ret_var = PayeePubKey_new(a_arg_ref);
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
uint32_t __attribute__((visibility("default"))) TS_PayeePubKey_clone(uint32_t orig) {
LDKPayeePubKey orig_conv;
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKPayeePubKey ret_var = PayeePubKey_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKExpiryTime ret_var = ExpiryTime_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
MinFinalCltvExpiry_free(this_obj_conv);
}
+int64_t __attribute__((visibility("default"))) TS_MinFinalCltvExpiry_get_a(uint32_t this_ptr) {
+ LDKMinFinalCltvExpiry this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ int64_t ret_val = MinFinalCltvExpiry_get_a(&this_ptr_conv);
+ return ret_val;
+}
+
+void __attribute__((visibility("default"))) TS_MinFinalCltvExpiry_set_a(uint32_t this_ptr, int64_t val) {
+ LDKMinFinalCltvExpiry this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ MinFinalCltvExpiry_set_a(&this_ptr_conv, val);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_MinFinalCltvExpiry_new(int64_t a_arg) {
+ LDKMinFinalCltvExpiry ret_var = MinFinalCltvExpiry_new(a_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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
uint32_t __attribute__((visibility("default"))) TS_MinFinalCltvExpiry_clone(uint32_t orig) {
LDKMinFinalCltvExpiry orig_conv;
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKMinFinalCltvExpiry ret_var = MinFinalCltvExpiry_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKInvoiceSignature ret_var = InvoiceSignature_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
LDKPrivateRoute ret_var = PrivateRoute_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKRawInvoice ret_var = SignedRawInvoice_raw_invoice(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKInvoiceSignature ret_var = SignedRawInvoice_signature(&this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKSha256 ret_var = RawInvoice_payment_hash(&this_arg_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKDescription ret_var = RawInvoice_description(&this_arg_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKPayeePubKey ret_var = RawInvoice_payee_pub_key(&this_arg_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKSha256 ret_var = RawInvoice_description_hash(&this_arg_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKExpiryTime ret_var = RawInvoice_expiry_time(&this_arg_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKMinFinalCltvExpiry ret_var = RawInvoice_min_final_cltv_expiry(&this_arg_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKInvoiceFeatures ret_var = RawInvoice_features(&this_arg_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCVec_PrivateRouteZ ret_var = RawInvoice_private_routes(&this_arg_conv);
- uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t o = 0; o < ret_var.datalen; o++) {
LDKPrivateRoute ret_conv_14_var = ret_var.data[o];
+ uint64_t ret_conv_14_ref = 0;
CHECK((((uint64_t)ret_conv_14_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_conv_14_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t ret_conv_14_ref = (uint64_t)ret_conv_14_var.inner;
+ ret_conv_14_ref = (uint64_t)ret_conv_14_var.inner;
if (ret_conv_14_var.is_owned) {
ret_conv_14_ref |= 1;
}
ret_arr_ptr[o] = ret_conv_14_ref;
}
+
FREE(ret_var.data);
return ret_arr;
}
this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
this_arg_conv = Invoice_clone(&this_arg_conv);
LDKSignedRawInvoice ret_var = Invoice_into_signed_raw(this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(ret_arr + 4), Invoice_payment_secret(&this_arg_conv).data, 32);
+ memcpy((uint8_t*)(ret_arr + 4), *Invoice_payment_secret(&this_arg_conv), 32);
return ret_arr;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKInvoiceFeatures ret_var = Invoice_features(&this_arg_conv);
- 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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
- if (ret_var.is_owned) {
- ret_ref |= 1;
+ 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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
}
return ret_ref;
}
return ret_val;
}
+jboolean __attribute__((visibility("default"))) TS_Invoice_is_expired(uint32_t this_arg) {
+ LDKInvoice this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ jboolean ret_val = Invoice_is_expired(&this_arg_conv);
+ return ret_val;
+}
+
int64_t __attribute__((visibility("default"))) TS_Invoice_min_final_cltv_expiry(uint32_t this_arg) {
LDKInvoice this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCVec_PrivateRouteZ ret_var = Invoice_private_routes(&this_arg_conv);
- uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t o = 0; o < ret_var.datalen; o++) {
LDKPrivateRoute ret_conv_14_var = ret_var.data[o];
+ uint64_t ret_conv_14_ref = 0;
CHECK((((uint64_t)ret_conv_14_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_conv_14_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t ret_conv_14_ref = (uint64_t)ret_conv_14_var.inner;
+ ret_conv_14_ref = (uint64_t)ret_conv_14_var.inner;
if (ret_conv_14_var.is_owned) {
ret_conv_14_ref |= 1;
}
ret_arr_ptr[o] = ret_conv_14_ref;
}
+
FREE(ret_var.data);
return ret_arr;
}
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCVec_RouteHintZ ret_var = Invoice_route_hints(&this_arg_conv);
- uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
+ uint32_tArray ret_arr = NULL;
+ ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t l = 0; l < ret_var.datalen; l++) {
LDKRouteHint ret_conv_11_var = ret_var.data[l];
+ uint64_t ret_conv_11_ref = 0;
CHECK((((uint64_t)ret_conv_11_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_conv_11_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- uint64_t ret_conv_11_ref = (uint64_t)ret_conv_11_var.inner;
+ ret_conv_11_ref = (uint64_t)ret_conv_11_var.inner;
if (ret_conv_11_var.is_owned) {
ret_conv_11_ref |= 1;
}
ret_arr_ptr[l] = ret_conv_11_ref;
}
+
FREE(ret_var.data);
return ret_arr;
}
return ret_conv;
}
-uint32_t __attribute__((visibility("default"))) TS_Invoice_amount_pico_btc(uint32_t this_arg) {
+uint32_t __attribute__((visibility("default"))) TS_Invoice_amount_milli_satoshis(uint32_t this_arg) {
LDKInvoice this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
- *ret_copy = Invoice_amount_pico_btc(&this_arg_conv);
+ *ret_copy = Invoice_amount_milli_satoshis(&this_arg_conv);
uint64_t ret_ref = (uint64_t)ret_copy;
return ret_ref;
}
this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
this_arg_conv = PrivateRoute_clone(&this_arg_conv);
LDKRouteHint ret_var = PrivateRoute_into_inner(this_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.
- uint64_t ret_ref = (uint64_t)ret_var.inner;
+ ret_ref = (uint64_t)ret_var.inner;
if (ret_var.is_owned) {
ret_ref |= 1;
}
return ret_conv;
}
+void __attribute__((visibility("default"))) TS_InvoicePayer_free(uint32_t this_obj) {
+ LDKInvoicePayer this_obj_conv;
+ this_obj_conv.inner = (void*)(this_obj & (~1));
+ this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+ InvoicePayer_free(this_obj_conv);
+}
+
+void __attribute__((visibility("default"))) TS_Payer_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);
+ LDKPayer this_ptr_conv = *(LDKPayer*)(this_ptr_ptr);
+ FREE((void*)this_ptr);
+ Payer_free(this_ptr_conv);
+}
+
+void __attribute__((visibility("default"))) TS_Router_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);
+ LDKRouter this_ptr_conv = *(LDKRouter*)(this_ptr_ptr);
+ FREE((void*)this_ptr);
+ Router_free(this_ptr_conv);
+}
+
+void __attribute__((visibility("default"))) TS_RetryAttempts_free(uint32_t this_obj) {
+ LDKRetryAttempts this_obj_conv;
+ this_obj_conv.inner = (void*)(this_obj & (~1));
+ this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+ RetryAttempts_free(this_obj_conv);
+}
+
+int64_t __attribute__((visibility("default"))) TS_RetryAttempts_get_a(uint32_t this_ptr) {
+ LDKRetryAttempts this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ int64_t ret_val = RetryAttempts_get_a(&this_ptr_conv);
+ return ret_val;
+}
+
+void __attribute__((visibility("default"))) TS_RetryAttempts_set_a(uint32_t this_ptr, int64_t val) {
+ LDKRetryAttempts this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ RetryAttempts_set_a(&this_ptr_conv, val);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_RetryAttempts_new(int64_t a_arg) {
+ LDKRetryAttempts ret_var = RetryAttempts_new(a_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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_RetryAttempts_clone(uint32_t orig) {
+ LDKRetryAttempts orig_conv;
+ orig_conv.inner = (void*)(orig & (~1));
+ orig_conv.is_owned = false;
+ LDKRetryAttempts ret_var = RetryAttempts_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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
+jboolean __attribute__((visibility("default"))) TS_RetryAttempts_eq(uint32_t a, uint32_t b) {
+ LDKRetryAttempts a_conv;
+ a_conv.inner = (void*)(a & (~1));
+ a_conv.is_owned = false;
+ LDKRetryAttempts b_conv;
+ b_conv.inner = (void*)(b & (~1));
+ b_conv.is_owned = false;
+ jboolean ret_val = RetryAttempts_eq(&a_conv, &b_conv);
+ return ret_val;
+}
+
+int64_t __attribute__((visibility("default"))) TS_RetryAttempts_hash(uint32_t o) {
+ LDKRetryAttempts o_conv;
+ o_conv.inner = (void*)(o & (~1));
+ o_conv.is_owned = false;
+ int64_t ret_val = RetryAttempts_hash(&o_conv);
+ return ret_val;
+}
+
+void __attribute__((visibility("default"))) TS_PaymentError_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);
+ LDKPaymentError this_ptr_conv = *(LDKPaymentError*)(this_ptr_ptr);
+ FREE((void*)this_ptr);
+ PaymentError_free(this_ptr_conv);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_PaymentError_clone(uint32_t orig) {
+ LDKPaymentError* orig_conv = (LDKPaymentError*)orig;
+ LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
+ *ret_copy = PaymentError_clone(orig_conv);
+ uint64_t ret_ref = (uint64_t)ret_copy;
+ return ret_ref;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_PaymentError_invoice(jstring a) {
+ LDKStr a_conv = str_ref_to_owned_c(a);
+ LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
+ *ret_copy = PaymentError_invoice(a_conv);
+ uint64_t ret_ref = (uint64_t)ret_copy;
+ return ret_ref;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_PaymentError_routing(uint32_t a) {
+ LDKLightningError a_conv;
+ a_conv.inner = (void*)(a & (~1));
+ a_conv.is_owned = (a & 1) || (a == 0);
+ a_conv = LightningError_clone(&a_conv);
+ LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
+ *ret_copy = PaymentError_routing(a_conv);
+ uint64_t ret_ref = (uint64_t)ret_copy;
+ return ret_ref;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_PaymentError_sending(uint32_t a) {
+ void* a_ptr = (void*)(((uint64_t)a) & ~1);
+ CHECK_ACCESS(a_ptr);
+ LDKPaymentSendFailure a_conv = *(LDKPaymentSendFailure*)(a_ptr);
+ a_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)(((uint64_t)a) & ~1));
+ LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
+ *ret_copy = PaymentError_sending(a_conv);
+ uint64_t ret_ref = (uint64_t)ret_copy;
+ return ret_ref;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_InvoicePayer_new(uint32_t payer, uint32_t router, uint32_t scorer, uint32_t logger, uint32_t event_handler, uint32_t retry_attempts) {
+ void* payer_ptr = (void*)(((uint64_t)payer) & ~1);
+ CHECK_ACCESS(payer_ptr);
+ LDKPayer payer_conv = *(LDKPayer*)(payer_ptr);
+ void* router_ptr = (void*)(((uint64_t)router) & ~1);
+ CHECK_ACCESS(router_ptr);
+ LDKRouter router_conv = *(LDKRouter*)(router_ptr);
+ LDKLockableScore scorer_conv;
+ scorer_conv.inner = (void*)(scorer & (~1));
+ scorer_conv.is_owned = false;
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
+ void* event_handler_ptr = (void*)(((uint64_t)event_handler) & ~1);
+ CHECK_ACCESS(event_handler_ptr);
+ LDKEventHandler event_handler_conv = *(LDKEventHandler*)(event_handler_ptr);
+ LDKRetryAttempts retry_attempts_conv;
+ retry_attempts_conv.inner = (void*)(retry_attempts & (~1));
+ retry_attempts_conv.is_owned = (retry_attempts & 1) || (retry_attempts == 0);
+ retry_attempts_conv = RetryAttempts_clone(&retry_attempts_conv);
+ LDKInvoicePayer ret_var = InvoicePayer_new(payer_conv, router_conv, &scorer_conv, logger_conv, event_handler_conv, retry_attempts_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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_InvoicePayer_pay_invoice(uint32_t this_arg, uint32_t invoice) {
+ LDKInvoicePayer this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ LDKInvoice invoice_conv;
+ invoice_conv.inner = (void*)(invoice & (~1));
+ invoice_conv.is_owned = false;
+ LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
+ *ret_conv = InvoicePayer_pay_invoice(&this_arg_conv, &invoice_conv);
+ return (uint64_t)ret_conv;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_InvoicePayer_pay_zero_value_invoice(uint32_t this_arg, uint32_t invoice, int64_t amount_msats) {
+ LDKInvoicePayer this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ LDKInvoice invoice_conv;
+ invoice_conv.inner = (void*)(invoice & (~1));
+ invoice_conv.is_owned = false;
+ LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
+ *ret_conv = InvoicePayer_pay_zero_value_invoice(&this_arg_conv, &invoice_conv, amount_msats);
+ 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));
+ this_arg_conv.is_owned = false;
+ 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;
+ InvoicePayer_remove_cached_payment(&this_arg_conv, payment_hash_ref);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_InvoicePayer_as_EventHandler(uint32_t this_arg) {
+ LDKInvoicePayer this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ LDKEventHandler* ret_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
+ *ret_ret = InvoicePayer_as_EventHandler(&this_arg_conv);
+ return (uint64_t)ret_ret;
+}
+
uint32_t __attribute__((visibility("default"))) TS_create_invoice_from_channelmanager(uint32_t channelmanager, uint32_t keys_manager, uint32_t network, uint32_t amt_msat, jstring description) {
LDKChannelManager channelmanager_conv;
channelmanager_conv.inner = (void*)(channelmanager & (~1));
return (uint64_t)ret_conv;
}
+void __attribute__((visibility("default"))) TS_DefaultRouter_free(uint32_t this_obj) {
+ LDKDefaultRouter this_obj_conv;
+ this_obj_conv.inner = (void*)(this_obj & (~1));
+ this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+ DefaultRouter_free(this_obj_conv);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_DefaultRouter_new(uint32_t network_graph, uint32_t logger) {
+ LDKNetworkGraph network_graph_conv;
+ network_graph_conv.inner = (void*)(network_graph & (~1));
+ network_graph_conv.is_owned = false;
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
+ LDKDefaultRouter ret_var = DefaultRouter_new(&network_graph_conv, logger_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.
+ ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_DefaultRouter_as_Router(uint32_t this_arg) {
+ LDKDefaultRouter this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ LDKRouter* ret_ret = MALLOC(sizeof(LDKRouter), "LDKRouter");
+ *ret_ret = DefaultRouter_as_Router(&this_arg_conv);
+ return (uint64_t)ret_ret;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_ChannelManager_as_Payer(uint32_t this_arg) {
+ LDKChannelManager this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ LDKPayer* ret_ret = MALLOC(sizeof(LDKPayer), "LDKPayer");
+ *ret_ret = ChannelManager_as_Payer(&this_arg_conv);
+ return (uint64_t)ret_ret;
+}
+
uint32_t __attribute__((visibility("default"))) TS_SiPrefix_from_str(jstring s) {
LDKStr s_conv = str_ref_to_owned_c(s);
LDKCResult_SiPrefixNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixNoneZ), "LDKCResult_SiPrefixNoneZ");
public static native boolean LDKCResult_RouteDecodeErrorZ_result_ok(long arg);
public static native number LDKCResult_RouteDecodeErrorZ_get_ok(long arg);
public static native number LDKCResult_RouteDecodeErrorZ_get_err(long arg);
+ public static native boolean LDKCResult_RouteParametersDecodeErrorZ_result_ok(long arg);
+ public static native number LDKCResult_RouteParametersDecodeErrorZ_get_ok(long arg);
+ public static native number LDKCResult_RouteParametersDecodeErrorZ_get_err(long arg);
+ public static native long LDKCVec_RouteHintZ_new(number[] elems);
public static class LDKCOption_u64Z {
private LDKCOption_u64Z() {}
export class Some extends LDKCOption_u64Z {
}
static { LDKCOption_u64Z.init(); }
public static native LDKCOption_u64Z LDKCOption_u64Z_ref_from_ptr(long ptr);
+ public static native boolean LDKCResult_PayeeDecodeErrorZ_result_ok(long arg);
+ public static native number LDKCResult_PayeeDecodeErrorZ_get_ok(long arg);
+ public static native number LDKCResult_PayeeDecodeErrorZ_get_err(long arg);
+ public static native long LDKCVec_RouteHintHopZ_new(number[] elems);
+ public static native boolean LDKCResult_RouteHintDecodeErrorZ_result_ok(long arg);
+ public static native number LDKCResult_RouteHintDecodeErrorZ_get_ok(long arg);
+ public static native number LDKCResult_RouteHintDecodeErrorZ_get_err(long arg);
+ public static native boolean LDKCResult_RouteHintHopDecodeErrorZ_result_ok(long arg);
+ public static native number LDKCResult_RouteHintHopDecodeErrorZ_get_ok(long arg);
+ public static native number LDKCResult_RouteHintHopDecodeErrorZ_get_err(long arg);
public static native long LDKCVec_ChannelDetailsZ_new(number[] elems);
- public static native long LDKCVec_RouteHintZ_new(number[] elems);
public static native boolean LDKCResult_RouteLightningErrorZ_result_ok(long arg);
public static native number LDKCResult_RouteLightningErrorZ_get_ok(long arg);
public static native number LDKCResult_RouteLightningErrorZ_get_err(long arg);
public number commitment_tx_confirmed;
CommitmentTxConfirmed(number commitment_tx_confirmed) { this.commitment_tx_confirmed = commitment_tx_confirmed; }
}
+ export class UpdateCompleted extends LDKMonitorEvent {
+ public number funding_txo;
+ public number monitor_update_id;
+ UpdateCompleted(number funding_txo, number monitor_update_id) { this.funding_txo = funding_txo; this.monitor_update_id = monitor_update_id; }
+ }
+ export class UpdateFailed extends LDKMonitorEvent {
+ public number update_failed;
+ UpdateFailed(number update_failed) { this.update_failed = update_failed; }
+ }
static native void init();
}
static { LDKMonitorEvent.init(); }
public static native boolean LDKCResult_InvoiceFeaturesDecodeErrorZ_result_ok(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 boolean LDKCResult_ScoringParametersDecodeErrorZ_result_ok(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 boolean LDKCResult_ScorerDecodeErrorZ_result_ok(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 boolean LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ_result_ok(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 boolean LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_result_ok(long arg);
public static native number[] LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_get_ok(long arg);
public static native IOError LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_get_err(long arg);
- public static native boolean LDKCResult_PaymentIdDecodeErrorZ_result_ok(long arg);
- public static native number LDKCResult_PaymentIdDecodeErrorZ_get_ok(long arg);
- public static native number LDKCResult_PaymentIdDecodeErrorZ_get_err(long arg);
public static class LDKCOption_u16Z {
private LDKCOption_u16Z() {}
export class Some extends LDKCOption_u16Z {
AllFailedRetrySafe(number[] all_failed_retry_safe) { this.all_failed_retry_safe = all_failed_retry_safe; }
}
export class PartialFailure extends LDKPaymentSendFailure {
- public number[] partial_failure;
- PartialFailure(number[] partial_failure) { this.partial_failure = partial_failure; }
+ public number[] results;
+ public number failed_paths_retry;
+ public Uint8Array payment_id;
+ PartialFailure(number[] results, number failed_paths_retry, Uint8Array payment_id) { this.results = results; this.failed_paths_retry = failed_paths_retry; this.payment_id = payment_id; }
}
static native void init();
}
static { LDKPaymentSendFailure.init(); }
public static native LDKPaymentSendFailure LDKPaymentSendFailure_ref_from_ptr(long ptr);
public static native boolean LDKCResult_PaymentIdPaymentSendFailureZ_result_ok(long arg);
- public static native number LDKCResult_PaymentIdPaymentSendFailureZ_get_ok(long arg);
+ public static native Uint8Array LDKCResult_PaymentIdPaymentSendFailureZ_get_ok(long arg);
public static native number LDKCResult_PaymentIdPaymentSendFailureZ_get_err(long arg);
public static native boolean LDKCResult_NonePaymentSendFailureZ_result_ok(long arg);
public static native void LDKCResult_NonePaymentSendFailureZ_get_ok(long arg);
const nativeResponseValue = wasm.C2Tuple_PaymentHashPaymentIdZ_get_a(tuple);
return decodeArray(nativeResponseValue);
}
- // struct LDKPaymentId C2Tuple_PaymentHashPaymentIdZ_get_b(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR tuple);
- export function C2Tuple_PaymentHashPaymentIdZ_get_b(tuple: number): number {
+ // struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentIdZ_get_b(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR tuple);
+ export function C2Tuple_PaymentHashPaymentIdZ_get_b(tuple: number): Uint8Array {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
const nativeResponseValue = wasm.C2Tuple_PaymentHashPaymentIdZ_get_b(tuple);
- return nativeResponseValue;
+ return decodeArray(nativeResponseValue);
}
public static native boolean LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_result_ok(long arg);
public static native number LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_ok(long arg);
public static native boolean LDKCResult_COption_TypeZDecodeErrorZ_result_ok(long arg);
public static native number LDKCResult_COption_TypeZDecodeErrorZ_get_ok(long arg);
public static native number LDKCResult_COption_TypeZDecodeErrorZ_get_err(long arg);
+ public static class LDKPaymentError {
+ private LDKPaymentError() {}
+ export class Invoice extends LDKPaymentError {
+ public String invoice;
+ Invoice(String invoice) { this.invoice = invoice; }
+ }
+ export class Routing extends LDKPaymentError {
+ public number routing;
+ Routing(number routing) { this.routing = routing; }
+ }
+ export class Sending extends LDKPaymentError {
+ public number sending;
+ Sending(number sending) { this.sending = sending; }
+ }
+ static native void init();
+ }
+ static { LDKPaymentError.init(); }
+ public static native LDKPaymentError LDKPaymentError_ref_from_ptr(long ptr);
+ public static native boolean LDKCResult_PaymentIdPaymentErrorZ_result_ok(long arg);
+ public static native Uint8Array LDKCResult_PaymentIdPaymentErrorZ_get_ok(long arg);
+ public static native number LDKCResult_PaymentIdPaymentErrorZ_get_err(long arg);
public static native boolean LDKCResult_SiPrefixNoneZ_result_ok(long arg);
public static native SiPrefix LDKCResult_SiPrefixNoneZ_get_ok(long arg);
public static native void LDKCResult_SiPrefixNoneZ_get_err(long arg);
PaymentReceived(Uint8Array payment_hash, number amt, number purpose) { this.payment_hash = payment_hash; this.amt = amt; this.purpose = purpose; }
}
export class PaymentSent extends LDKEvent {
+ public Uint8Array payment_id;
public Uint8Array payment_preimage;
public Uint8Array payment_hash;
- PaymentSent(Uint8Array payment_preimage, Uint8Array payment_hash) { this.payment_preimage = payment_preimage; this.payment_hash = payment_hash; }
+ public number fee_paid_msat;
+ PaymentSent(Uint8Array payment_id, Uint8Array payment_preimage, Uint8Array payment_hash, number fee_paid_msat) { this.payment_id = payment_id; this.payment_preimage = payment_preimage; this.payment_hash = payment_hash; this.fee_paid_msat = fee_paid_msat; }
}
export class PaymentPathFailed extends LDKEvent {
+ public Uint8Array payment_id;
public Uint8Array payment_hash;
public boolean rejected_by_dest;
public number network_update;
public boolean all_paths_failed;
public number[] path;
public number short_channel_id;
- PaymentPathFailed(Uint8Array payment_hash, boolean rejected_by_dest, number network_update, boolean all_paths_failed, number[] path, number short_channel_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; }
+ 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 PendingHTLCsForwardable extends LDKEvent {
public number time_forwardable;
}
static { LDKCOption_CVec_NetAddressZZ.init(); }
public static native LDKCOption_CVec_NetAddressZZ LDKCOption_CVec_NetAddressZZ_ref_from_ptr(long ptr);
- public static native boolean LDKCResult_NetAddressu8Z_result_ok(long arg);
- public static native number LDKCResult_NetAddressu8Z_get_ok(long arg);
- public static native number LDKCResult_NetAddressu8Z_get_err(long arg);
- public static native boolean LDKCResult_CResult_NetAddressu8ZDecodeErrorZ_result_ok(long arg);
- public static native number LDKCResult_CResult_NetAddressu8ZDecodeErrorZ_get_ok(long arg);
- public static native number LDKCResult_CResult_NetAddressu8ZDecodeErrorZ_get_err(long arg);
public static native boolean LDKCResult_NetAddressDecodeErrorZ_result_ok(long arg);
public static native number LDKCResult_NetAddressDecodeErrorZ_get_ok(long arg);
public static native number LDKCResult_NetAddressDecodeErrorZ_get_err(long arg);
// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START
export interface LDKPersist {
- persist_new_channel (id: number, data: number): number;
- update_persisted_channel (id: number, update: number, data: number): number;
+ persist_new_channel (channel_id: number, data: number, update_id: number): number;
+ update_persisted_channel (channel_id: number, update: number, data: number, update_id: number): number;
}
export function LDKPersist_new(impl: LDKPersist): number {
// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END
- // LDKCResult_NoneChannelMonitorUpdateErrZ Persist_persist_new_channel LDKPersist *NONNULL_PTR this_arg, struct LDKOutPoint id, const struct LDKChannelMonitor *NONNULL_PTR data
- export function Persist_persist_new_channel(this_arg: number, id: number, data: number): number {
+ // LDKCResult_NoneChannelMonitorUpdateErrZ Persist_persist_new_channel LDKPersist *NONNULL_PTR this_arg, struct LDKOutPoint channel_id, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id
+ export function Persist_persist_new_channel(this_arg: number, channel_id: number, data: number, update_id: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.Persist_persist_new_channel(this_arg, id, data);
+ const nativeResponseValue = wasm.Persist_persist_new_channel(this_arg, channel_id, data, update_id);
return nativeResponseValue;
}
- // LDKCResult_NoneChannelMonitorUpdateErrZ Persist_update_persisted_channel LDKPersist *NONNULL_PTR this_arg, struct LDKOutPoint id, const struct LDKChannelMonitorUpdate *NONNULL_PTR update, const struct LDKChannelMonitor *NONNULL_PTR data
- export function Persist_update_persisted_channel(this_arg: number, id: number, update: number, data: number): number {
+ // LDKCResult_NoneChannelMonitorUpdateErrZ Persist_update_persisted_channel LDKPersist *NONNULL_PTR this_arg, struct LDKOutPoint channel_id, const struct LDKChannelMonitorUpdate *NONNULL_PTR update, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id
+ export function Persist_update_persisted_channel(this_arg: number, channel_id: number, update: number, data: number, update_id: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.Persist_update_persisted_channel(this_arg, id, update, data);
+ const nativeResponseValue = wasm.Persist_update_persisted_channel(this_arg, channel_id, update, data, update_id);
return nativeResponseValue;
}
// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START
export interface LDKScore {
- channel_penalty_msat (short_channel_id: number): number;
+ channel_penalty_msat (short_channel_id: number, source: number, target: number): number;
+ payment_path_failed (path: number[], short_channel_id: number): void;
+ write (): Uint8Array;
}
export function LDKScore_new(impl: LDKScore): number {
// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END
- // uint64_t Score_channel_penalty_msat LDKScore *NONNULL_PTR this_arg, uint64_t short_channel_id
- export function Score_channel_penalty_msat(this_arg: number, short_channel_id: number): number {
+ // 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 {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.Score_channel_penalty_msat(this_arg, short_channel_id);
+ const nativeResponseValue = wasm.Score_channel_penalty_msat(this_arg, short_channel_id, source, target);
return nativeResponseValue;
}
+ // void Score_payment_path_failed LDKScore *NONNULL_PTR this_arg, struct LDKCVec_RouteHopZ path, uint64_t short_channel_id
+ export function Score_payment_path_failed(this_arg: number, path: number[], short_channel_id: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.Score_payment_path_failed(this_arg, path, short_channel_id);
+ // debug statements here
+ }
+ // LDKCVec_u8Z Score_write LDKScore *NONNULL_PTR this_arg
+ export function Score_write(this_arg: number): Uint8Array {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.Score_write(this_arg);
+ return decodeArray(nativeResponseValue);
+ }
}
static { LDKFallback.init(); }
public static native LDKFallback LDKFallback_ref_from_ptr(long ptr);
+
+
+
+// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START
+
+ export interface LDKPayer {
+ node_id (): Uint8Array;
+ first_hops (): number[];
+ send_payment (route: number, payment_hash: Uint8Array, payment_secret: Uint8Array): number;
+ retry_payment (route: number, payment_id: Uint8Array): number;
+ }
+
+ export function LDKPayer_new(impl: LDKPayer): number {
+ throw new Error('unimplemented'); // TODO: bind to WASM
+ }
+
+// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END
+
+
+ // LDKPublicKey Payer_node_id LDKPayer *NONNULL_PTR this_arg
+ export function Payer_node_id(this_arg: number): Uint8Array {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.Payer_node_id(this_arg);
+ return decodeArray(nativeResponseValue);
+ }
+ // LDKCVec_ChannelDetailsZ Payer_first_hops LDKPayer *NONNULL_PTR this_arg
+ export function Payer_first_hops(this_arg: number): number[] {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.Payer_first_hops(this_arg);
+ return nativeResponseValue;
+ }
+ // LDKCResult_PaymentIdPaymentSendFailureZ Payer_send_payment LDKPayer *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret
+ export function Payer_send_payment(this_arg: number, route: number, payment_hash: Uint8Array, payment_secret: Uint8Array): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.Payer_send_payment(this_arg, route, encodeArray(payment_hash), encodeArray(payment_secret));
+ 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) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.Payer_retry_payment(this_arg, route, encodeArray(payment_id));
+ return nativeResponseValue;
+ }
+
+
+
+// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START
+
+ export interface LDKRouter {
+ find_route (payer: Uint8Array, params: number, first_hops: number[], scorer: number): number;
+ }
+
+ export function LDKRouter_new(impl: LDKRouter): number {
+ throw new Error('unimplemented'); // TODO: bind to WASM
+ }
+
+// 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 {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.Router_find_route(this_arg, encodeArray(payer), params, first_hops, scorer);
+ return nativeResponseValue;
+ }
// struct LDKStr _ldk_get_compiled_version(void);
export function _ldk_get_compiled_version(): String {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.CResult_RouteDecodeErrorZ_clone(orig);
return nativeResponseValue;
}
+ // struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_ok(struct LDKRouteParameters o);
+ export function CResult_RouteParametersDecodeErrorZ_ok(o: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_RouteParametersDecodeErrorZ_ok(o);
+ return nativeResponseValue;
+ }
+ // struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_err(struct LDKDecodeError e);
+ export function CResult_RouteParametersDecodeErrorZ_err(e: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_RouteParametersDecodeErrorZ_err(e);
+ return nativeResponseValue;
+ }
+ // void CResult_RouteParametersDecodeErrorZ_free(struct LDKCResult_RouteParametersDecodeErrorZ _res);
+ export function CResult_RouteParametersDecodeErrorZ_free(_res: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_RouteParametersDecodeErrorZ_free(_res);
+ // debug statements here
+ }
+ // struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_clone(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR orig);
+ export function CResult_RouteParametersDecodeErrorZ_clone(orig: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_RouteParametersDecodeErrorZ_clone(orig);
+ return nativeResponseValue;
+ }
+ // void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res);
+ export function CVec_RouteHintZ_free(_res: number[]): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CVec_RouteHintZ_free(_res);
+ // debug statements here
+ }
// struct LDKCOption_u64Z COption_u64Z_some(uint64_t o);
export function COption_u64Z_some(o: number): number {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.COption_u64Z_clone(orig);
return nativeResponseValue;
}
- // void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res);
- export function CVec_ChannelDetailsZ_free(_res: number[]): void {
+ // struct LDKCResult_PayeeDecodeErrorZ CResult_PayeeDecodeErrorZ_ok(struct LDKPayee o);
+ export function CResult_PayeeDecodeErrorZ_ok(o: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.CVec_ChannelDetailsZ_free(_res);
+ const nativeResponseValue = wasm.CResult_PayeeDecodeErrorZ_ok(o);
+ return nativeResponseValue;
+ }
+ // struct LDKCResult_PayeeDecodeErrorZ CResult_PayeeDecodeErrorZ_err(struct LDKDecodeError e);
+ export function CResult_PayeeDecodeErrorZ_err(e: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_PayeeDecodeErrorZ_err(e);
+ return nativeResponseValue;
+ }
+ // void CResult_PayeeDecodeErrorZ_free(struct LDKCResult_PayeeDecodeErrorZ _res);
+ export function CResult_PayeeDecodeErrorZ_free(_res: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_PayeeDecodeErrorZ_free(_res);
// debug statements here
}
- // void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res);
- export function CVec_RouteHintZ_free(_res: number[]): void {
+ // struct LDKCResult_PayeeDecodeErrorZ CResult_PayeeDecodeErrorZ_clone(const struct LDKCResult_PayeeDecodeErrorZ *NONNULL_PTR orig);
+ export function CResult_PayeeDecodeErrorZ_clone(orig: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.CVec_RouteHintZ_free(_res);
+ const nativeResponseValue = wasm.CResult_PayeeDecodeErrorZ_clone(orig);
+ return nativeResponseValue;
+ }
+ // void CVec_RouteHintHopZ_free(struct LDKCVec_RouteHintHopZ _res);
+ export function CVec_RouteHintHopZ_free(_res: number[]): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CVec_RouteHintHopZ_free(_res);
+ // debug statements here
+ }
+ // struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_ok(struct LDKRouteHint o);
+ export function CResult_RouteHintDecodeErrorZ_ok(o: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_RouteHintDecodeErrorZ_ok(o);
+ return nativeResponseValue;
+ }
+ // struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_err(struct LDKDecodeError e);
+ export function CResult_RouteHintDecodeErrorZ_err(e: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_RouteHintDecodeErrorZ_err(e);
+ return nativeResponseValue;
+ }
+ // void CResult_RouteHintDecodeErrorZ_free(struct LDKCResult_RouteHintDecodeErrorZ _res);
+ export function CResult_RouteHintDecodeErrorZ_free(_res: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_RouteHintDecodeErrorZ_free(_res);
+ // debug statements here
+ }
+ // struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_clone(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR orig);
+ export function CResult_RouteHintDecodeErrorZ_clone(orig: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_RouteHintDecodeErrorZ_clone(orig);
+ return nativeResponseValue;
+ }
+ // struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_ok(struct LDKRouteHintHop o);
+ export function CResult_RouteHintHopDecodeErrorZ_ok(o: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_RouteHintHopDecodeErrorZ_ok(o);
+ return nativeResponseValue;
+ }
+ // struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_err(struct LDKDecodeError e);
+ export function CResult_RouteHintHopDecodeErrorZ_err(e: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_RouteHintHopDecodeErrorZ_err(e);
+ return nativeResponseValue;
+ }
+ // void CResult_RouteHintHopDecodeErrorZ_free(struct LDKCResult_RouteHintHopDecodeErrorZ _res);
+ export function CResult_RouteHintHopDecodeErrorZ_free(_res: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_RouteHintHopDecodeErrorZ_free(_res);
+ // debug statements here
+ }
+ // struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_clone(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR orig);
+ export function CResult_RouteHintHopDecodeErrorZ_clone(orig: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_RouteHintHopDecodeErrorZ_clone(orig);
+ return nativeResponseValue;
+ }
+ // void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res);
+ export function CVec_ChannelDetailsZ_free(_res: number[]): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CVec_ChannelDetailsZ_free(_res);
// debug statements here
}
// struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o);
const nativeResponseValue = wasm.CResult_InvoiceFeaturesDecodeErrorZ_free(_res);
// debug statements here
}
+ // 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_ScoringParametersDecodeErrorZ_ok(o);
+ return nativeResponseValue;
+ }
+ // 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_ScoringParametersDecodeErrorZ_err(e);
+ return nativeResponseValue;
+ }
+ // 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_ScoringParametersDecodeErrorZ_free(_res);
+ // debug statements here
+ }
+ // 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_ScorerDecodeErrorZ_ok(o);
+ return nativeResponseValue;
+ }
+ // 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_ScorerDecodeErrorZ_err(e);
+ return nativeResponseValue;
+ }
+ // 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_ScorerDecodeErrorZ_free(_res);
+ // debug statements here
+ }
// struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKDelayedPaymentOutputDescriptor o);
export function CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(o: number): number {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone(orig);
return nativeResponseValue;
}
- // struct LDKCResult_PaymentIdDecodeErrorZ CResult_PaymentIdDecodeErrorZ_ok(struct LDKPaymentId o);
- export function CResult_PaymentIdDecodeErrorZ_ok(o: number): number {
- if(!isWasmInitialized) {
- throw new Error("initializeWasm() must be awaited first!");
- }
- const nativeResponseValue = wasm.CResult_PaymentIdDecodeErrorZ_ok(o);
- return nativeResponseValue;
- }
- // struct LDKCResult_PaymentIdDecodeErrorZ CResult_PaymentIdDecodeErrorZ_err(struct LDKDecodeError e);
- export function CResult_PaymentIdDecodeErrorZ_err(e: number): number {
- if(!isWasmInitialized) {
- throw new Error("initializeWasm() must be awaited first!");
- }
- const nativeResponseValue = wasm.CResult_PaymentIdDecodeErrorZ_err(e);
- return nativeResponseValue;
- }
- // void CResult_PaymentIdDecodeErrorZ_free(struct LDKCResult_PaymentIdDecodeErrorZ _res);
- export function CResult_PaymentIdDecodeErrorZ_free(_res: number): void {
- if(!isWasmInitialized) {
- throw new Error("initializeWasm() must be awaited first!");
- }
- const nativeResponseValue = wasm.CResult_PaymentIdDecodeErrorZ_free(_res);
- // debug statements here
- }
- // struct LDKCResult_PaymentIdDecodeErrorZ CResult_PaymentIdDecodeErrorZ_clone(const struct LDKCResult_PaymentIdDecodeErrorZ *NONNULL_PTR orig);
- export function CResult_PaymentIdDecodeErrorZ_clone(orig: number): number {
- if(!isWasmInitialized) {
- throw new Error("initializeWasm() must be awaited first!");
- }
- const nativeResponseValue = wasm.CResult_PaymentIdDecodeErrorZ_clone(orig);
- return nativeResponseValue;
- }
// struct LDKCOption_u16Z COption_u16Z_some(uint16_t o);
export function COption_u16Z_some(o: number): number {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.CResult__u832APIErrorZ_clone(orig);
return nativeResponseValue;
}
- // struct LDKCResult_PaymentIdPaymentSendFailureZ CResult_PaymentIdPaymentSendFailureZ_ok(struct LDKPaymentId o);
- export function CResult_PaymentIdPaymentSendFailureZ_ok(o: number): number {
+ // struct LDKCResult_PaymentIdPaymentSendFailureZ CResult_PaymentIdPaymentSendFailureZ_ok(struct LDKThirtyTwoBytes o);
+ export function CResult_PaymentIdPaymentSendFailureZ_ok(o: Uint8Array): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.CResult_PaymentIdPaymentSendFailureZ_ok(o);
+ const nativeResponseValue = wasm.CResult_PaymentIdPaymentSendFailureZ_ok(encodeArray(o));
return nativeResponseValue;
}
// struct LDKCResult_PaymentIdPaymentSendFailureZ CResult_PaymentIdPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
const nativeResponseValue = wasm.C2Tuple_PaymentHashPaymentIdZ_clone(orig);
return nativeResponseValue;
}
- // struct LDKC2Tuple_PaymentHashPaymentIdZ C2Tuple_PaymentHashPaymentIdZ_new(struct LDKThirtyTwoBytes a, struct LDKPaymentId b);
- export function C2Tuple_PaymentHashPaymentIdZ_new(a: Uint8Array, b: number): number {
+ // struct LDKC2Tuple_PaymentHashPaymentIdZ C2Tuple_PaymentHashPaymentIdZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
+ export function C2Tuple_PaymentHashPaymentIdZ_new(a: Uint8Array, b: Uint8Array): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.C2Tuple_PaymentHashPaymentIdZ_new(encodeArray(a), b);
+ const nativeResponseValue = wasm.C2Tuple_PaymentHashPaymentIdZ_new(encodeArray(a), encodeArray(b));
return nativeResponseValue;
}
// void C2Tuple_PaymentHashPaymentIdZ_free(struct LDKC2Tuple_PaymentHashPaymentIdZ _res);
const nativeResponseValue = wasm.CResult_COption_TypeZDecodeErrorZ_clone(orig);
return nativeResponseValue;
}
+ // struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_ok(struct LDKThirtyTwoBytes o);
+ export function CResult_PaymentIdPaymentErrorZ_ok(o: Uint8Array): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_PaymentIdPaymentErrorZ_ok(encodeArray(o));
+ return nativeResponseValue;
+ }
+ // struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_err(struct LDKPaymentError e);
+ export function CResult_PaymentIdPaymentErrorZ_err(e: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_PaymentIdPaymentErrorZ_err(e);
+ return nativeResponseValue;
+ }
+ // void CResult_PaymentIdPaymentErrorZ_free(struct LDKCResult_PaymentIdPaymentErrorZ _res);
+ export function CResult_PaymentIdPaymentErrorZ_free(_res: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_PaymentIdPaymentErrorZ_free(_res);
+ // debug statements here
+ }
+ // struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_clone(const struct LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR orig);
+ export function CResult_PaymentIdPaymentErrorZ_clone(orig: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_PaymentIdPaymentErrorZ_clone(orig);
+ return nativeResponseValue;
+ }
// struct LDKCResult_SiPrefixNoneZ CResult_SiPrefixNoneZ_ok(enum LDKSiPrefix o);
export function CResult_SiPrefixNoneZ_ok(o: SiPrefix): number {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.COption_CVec_NetAddressZZ_clone(orig);
return nativeResponseValue;
}
- // struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_ok(struct LDKNetAddress o);
- export function CResult_NetAddressu8Z_ok(o: number): number {
+ // struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_ok(struct LDKNetAddress o);
+ export function CResult_NetAddressDecodeErrorZ_ok(o: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.CResult_NetAddressu8Z_ok(o);
+ const nativeResponseValue = wasm.CResult_NetAddressDecodeErrorZ_ok(o);
return nativeResponseValue;
}
- // struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_err(uint8_t e);
- export function CResult_NetAddressu8Z_err(e: number): number {
+ // struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_err(struct LDKDecodeError e);
+ export function CResult_NetAddressDecodeErrorZ_err(e: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.CResult_NetAddressu8Z_err(e);
+ const nativeResponseValue = wasm.CResult_NetAddressDecodeErrorZ_err(e);
return nativeResponseValue;
}
- // void CResult_NetAddressu8Z_free(struct LDKCResult_NetAddressu8Z _res);
- export function CResult_NetAddressu8Z_free(_res: number): void {
+ // void CResult_NetAddressDecodeErrorZ_free(struct LDKCResult_NetAddressDecodeErrorZ _res);
+ export function CResult_NetAddressDecodeErrorZ_free(_res: number): void {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.CResult_NetAddressu8Z_free(_res);
+ const nativeResponseValue = wasm.CResult_NetAddressDecodeErrorZ_free(_res);
// debug statements here
}
- // struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_clone(const struct LDKCResult_NetAddressu8Z *NONNULL_PTR orig);
- export function CResult_NetAddressu8Z_clone(orig: number): number {
+ // struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_clone(const struct LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR orig);
+ export function CResult_NetAddressDecodeErrorZ_clone(orig: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.CResult_NetAddressu8Z_clone(orig);
+ const nativeResponseValue = wasm.CResult_NetAddressDecodeErrorZ_clone(orig);
return nativeResponseValue;
}
- // struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(struct LDKCResult_NetAddressu8Z o);
- export function CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(o: number): number {
- if(!isWasmInitialized) {
- throw new Error("initializeWasm() must be awaited first!");
- }
- const nativeResponseValue = wasm.CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(o);
- return nativeResponseValue;
- }
- // struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_err(struct LDKDecodeError e);
- export function CResult_CResult_NetAddressu8ZDecodeErrorZ_err(e: number): number {
- if(!isWasmInitialized) {
- throw new Error("initializeWasm() must be awaited first!");
- }
- const nativeResponseValue = wasm.CResult_CResult_NetAddressu8ZDecodeErrorZ_err(e);
- return nativeResponseValue;
- }
- // void CResult_CResult_NetAddressu8ZDecodeErrorZ_free(struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ _res);
- export function CResult_CResult_NetAddressu8ZDecodeErrorZ_free(_res: number): void {
- if(!isWasmInitialized) {
- throw new Error("initializeWasm() must be awaited first!");
- }
- const nativeResponseValue = wasm.CResult_CResult_NetAddressu8ZDecodeErrorZ_free(_res);
- // debug statements here
- }
- // struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_clone(const struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ *NONNULL_PTR orig);
- export function CResult_CResult_NetAddressu8ZDecodeErrorZ_clone(orig: number): number {
- if(!isWasmInitialized) {
- throw new Error("initializeWasm() must be awaited first!");
- }
- const nativeResponseValue = wasm.CResult_CResult_NetAddressu8ZDecodeErrorZ_clone(orig);
- return nativeResponseValue;
- }
- // struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_ok(struct LDKNetAddress o);
- export function CResult_NetAddressDecodeErrorZ_ok(o: number): number {
- if(!isWasmInitialized) {
- throw new Error("initializeWasm() must be awaited first!");
- }
- const nativeResponseValue = wasm.CResult_NetAddressDecodeErrorZ_ok(o);
- return nativeResponseValue;
- }
- // struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_err(struct LDKDecodeError e);
- export function CResult_NetAddressDecodeErrorZ_err(e: number): number {
- if(!isWasmInitialized) {
- throw new Error("initializeWasm() must be awaited first!");
- }
- const nativeResponseValue = wasm.CResult_NetAddressDecodeErrorZ_err(e);
- return nativeResponseValue;
- }
- // void CResult_NetAddressDecodeErrorZ_free(struct LDKCResult_NetAddressDecodeErrorZ _res);
- export function CResult_NetAddressDecodeErrorZ_free(_res: number): void {
- if(!isWasmInitialized) {
- throw new Error("initializeWasm() must be awaited first!");
- }
- const nativeResponseValue = wasm.CResult_NetAddressDecodeErrorZ_free(_res);
- // debug statements here
- }
- // struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_clone(const struct LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR orig);
- export function CResult_NetAddressDecodeErrorZ_clone(orig: number): number {
- if(!isWasmInitialized) {
- throw new Error("initializeWasm() must be awaited first!");
- }
- const nativeResponseValue = wasm.CResult_NetAddressDecodeErrorZ_clone(orig);
- return nativeResponseValue;
- }
- // void CVec_UpdateAddHTLCZ_free(struct LDKCVec_UpdateAddHTLCZ _res);
- export function CVec_UpdateAddHTLCZ_free(_res: number[]): void {
+ // void CVec_UpdateAddHTLCZ_free(struct LDKCVec_UpdateAddHTLCZ _res);
+ export function CVec_UpdateAddHTLCZ_free(_res: number[]): void {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
const nativeResponseValue = wasm.Event_payment_received(encodeArray(payment_hash), amt, purpose);
return nativeResponseValue;
}
- // struct LDKEvent Event_payment_sent(struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_hash);
- export function Event_payment_sent(payment_preimage: Uint8Array, payment_hash: Uint8Array): number {
+ // struct LDKEvent Event_payment_sent(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z fee_paid_msat);
+ export function Event_payment_sent(payment_id: Uint8Array, payment_preimage: Uint8Array, payment_hash: Uint8Array, fee_paid_msat: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.Event_payment_sent(encodeArray(payment_preimage), encodeArray(payment_hash));
+ const nativeResponseValue = wasm.Event_payment_sent(encodeArray(payment_id), encodeArray(payment_preimage), encodeArray(payment_hash), fee_paid_msat);
return nativeResponseValue;
}
- // struct LDKEvent Event_payment_path_failed(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);
- export function Event_payment_path_failed(payment_hash: Uint8Array, rejected_by_dest: boolean, network_update: number, all_paths_failed: boolean, path: number[], short_channel_id: number): number {
+ // 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);
+ export function Event_payment_path_failed(payment_id: Uint8Array, payment_hash: Uint8Array, rejected_by_dest: boolean, network_update: number, all_paths_failed: boolean, path: number[], short_channel_id: number, retry: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.Event_payment_path_failed(encodeArray(payment_hash), rejected_by_dest, network_update, all_paths_failed, path, short_channel_id);
+ 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_pending_htlcs_forwardable(uint64_t time_forwardable);
const nativeResponseValue = wasm.FeeEstimator_free(this_ptr);
// debug statements here
}
+ // void MonitorUpdateId_free(struct LDKMonitorUpdateId this_obj);
+ export function MonitorUpdateId_free(this_obj: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.MonitorUpdateId_free(this_obj);
+ // debug statements here
+ }
+ // struct LDKMonitorUpdateId MonitorUpdateId_clone(const struct LDKMonitorUpdateId *NONNULL_PTR orig);
+ export function MonitorUpdateId_clone(orig: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.MonitorUpdateId_clone(orig);
+ return nativeResponseValue;
+ }
+ // uint64_t MonitorUpdateId_hash(const struct LDKMonitorUpdateId *NONNULL_PTR o);
+ export function MonitorUpdateId_hash(o: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.MonitorUpdateId_hash(o);
+ return nativeResponseValue;
+ }
+ // bool MonitorUpdateId_eq(const struct LDKMonitorUpdateId *NONNULL_PTR a, const struct LDKMonitorUpdateId *NONNULL_PTR b);
+ export function MonitorUpdateId_eq(a: number, b: number): boolean {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.MonitorUpdateId_eq(a, b);
+ return nativeResponseValue;
+ }
// void Persist_free(struct LDKPersist this_ptr);
export function Persist_free(this_ptr: number): void {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.ChainMonitor_list_monitors(this_arg);
return nativeResponseValue;
}
+ // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChainMonitor_channel_monitor_updated(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo, struct LDKMonitorUpdateId completed_update_id);
+ export function ChainMonitor_channel_monitor_updated(this_arg: number, funding_txo: number, completed_update_id: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.ChainMonitor_channel_monitor_updated(this_arg, funding_txo, completed_update_id);
+ return nativeResponseValue;
+ }
// struct LDKListen ChainMonitor_as_Listen(const struct LDKChainMonitor *NONNULL_PTR this_arg);
export function ChainMonitor_as_Listen(this_arg: number): number {
if(!isWasmInitialized) {
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 {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.MonitorUpdateError_get_a(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 {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.MonitorUpdateError_set_a(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 {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.MonitorUpdateError_new(a_arg);
+ return nativeResponseValue;
+ }
// struct LDKMonitorUpdateError MonitorUpdateError_clone(const struct LDKMonitorUpdateError *NONNULL_PTR orig);
export function MonitorUpdateError_clone(orig: number): number {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.MonitorEvent_commitment_tx_confirmed(a);
return nativeResponseValue;
}
+ // struct LDKMonitorEvent MonitorEvent_update_completed(struct LDKOutPoint funding_txo, uint64_t monitor_update_id);
+ export function MonitorEvent_update_completed(funding_txo: number, monitor_update_id: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.MonitorEvent_update_completed(funding_txo, monitor_update_id);
+ return nativeResponseValue;
+ }
+ // struct LDKMonitorEvent MonitorEvent_update_failed(struct LDKOutPoint a);
+ export function MonitorEvent_update_failed(a: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.MonitorEvent_update_failed(a);
+ return nativeResponseValue;
+ }
+ // struct LDKCVec_u8Z MonitorEvent_write(const struct LDKMonitorEvent *NONNULL_PTR obj);
+ export function MonitorEvent_write(obj: number): Uint8Array {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.MonitorEvent_write(obj);
+ return decodeArray(nativeResponseValue);
+ }
// void HTLCUpdate_free(struct LDKHTLCUpdate this_obj);
export function HTLCUpdate_free(this_obj: number): void {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.KeysManager_as_KeysInterface(this_arg);
return nativeResponseValue;
}
- // void PaymentId_free(struct LDKPaymentId this_obj);
- export function PaymentId_free(this_obj: number): void {
- if(!isWasmInitialized) {
- throw new Error("initializeWasm() must be awaited first!");
- }
- const nativeResponseValue = wasm.PaymentId_free(this_obj);
- // debug statements here
- }
- // uint64_t PaymentId_hash(const struct LDKPaymentId *NONNULL_PTR o);
- export function PaymentId_hash(o: number): number {
- if(!isWasmInitialized) {
- throw new Error("initializeWasm() must be awaited first!");
- }
- const nativeResponseValue = wasm.PaymentId_hash(o);
- return nativeResponseValue;
- }
- // struct LDKPaymentId PaymentId_clone(const struct LDKPaymentId *NONNULL_PTR orig);
- export function PaymentId_clone(orig: number): number {
- if(!isWasmInitialized) {
- throw new Error("initializeWasm() must be awaited first!");
- }
- const nativeResponseValue = wasm.PaymentId_clone(orig);
- return nativeResponseValue;
- }
- // bool PaymentId_eq(const struct LDKPaymentId *NONNULL_PTR a, const struct LDKPaymentId *NONNULL_PTR b);
- export function PaymentId_eq(a: number, b: number): boolean {
- if(!isWasmInitialized) {
- throw new Error("initializeWasm() must be awaited first!");
- }
- const nativeResponseValue = wasm.PaymentId_eq(a, b);
- return nativeResponseValue;
- }
- // struct LDKCVec_u8Z PaymentId_write(const struct LDKPaymentId *NONNULL_PTR obj);
- export function PaymentId_write(obj: number): Uint8Array {
- if(!isWasmInitialized) {
- throw new Error("initializeWasm() must be awaited first!");
- }
- const nativeResponseValue = wasm.PaymentId_write(obj);
- return decodeArray(nativeResponseValue);
- }
- // struct LDKCResult_PaymentIdDecodeErrorZ PaymentId_read(struct LDKu8slice ser);
- export function PaymentId_read(ser: Uint8Array): number {
- if(!isWasmInitialized) {
- throw new Error("initializeWasm() must be awaited first!");
- }
- const nativeResponseValue = wasm.PaymentId_read(encodeArray(ser));
- return nativeResponseValue;
- }
// void ChannelManager_free(struct LDKChannelManager this_obj);
export function ChannelManager_free(this_obj: number): void {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.PaymentSendFailure_all_failed_retry_safe(a);
return nativeResponseValue;
}
- // struct LDKPaymentSendFailure PaymentSendFailure_partial_failure(struct LDKCVec_CResult_NoneAPIErrorZZ a);
- export function PaymentSendFailure_partial_failure(a: number[]): number {
+ // struct LDKPaymentSendFailure PaymentSendFailure_partial_failure(struct LDKCVec_CResult_NoneAPIErrorZZ results, struct LDKRouteParameters failed_paths_retry, struct LDKThirtyTwoBytes payment_id);
+ export function PaymentSendFailure_partial_failure(results: number[], failed_paths_retry: number, payment_id: Uint8Array): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.PaymentSendFailure_partial_failure(a);
+ const nativeResponseValue = wasm.PaymentSendFailure_partial_failure(results, failed_paths_retry, encodeArray(payment_id));
return nativeResponseValue;
}
// MUST_USE_RES struct LDKChannelManager ChannelManager_new(struct LDKFeeEstimator fee_est, struct LDKWatch chain_monitor, struct LDKBroadcasterInterface tx_broadcaster, struct LDKLogger logger, struct LDKKeysInterface keys_manager, struct LDKUserConfig config, struct LDKChainParameters params);
const nativeResponseValue = wasm.ChannelManager_send_payment(this_arg, route, encodeArray(payment_hash), encodeArray(payment_secret));
return nativeResponseValue;
}
- // MUST_USE_RES struct LDKCResult_NonePaymentSendFailureZ ChannelManager_retry_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKPaymentId payment_id);
- export function ChannelManager_retry_payment(this_arg: number, route: number, payment_id: number): number {
+ // 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);
+ export function ChannelManager_retry_payment(this_arg: number, route: number, payment_id: Uint8Array): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.ChannelManager_retry_payment(this_arg, route, payment_id);
+ const nativeResponseValue = wasm.ChannelManager_retry_payment(this_arg, route, encodeArray(payment_id));
return nativeResponseValue;
}
// 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);
const nativeResponseValue = wasm.ChannelManager_get_our_node_id(this_arg);
return decodeArray(nativeResponseValue);
}
- // void ChannelManager_channel_monitor_updated(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKOutPoint *NONNULL_PTR funding_txo, uint64_t highest_applied_update_id);
- export function ChannelManager_channel_monitor_updated(this_arg: number, funding_txo: number, highest_applied_update_id: number): void {
- if(!isWasmInitialized) {
- throw new Error("initializeWasm() must be awaited first!");
- }
- const nativeResponseValue = wasm.ChannelManager_channel_monitor_updated(this_arg, funding_txo, highest_applied_update_id);
- // debug statements here
- }
// 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 {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.NetAddress_write(obj);
return decodeArray(nativeResponseValue);
}
- // struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ Result_read(struct LDKu8slice ser);
- export function Result_read(ser: Uint8Array): number {
- if(!isWasmInitialized) {
- throw new Error("initializeWasm() must be awaited first!");
- }
- const nativeResponseValue = wasm.Result_read(encodeArray(ser));
- return nativeResponseValue;
- }
// struct LDKCResult_NetAddressDecodeErrorZ NetAddress_read(struct LDKu8slice ser);
export function NetAddress_read(ser: Uint8Array): number {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.PeerManager_disconnect_by_node_id(this_arg, encodeArray(node_id), no_connection_possible);
// debug statements here
}
+ // void PeerManager_disconnect_all_peers(const struct LDKPeerManager *NONNULL_PTR this_arg);
+ export function PeerManager_disconnect_all_peers(this_arg: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.PeerManager_disconnect_all_peers(this_arg);
+ // debug statements here
+ }
// void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR this_arg);
export function PeerManager_timer_tick_occurred(this_arg: number): void {
if(!isWasmInitialized) {
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.NetGraphMsgHandler_free(this_obj);
// debug statements here
}
- // struct LDKNetworkGraph NetGraphMsgHandler_get_network_graph(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_ptr);
- export function NetGraphMsgHandler_get_network_graph(this_ptr: number): number {
- if(!isWasmInitialized) {
- throw new Error("initializeWasm() must be awaited first!");
- }
- const nativeResponseValue = wasm.NetGraphMsgHandler_get_network_graph(this_ptr);
- return nativeResponseValue;
- }
- // void NetGraphMsgHandler_set_network_graph(struct LDKNetGraphMsgHandler *NONNULL_PTR this_ptr, struct LDKNetworkGraph val);
- export function NetGraphMsgHandler_set_network_graph(this_ptr: number, val: number): void {
- if(!isWasmInitialized) {
- throw new Error("initializeWasm() must be awaited first!");
- }
- const nativeResponseValue = wasm.NetGraphMsgHandler_set_network_graph(this_ptr, val);
- // debug statements here
- }
- // MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_new(struct LDKNetworkGraph network_graph, struct LDKCOption_AccessZ chain_access, struct LDKLogger logger);
+ // MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKCOption_AccessZ chain_access, struct LDKLogger logger);
export function NetGraphMsgHandler_new(network_graph: number, chain_access: number, logger: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
const nativeResponseValue = wasm.Route_set_paths(this_ptr, val);
// debug statements here
}
- // MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_CVec_RouteHopZZ paths_arg);
- export function Route_new(paths_arg: number[][]): number {
+ // struct LDKPayee Route_get_payee(const struct LDKRoute *NONNULL_PTR this_ptr);
+ export function Route_get_payee(this_ptr: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.Route_get_payee(this_ptr);
+ return nativeResponseValue;
+ }
+ // void Route_set_payee(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKPayee val);
+ export function Route_set_payee(this_ptr: number, val: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.Route_set_payee(this_ptr, val);
+ // debug statements here
+ }
+ // MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_CVec_RouteHopZZ paths_arg, struct LDKPayee payee_arg);
+ export function Route_new(paths_arg: number[][], payee_arg: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.Route_new(paths_arg);
+ const nativeResponseValue = wasm.Route_new(paths_arg, payee_arg);
return nativeResponseValue;
}
// struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig);
const nativeResponseValue = wasm.Route_read(encodeArray(ser));
return nativeResponseValue;
}
- // void RouteHint_free(struct LDKRouteHint this_obj);
- export function RouteHint_free(this_obj: number): void {
+ // void RouteParameters_free(struct LDKRouteParameters this_obj);
+ export function RouteParameters_free(this_obj: number): void {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.RouteHint_free(this_obj);
+ const nativeResponseValue = wasm.RouteParameters_free(this_obj);
// debug statements here
}
- // struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
- export function RouteHint_clone(orig: number): number {
+ // struct LDKPayee RouteParameters_get_payee(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
+ export function RouteParameters_get_payee(this_ptr: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.RouteHint_clone(orig);
+ const nativeResponseValue = wasm.RouteParameters_get_payee(this_ptr);
return nativeResponseValue;
}
- // uint64_t RouteHint_hash(const struct LDKRouteHint *NONNULL_PTR o);
- export function RouteHint_hash(o: number): number {
+ // void RouteParameters_set_payee(struct LDKRouteParameters *NONNULL_PTR this_ptr, struct LDKPayee val);
+ export function RouteParameters_set_payee(this_ptr: number, val: number): void {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.RouteHint_hash(o);
- return nativeResponseValue;
+ const nativeResponseValue = wasm.RouteParameters_set_payee(this_ptr, val);
+ // debug statements here
}
- // bool RouteHint_eq(const struct LDKRouteHint *NONNULL_PTR a, const struct LDKRouteHint *NONNULL_PTR b);
- export function RouteHint_eq(a: number, b: number): boolean {
+ // uint64_t RouteParameters_get_final_value_msat(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
+ export function RouteParameters_get_final_value_msat(this_ptr: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.RouteHint_eq(a, b);
+ const nativeResponseValue = wasm.RouteParameters_get_final_value_msat(this_ptr);
return nativeResponseValue;
}
- // void RouteHintHop_free(struct LDKRouteHintHop this_obj);
- export function RouteHintHop_free(this_obj: number): void {
+ // void RouteParameters_set_final_value_msat(struct LDKRouteParameters *NONNULL_PTR this_ptr, uint64_t val);
+ export function RouteParameters_set_final_value_msat(this_ptr: number, val: number): void {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.RouteHintHop_free(this_obj);
+ const nativeResponseValue = wasm.RouteParameters_set_final_value_msat(this_ptr, val);
// debug statements here
}
- // struct LDKPublicKey RouteHintHop_get_src_node_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
- export function RouteHintHop_get_src_node_id(this_ptr: number): Uint8Array {
+ // uint32_t RouteParameters_get_final_cltv_expiry_delta(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
+ export function RouteParameters_get_final_cltv_expiry_delta(this_ptr: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.RouteHintHop_get_src_node_id(this_ptr);
- return decodeArray(nativeResponseValue);
+ const nativeResponseValue = wasm.RouteParameters_get_final_cltv_expiry_delta(this_ptr);
+ return nativeResponseValue;
}
- // void RouteHintHop_set_src_node_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
- export function RouteHintHop_set_src_node_id(this_ptr: number, val: Uint8Array): void {
+ // void RouteParameters_set_final_cltv_expiry_delta(struct LDKRouteParameters *NONNULL_PTR this_ptr, uint32_t val);
+ export function RouteParameters_set_final_cltv_expiry_delta(this_ptr: number, val: number): void {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.RouteHintHop_set_src_node_id(this_ptr, encodeArray(val));
+ const nativeResponseValue = wasm.RouteParameters_set_final_cltv_expiry_delta(this_ptr, val);
// debug statements here
}
- // uint64_t RouteHintHop_get_short_channel_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
- export function RouteHintHop_get_short_channel_id(this_ptr: number): number {
+ // MUST_USE_RES struct LDKRouteParameters RouteParameters_new(struct LDKPayee payee_arg, uint64_t final_value_msat_arg, uint32_t final_cltv_expiry_delta_arg);
+ export function RouteParameters_new(payee_arg: number, final_value_msat_arg: number, final_cltv_expiry_delta_arg: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.RouteHintHop_get_short_channel_id(this_ptr);
+ const nativeResponseValue = wasm.RouteParameters_new(payee_arg, final_value_msat_arg, final_cltv_expiry_delta_arg);
return nativeResponseValue;
}
- // void RouteHintHop_set_short_channel_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint64_t val);
- export function RouteHintHop_set_short_channel_id(this_ptr: number, val: number): void {
+ // struct LDKRouteParameters RouteParameters_clone(const struct LDKRouteParameters *NONNULL_PTR orig);
+ export function RouteParameters_clone(orig: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.RouteHintHop_set_short_channel_id(this_ptr, val);
- // debug statements here
+ const nativeResponseValue = wasm.RouteParameters_clone(orig);
+ return nativeResponseValue;
}
- // struct LDKRoutingFees RouteHintHop_get_fees(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
- export function RouteHintHop_get_fees(this_ptr: number): number {
+ // struct LDKCVec_u8Z RouteParameters_write(const struct LDKRouteParameters *NONNULL_PTR obj);
+ export function RouteParameters_write(obj: number): Uint8Array {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.RouteHintHop_get_fees(this_ptr);
+ const nativeResponseValue = wasm.RouteParameters_write(obj);
+ return decodeArray(nativeResponseValue);
+ }
+ // struct LDKCResult_RouteParametersDecodeErrorZ RouteParameters_read(struct LDKu8slice ser);
+ export function RouteParameters_read(ser: Uint8Array): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.RouteParameters_read(encodeArray(ser));
return nativeResponseValue;
}
- // void RouteHintHop_set_fees(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
- export function RouteHintHop_set_fees(this_ptr: number, val: number): void {
+ // void Payee_free(struct LDKPayee this_obj);
+ export function Payee_free(this_obj: number): void {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.RouteHintHop_set_fees(this_ptr, val);
+ const nativeResponseValue = wasm.Payee_free(this_obj);
// debug statements here
}
- // uint16_t RouteHintHop_get_cltv_expiry_delta(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
- export function RouteHintHop_get_cltv_expiry_delta(this_ptr: number): number {
+ // struct LDKPublicKey Payee_get_pubkey(const struct LDKPayee *NONNULL_PTR this_ptr);
+ export function Payee_get_pubkey(this_ptr: number): Uint8Array {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.RouteHintHop_get_cltv_expiry_delta(this_ptr);
- return nativeResponseValue;
+ const nativeResponseValue = wasm.Payee_get_pubkey(this_ptr);
+ return decodeArray(nativeResponseValue);
}
- // void RouteHintHop_set_cltv_expiry_delta(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint16_t val);
- export function RouteHintHop_set_cltv_expiry_delta(this_ptr: number, val: number): void {
+ // void Payee_set_pubkey(struct LDKPayee *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+ export function Payee_set_pubkey(this_ptr: number, val: Uint8Array): void {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.RouteHintHop_set_cltv_expiry_delta(this_ptr, val);
+ const nativeResponseValue = wasm.Payee_set_pubkey(this_ptr, encodeArray(val));
// debug statements here
}
- // struct LDKCOption_u64Z RouteHintHop_get_htlc_minimum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
- export function RouteHintHop_get_htlc_minimum_msat(this_ptr: number): number {
+ // struct LDKInvoiceFeatures Payee_get_features(const struct LDKPayee *NONNULL_PTR this_ptr);
+ export function Payee_get_features(this_ptr: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.RouteHintHop_get_htlc_minimum_msat(this_ptr);
+ const nativeResponseValue = wasm.Payee_get_features(this_ptr);
return nativeResponseValue;
}
- // void RouteHintHop_set_htlc_minimum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
- export function RouteHintHop_set_htlc_minimum_msat(this_ptr: number, val: number): void {
+ // void Payee_set_features(struct LDKPayee *NONNULL_PTR this_ptr, struct LDKInvoiceFeatures val);
+ export function Payee_set_features(this_ptr: number, val: number): void {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.RouteHintHop_set_htlc_minimum_msat(this_ptr, val);
+ const nativeResponseValue = wasm.Payee_set_features(this_ptr, val);
// debug statements here
}
- // struct LDKCOption_u64Z RouteHintHop_get_htlc_maximum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
- export function RouteHintHop_get_htlc_maximum_msat(this_ptr: number): number {
+ // struct LDKCVec_RouteHintZ Payee_get_route_hints(const struct LDKPayee *NONNULL_PTR this_ptr);
+ export function Payee_get_route_hints(this_ptr: number): number[] {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.RouteHintHop_get_htlc_maximum_msat(this_ptr);
+ const nativeResponseValue = wasm.Payee_get_route_hints(this_ptr);
return nativeResponseValue;
}
- // void RouteHintHop_set_htlc_maximum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
- export function RouteHintHop_set_htlc_maximum_msat(this_ptr: number, val: number): void {
+ // void Payee_set_route_hints(struct LDKPayee *NONNULL_PTR this_ptr, struct LDKCVec_RouteHintZ val);
+ export function Payee_set_route_hints(this_ptr: number, val: number[]): void {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.RouteHintHop_set_htlc_maximum_msat(this_ptr, val);
+ const nativeResponseValue = wasm.Payee_set_route_hints(this_ptr, val);
// debug statements here
}
- // MUST_USE_RES struct LDKRouteHintHop RouteHintHop_new(struct LDKPublicKey src_node_id_arg, uint64_t short_channel_id_arg, struct LDKRoutingFees fees_arg, uint16_t cltv_expiry_delta_arg, struct LDKCOption_u64Z htlc_minimum_msat_arg, struct LDKCOption_u64Z htlc_maximum_msat_arg);
- export function RouteHintHop_new(src_node_id_arg: Uint8Array, short_channel_id_arg: number, fees_arg: number, cltv_expiry_delta_arg: number, htlc_minimum_msat_arg: number, htlc_maximum_msat_arg: number): number {
+ // struct LDKCOption_u64Z Payee_get_expiry_time(const struct LDKPayee *NONNULL_PTR this_ptr);
+ export function Payee_get_expiry_time(this_ptr: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.RouteHintHop_new(encodeArray(src_node_id_arg), short_channel_id_arg, fees_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg);
+ const nativeResponseValue = wasm.Payee_get_expiry_time(this_ptr);
return nativeResponseValue;
}
- // struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_PTR orig);
- export function RouteHintHop_clone(orig: number): number {
+ // void Payee_set_expiry_time(struct LDKPayee *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
+ export function Payee_set_expiry_time(this_ptr: number, val: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.Payee_set_expiry_time(this_ptr, val);
+ // debug statements here
+ }
+ // MUST_USE_RES struct LDKPayee Payee_new(struct LDKPublicKey pubkey_arg, struct LDKInvoiceFeatures features_arg, struct LDKCVec_RouteHintZ route_hints_arg, struct LDKCOption_u64Z expiry_time_arg);
+ export function Payee_new(pubkey_arg: Uint8Array, features_arg: number, route_hints_arg: number[], expiry_time_arg: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.Payee_new(encodeArray(pubkey_arg), features_arg, route_hints_arg, expiry_time_arg);
+ return nativeResponseValue;
+ }
+ // struct LDKPayee Payee_clone(const struct LDKPayee *NONNULL_PTR orig);
+ export function Payee_clone(orig: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.Payee_clone(orig);
+ return nativeResponseValue;
+ }
+ // uint64_t Payee_hash(const struct LDKPayee *NONNULL_PTR o);
+ export function Payee_hash(o: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.Payee_hash(o);
+ return nativeResponseValue;
+ }
+ // bool Payee_eq(const struct LDKPayee *NONNULL_PTR a, const struct LDKPayee *NONNULL_PTR b);
+ export function Payee_eq(a: number, b: number): boolean {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.Payee_eq(a, b);
+ return nativeResponseValue;
+ }
+ // struct LDKCVec_u8Z Payee_write(const struct LDKPayee *NONNULL_PTR obj);
+ export function Payee_write(obj: number): Uint8Array {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.Payee_write(obj);
+ return decodeArray(nativeResponseValue);
+ }
+ // struct LDKCResult_PayeeDecodeErrorZ Payee_read(struct LDKu8slice ser);
+ export function Payee_read(ser: Uint8Array): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.Payee_read(encodeArray(ser));
+ return nativeResponseValue;
+ }
+ // MUST_USE_RES struct LDKPayee Payee_from_node_id(struct LDKPublicKey pubkey);
+ export function Payee_from_node_id(pubkey: Uint8Array): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.Payee_from_node_id(encodeArray(pubkey));
+ return nativeResponseValue;
+ }
+ // MUST_USE_RES struct LDKPayee Payee_for_keysend(struct LDKPublicKey pubkey);
+ export function Payee_for_keysend(pubkey: Uint8Array): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.Payee_for_keysend(encodeArray(pubkey));
+ return nativeResponseValue;
+ }
+ // void RouteHint_free(struct LDKRouteHint this_obj);
+ export function RouteHint_free(this_obj: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.RouteHint_free(this_obj);
+ // debug statements here
+ }
+ // struct LDKCVec_RouteHintHopZ RouteHint_get_a(const struct LDKRouteHint *NONNULL_PTR this_ptr);
+ export function RouteHint_get_a(this_ptr: number): number[] {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.RouteHint_get_a(this_ptr);
+ return nativeResponseValue;
+ }
+ // void RouteHint_set_a(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKCVec_RouteHintHopZ val);
+ export function RouteHint_set_a(this_ptr: number, val: number[]): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.RouteHint_set_a(this_ptr, val);
+ // debug statements here
+ }
+ // MUST_USE_RES struct LDKRouteHint RouteHint_new(struct LDKCVec_RouteHintHopZ a_arg);
+ export function RouteHint_new(a_arg: number[]): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.RouteHint_new(a_arg);
+ return nativeResponseValue;
+ }
+ // struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
+ export function RouteHint_clone(orig: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.RouteHint_clone(orig);
+ return nativeResponseValue;
+ }
+ // uint64_t RouteHint_hash(const struct LDKRouteHint *NONNULL_PTR o);
+ export function RouteHint_hash(o: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.RouteHint_hash(o);
+ return nativeResponseValue;
+ }
+ // bool RouteHint_eq(const struct LDKRouteHint *NONNULL_PTR a, const struct LDKRouteHint *NONNULL_PTR b);
+ export function RouteHint_eq(a: number, b: number): boolean {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.RouteHint_eq(a, b);
+ return nativeResponseValue;
+ }
+ // struct LDKCVec_u8Z RouteHint_write(const struct LDKRouteHint *NONNULL_PTR obj);
+ export function RouteHint_write(obj: number): Uint8Array {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.RouteHint_write(obj);
+ return decodeArray(nativeResponseValue);
+ }
+ // struct LDKCResult_RouteHintDecodeErrorZ RouteHint_read(struct LDKu8slice ser);
+ export function RouteHint_read(ser: Uint8Array): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.RouteHint_read(encodeArray(ser));
+ return nativeResponseValue;
+ }
+ // void RouteHintHop_free(struct LDKRouteHintHop this_obj);
+ export function RouteHintHop_free(this_obj: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.RouteHintHop_free(this_obj);
+ // debug statements here
+ }
+ // struct LDKPublicKey RouteHintHop_get_src_node_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
+ export function RouteHintHop_get_src_node_id(this_ptr: number): Uint8Array {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.RouteHintHop_get_src_node_id(this_ptr);
+ return decodeArray(nativeResponseValue);
+ }
+ // void RouteHintHop_set_src_node_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+ export function RouteHintHop_set_src_node_id(this_ptr: number, val: Uint8Array): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.RouteHintHop_set_src_node_id(this_ptr, encodeArray(val));
+ // debug statements here
+ }
+ // uint64_t RouteHintHop_get_short_channel_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
+ export function RouteHintHop_get_short_channel_id(this_ptr: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.RouteHintHop_get_short_channel_id(this_ptr);
+ return nativeResponseValue;
+ }
+ // void RouteHintHop_set_short_channel_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint64_t val);
+ export function RouteHintHop_set_short_channel_id(this_ptr: number, val: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.RouteHintHop_set_short_channel_id(this_ptr, val);
+ // debug statements here
+ }
+ // struct LDKRoutingFees RouteHintHop_get_fees(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
+ export function RouteHintHop_get_fees(this_ptr: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.RouteHintHop_get_fees(this_ptr);
+ return nativeResponseValue;
+ }
+ // void RouteHintHop_set_fees(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
+ export function RouteHintHop_set_fees(this_ptr: number, val: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.RouteHintHop_set_fees(this_ptr, val);
+ // debug statements here
+ }
+ // uint16_t RouteHintHop_get_cltv_expiry_delta(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
+ export function RouteHintHop_get_cltv_expiry_delta(this_ptr: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.RouteHintHop_get_cltv_expiry_delta(this_ptr);
+ return nativeResponseValue;
+ }
+ // void RouteHintHop_set_cltv_expiry_delta(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint16_t val);
+ export function RouteHintHop_set_cltv_expiry_delta(this_ptr: number, val: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.RouteHintHop_set_cltv_expiry_delta(this_ptr, val);
+ // debug statements here
+ }
+ // struct LDKCOption_u64Z RouteHintHop_get_htlc_minimum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
+ export function RouteHintHop_get_htlc_minimum_msat(this_ptr: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.RouteHintHop_get_htlc_minimum_msat(this_ptr);
+ return nativeResponseValue;
+ }
+ // void RouteHintHop_set_htlc_minimum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
+ export function RouteHintHop_set_htlc_minimum_msat(this_ptr: number, val: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.RouteHintHop_set_htlc_minimum_msat(this_ptr, val);
+ // debug statements here
+ }
+ // struct LDKCOption_u64Z RouteHintHop_get_htlc_maximum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
+ export function RouteHintHop_get_htlc_maximum_msat(this_ptr: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.RouteHintHop_get_htlc_maximum_msat(this_ptr);
+ return nativeResponseValue;
+ }
+ // void RouteHintHop_set_htlc_maximum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
+ export function RouteHintHop_set_htlc_maximum_msat(this_ptr: number, val: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.RouteHintHop_set_htlc_maximum_msat(this_ptr, val);
+ // debug statements here
+ }
+ // MUST_USE_RES struct LDKRouteHintHop RouteHintHop_new(struct LDKPublicKey src_node_id_arg, uint64_t short_channel_id_arg, struct LDKRoutingFees fees_arg, uint16_t cltv_expiry_delta_arg, struct LDKCOption_u64Z htlc_minimum_msat_arg, struct LDKCOption_u64Z htlc_maximum_msat_arg);
+ export function RouteHintHop_new(src_node_id_arg: Uint8Array, short_channel_id_arg: number, fees_arg: number, cltv_expiry_delta_arg: number, htlc_minimum_msat_arg: number, htlc_maximum_msat_arg: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.RouteHintHop_new(encodeArray(src_node_id_arg), short_channel_id_arg, fees_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg);
+ return nativeResponseValue;
+ }
+ // struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_PTR orig);
+ export function RouteHintHop_clone(orig: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
const nativeResponseValue = wasm.RouteHintHop_eq(a, b);
return nativeResponseValue;
}
- // struct LDKCResult_RouteLightningErrorZ get_keysend_route(struct LDKPublicKey our_node_pubkey, const struct LDKNetworkGraph *NONNULL_PTR network, struct LDKPublicKey payee, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKCVec_RouteHintZ last_hops, uint64_t final_value_msat, uint32_t final_cltv, struct LDKLogger logger, const struct LDKScore *NONNULL_PTR scorer);
- export function get_keysend_route(our_node_pubkey: Uint8Array, network: number, payee: Uint8Array, first_hops: number[], last_hops: number[], final_value_msat: number, final_cltv: number, logger: number, scorer: number): number {
+ // struct LDKCVec_u8Z RouteHintHop_write(const struct LDKRouteHintHop *NONNULL_PTR obj);
+ export function RouteHintHop_write(obj: number): Uint8Array {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.RouteHintHop_write(obj);
+ return decodeArray(nativeResponseValue);
+ }
+ // struct LDKCResult_RouteHintHopDecodeErrorZ RouteHintHop_read(struct LDKu8slice ser);
+ export function RouteHintHop_read(ser: Uint8Array): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.get_keysend_route(encodeArray(our_node_pubkey), network, encodeArray(payee), first_hops, last_hops, final_value_msat, final_cltv, logger, scorer);
+ const nativeResponseValue = wasm.RouteHintHop_read(encodeArray(ser));
return nativeResponseValue;
}
- // struct LDKCResult_RouteLightningErrorZ get_route(struct LDKPublicKey our_node_pubkey, const struct LDKNetworkGraph *NONNULL_PTR network, struct LDKPublicKey payee, struct LDKInvoiceFeatures payee_features, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKCVec_RouteHintZ last_hops, uint64_t final_value_msat, uint32_t final_cltv, struct LDKLogger logger, const struct LDKScore *NONNULL_PTR scorer);
- export function get_route(our_node_pubkey: Uint8Array, network: number, payee: Uint8Array, payee_features: number, first_hops: number[], last_hops: number[], final_value_msat: number, final_cltv: number, logger: number, scorer: number): number {
+ // 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);
+ export function find_route(our_node_pubkey: Uint8Array, params: number, network: number, first_hops: number[], logger: number, scorer: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.get_route(encodeArray(our_node_pubkey), network, encodeArray(payee), payee_features, first_hops, last_hops, final_value_msat, final_cltv, logger, scorer);
+ const nativeResponseValue = wasm.find_route(encodeArray(our_node_pubkey), params, network, first_hops, logger, scorer);
return nativeResponseValue;
}
// void Scorer_free(struct LDKScorer this_obj);
const nativeResponseValue = wasm.Scorer_free(this_obj);
// debug statements here
}
- // MUST_USE_RES struct LDKScorer Scorer_new(uint64_t base_penalty_msat);
- export function Scorer_new(base_penalty_msat: number): number {
+ // void ScoringParameters_free(struct LDKScoringParameters this_obj);
+ export function ScoringParameters_free(this_obj: number): void {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.Scorer_new(base_penalty_msat);
+ const nativeResponseValue = wasm.ScoringParameters_free(this_obj);
+ // debug statements here
+ }
+ // uint64_t ScoringParameters_get_base_penalty_msat(const struct LDKScoringParameters *NONNULL_PTR this_ptr);
+ export function ScoringParameters_get_base_penalty_msat(this_ptr: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.ScoringParameters_get_base_penalty_msat(this_ptr);
+ return nativeResponseValue;
+ }
+ // void ScoringParameters_set_base_penalty_msat(struct LDKScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
+ export function ScoringParameters_set_base_penalty_msat(this_ptr: number, val: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.ScoringParameters_set_base_penalty_msat(this_ptr, val);
+ // debug statements here
+ }
+ // uint64_t ScoringParameters_get_failure_penalty_msat(const struct LDKScoringParameters *NONNULL_PTR this_ptr);
+ export function ScoringParameters_get_failure_penalty_msat(this_ptr: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.ScoringParameters_get_failure_penalty_msat(this_ptr);
+ return nativeResponseValue;
+ }
+ // void ScoringParameters_set_failure_penalty_msat(struct LDKScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
+ export function ScoringParameters_set_failure_penalty_msat(this_ptr: number, val: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.ScoringParameters_set_failure_penalty_msat(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) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.ScoringParameters_get_failure_penalty_half_life(this_ptr);
+ return nativeResponseValue;
+ }
+ // void ScoringParameters_set_failure_penalty_half_life(struct LDKScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
+ export function ScoringParameters_set_failure_penalty_half_life(this_ptr: number, val: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ 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 {
+ 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);
+ return nativeResponseValue;
+ }
+ // struct LDKCVec_u8Z ScoringParameters_write(const struct LDKScoringParameters *NONNULL_PTR obj);
+ export function ScoringParameters_write(obj: number): Uint8Array {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.ScoringParameters_write(obj);
+ return decodeArray(nativeResponseValue);
+ }
+ // struct LDKCResult_ScoringParametersDecodeErrorZ ScoringParameters_read(struct LDKu8slice ser);
+ export function ScoringParameters_read(ser: Uint8Array): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.ScoringParameters_read(encodeArray(ser));
+ return nativeResponseValue;
+ }
+ // MUST_USE_RES struct LDKScorer Scorer_new(struct LDKScoringParameters params);
+ export function Scorer_new(params: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.Scorer_new(params);
return nativeResponseValue;
}
// MUST_USE_RES struct LDKScorer Scorer_default(void);
const nativeResponseValue = wasm.Scorer_default();
return nativeResponseValue;
}
+ // MUST_USE_RES struct LDKScoringParameters ScoringParameters_default(void);
+ export function ScoringParameters_default(): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.ScoringParameters_default();
+ return nativeResponseValue;
+ }
// struct LDKScore Scorer_as_Score(const struct LDKScorer *NONNULL_PTR this_arg);
export function Scorer_as_Score(this_arg: number): number {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.Scorer_as_Score(this_arg);
return nativeResponseValue;
}
+ // struct LDKCVec_u8Z Scorer_write(const struct LDKScorer *NONNULL_PTR obj);
+ export function Scorer_write(obj: number): Uint8Array {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.Scorer_write(obj);
+ return decodeArray(nativeResponseValue);
+ }
+ // struct LDKCResult_ScorerDecodeErrorZ Scorer_read(struct LDKu8slice ser);
+ export function Scorer_read(ser: Uint8Array): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.Scorer_read(encodeArray(ser));
+ return nativeResponseValue;
+ }
// void FilesystemPersister_free(struct LDKFilesystemPersister this_obj);
export function FilesystemPersister_free(this_obj: number): void {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.PayeePubKey_free(this_obj);
// debug statements here
}
+ // struct LDKPublicKey PayeePubKey_get_a(const struct LDKPayeePubKey *NONNULL_PTR this_ptr);
+ export function PayeePubKey_get_a(this_ptr: number): Uint8Array {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.PayeePubKey_get_a(this_ptr);
+ return decodeArray(nativeResponseValue);
+ }
+ // void PayeePubKey_set_a(struct LDKPayeePubKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+ export function PayeePubKey_set_a(this_ptr: number, val: Uint8Array): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.PayeePubKey_set_a(this_ptr, encodeArray(val));
+ // debug statements here
+ }
+ // MUST_USE_RES struct LDKPayeePubKey PayeePubKey_new(struct LDKPublicKey a_arg);
+ export function PayeePubKey_new(a_arg: Uint8Array): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.PayeePubKey_new(encodeArray(a_arg));
+ return nativeResponseValue;
+ }
// struct LDKPayeePubKey PayeePubKey_clone(const struct LDKPayeePubKey *NONNULL_PTR orig);
export function PayeePubKey_clone(orig: number): number {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.MinFinalCltvExpiry_free(this_obj);
// debug statements here
}
+ // uint64_t MinFinalCltvExpiry_get_a(const struct LDKMinFinalCltvExpiry *NONNULL_PTR this_ptr);
+ export function MinFinalCltvExpiry_get_a(this_ptr: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.MinFinalCltvExpiry_get_a(this_ptr);
+ return nativeResponseValue;
+ }
+ // void MinFinalCltvExpiry_set_a(struct LDKMinFinalCltvExpiry *NONNULL_PTR this_ptr, uint64_t val);
+ export function MinFinalCltvExpiry_set_a(this_ptr: number, val: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.MinFinalCltvExpiry_set_a(this_ptr, val);
+ // debug statements here
+ }
+ // MUST_USE_RES struct LDKMinFinalCltvExpiry MinFinalCltvExpiry_new(uint64_t a_arg);
+ export function MinFinalCltvExpiry_new(a_arg: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.MinFinalCltvExpiry_new(a_arg);
+ return nativeResponseValue;
+ }
// struct LDKMinFinalCltvExpiry MinFinalCltvExpiry_clone(const struct LDKMinFinalCltvExpiry *NONNULL_PTR orig);
export function MinFinalCltvExpiry_clone(orig: number): number {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.Invoice_payee_pub_key(this_arg);
return decodeArray(nativeResponseValue);
}
- // MUST_USE_RES struct LDKThirtyTwoBytes Invoice_payment_secret(const struct LDKInvoice *NONNULL_PTR this_arg);
+ // MUST_USE_RES const uint8_t (*Invoice_payment_secret(const struct LDKInvoice *NONNULL_PTR this_arg))[32];
export function Invoice_payment_secret(this_arg: number): Uint8Array {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
const nativeResponseValue = wasm.Invoice_expiry_time(this_arg);
return nativeResponseValue;
}
+ // MUST_USE_RES bool Invoice_is_expired(const struct LDKInvoice *NONNULL_PTR this_arg);
+ export function Invoice_is_expired(this_arg: number): boolean {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.Invoice_is_expired(this_arg);
+ return nativeResponseValue;
+ }
// MUST_USE_RES uint64_t Invoice_min_final_cltv_expiry(const struct LDKInvoice *NONNULL_PTR this_arg);
export function Invoice_min_final_cltv_expiry(this_arg: number): number {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.Invoice_currency(this_arg);
return nativeResponseValue;
}
- // MUST_USE_RES struct LDKCOption_u64Z Invoice_amount_pico_btc(const struct LDKInvoice *NONNULL_PTR this_arg);
- export function Invoice_amount_pico_btc(this_arg: number): number {
+ // MUST_USE_RES struct LDKCOption_u64Z Invoice_amount_milli_satoshis(const struct LDKInvoice *NONNULL_PTR this_arg);
+ export function Invoice_amount_milli_satoshis(this_arg: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.Invoice_amount_pico_btc(this_arg);
+ const nativeResponseValue = wasm.Invoice_amount_milli_satoshis(this_arg);
return nativeResponseValue;
}
// MUST_USE_RES struct LDKCResult_DescriptionCreationErrorZ Description_new(struct LDKStr description);
const nativeResponseValue = wasm.SignOrCreationError_to_str(o);
return nativeResponseValue;
}
+ // void InvoicePayer_free(struct LDKInvoicePayer this_obj);
+ export function InvoicePayer_free(this_obj: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.InvoicePayer_free(this_obj);
+ // debug statements here
+ }
+ // void Payer_free(struct LDKPayer this_ptr);
+ export function Payer_free(this_ptr: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.Payer_free(this_ptr);
+ // debug statements here
+ }
+ // void Router_free(struct LDKRouter this_ptr);
+ export function Router_free(this_ptr: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.Router_free(this_ptr);
+ // debug statements here
+ }
+ // void RetryAttempts_free(struct LDKRetryAttempts this_obj);
+ export function RetryAttempts_free(this_obj: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.RetryAttempts_free(this_obj);
+ // debug statements here
+ }
+ // uintptr_t RetryAttempts_get_a(const struct LDKRetryAttempts *NONNULL_PTR this_ptr);
+ export function RetryAttempts_get_a(this_ptr: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.RetryAttempts_get_a(this_ptr);
+ return nativeResponseValue;
+ }
+ // void RetryAttempts_set_a(struct LDKRetryAttempts *NONNULL_PTR this_ptr, uintptr_t val);
+ export function RetryAttempts_set_a(this_ptr: number, val: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.RetryAttempts_set_a(this_ptr, val);
+ // debug statements here
+ }
+ // MUST_USE_RES struct LDKRetryAttempts RetryAttempts_new(uintptr_t a_arg);
+ export function RetryAttempts_new(a_arg: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.RetryAttempts_new(a_arg);
+ return nativeResponseValue;
+ }
+ // struct LDKRetryAttempts RetryAttempts_clone(const struct LDKRetryAttempts *NONNULL_PTR orig);
+ export function RetryAttempts_clone(orig: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.RetryAttempts_clone(orig);
+ return nativeResponseValue;
+ }
+ // bool RetryAttempts_eq(const struct LDKRetryAttempts *NONNULL_PTR a, const struct LDKRetryAttempts *NONNULL_PTR b);
+ export function RetryAttempts_eq(a: number, b: number): boolean {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.RetryAttempts_eq(a, b);
+ return nativeResponseValue;
+ }
+ // uint64_t RetryAttempts_hash(const struct LDKRetryAttempts *NONNULL_PTR o);
+ export function RetryAttempts_hash(o: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.RetryAttempts_hash(o);
+ return nativeResponseValue;
+ }
+ // void PaymentError_free(struct LDKPaymentError this_ptr);
+ export function PaymentError_free(this_ptr: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.PaymentError_free(this_ptr);
+ // debug statements here
+ }
+ // struct LDKPaymentError PaymentError_clone(const struct LDKPaymentError *NONNULL_PTR orig);
+ export function PaymentError_clone(orig: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.PaymentError_clone(orig);
+ return nativeResponseValue;
+ }
+ // struct LDKPaymentError PaymentError_invoice(struct LDKStr a);
+ export function PaymentError_invoice(a: String): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.PaymentError_invoice(a);
+ return nativeResponseValue;
+ }
+ // struct LDKPaymentError PaymentError_routing(struct LDKLightningError a);
+ export function PaymentError_routing(a: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.PaymentError_routing(a);
+ return nativeResponseValue;
+ }
+ // struct LDKPaymentError PaymentError_sending(struct LDKPaymentSendFailure a);
+ export function PaymentError_sending(a: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ 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);
+ 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_new(payer, router, scorer, logger, event_handler, retry_attempts);
+ return nativeResponseValue;
+ }
+ // MUST_USE_RES struct LDKCResult_PaymentIdPaymentErrorZ InvoicePayer_pay_invoice(const struct LDKInvoicePayer *NONNULL_PTR this_arg, const struct LDKInvoice *NONNULL_PTR invoice);
+ export function InvoicePayer_pay_invoice(this_arg: number, invoice: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.InvoicePayer_pay_invoice(this_arg, invoice);
+ return nativeResponseValue;
+ }
+ // 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);
+ export function InvoicePayer_pay_zero_value_invoice(this_arg: number, invoice: number, amount_msats: 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;
+ }
+ // 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) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.InvoicePayer_remove_cached_payment(this_arg, encodeArray(payment_hash));
+ // debug statements here
+ }
+ // struct LDKEventHandler InvoicePayer_as_EventHandler(const struct LDKInvoicePayer *NONNULL_PTR this_arg);
+ export function InvoicePayer_as_EventHandler(this_arg: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.InvoicePayer_as_EventHandler(this_arg);
+ return nativeResponseValue;
+ }
// struct LDKCResult_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKKeysInterface keys_manager, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKStr description);
export function create_invoice_from_channelmanager(channelmanager: number, keys_manager: number, network: Currency, amt_msat: number, description: String): number {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.create_invoice_from_channelmanager(channelmanager, keys_manager, network, amt_msat, description);
return nativeResponseValue;
}
+ // void DefaultRouter_free(struct LDKDefaultRouter this_obj);
+ export function DefaultRouter_free(this_obj: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.DefaultRouter_free(this_obj);
+ // debug statements here
+ }
+ // MUST_USE_RES struct LDKDefaultRouter DefaultRouter_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger);
+ export function DefaultRouter_new(network_graph: number, logger: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.DefaultRouter_new(network_graph, logger);
+ return nativeResponseValue;
+ }
+ // struct LDKRouter DefaultRouter_as_Router(const struct LDKDefaultRouter *NONNULL_PTR this_arg);
+ export function DefaultRouter_as_Router(this_arg: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.DefaultRouter_as_Router(this_arg);
+ return nativeResponseValue;
+ }
+ // struct LDKPayer ChannelManager_as_Payer(const struct LDKChannelManager *NONNULL_PTR this_arg);
+ export function ChannelManager_as_Payer(this_arg: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.ChannelManager_as_Payer(this_arg);
+ return nativeResponseValue;
+ }
// struct LDKCResult_SiPrefixNoneZ SiPrefix_from_str(struct LDKStr s);
export function SiPrefix_from_str(s: String): number {
if(!isWasmInitialized) {
return ret_conv_10_arr;
}
+ public Result_NoneAPIErrorZ channel_monitor_updated(OutPoint funding_txo, MonitorUpdateId completed_update_id) {
+ number 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);
+ Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
public Listen as_Listen() {
number ret = bindings.ChainMonitor_as_Listen(this.ptr);
Listen ret_hu_conv = new Listen(null, ret);
return ret_hu_conv;
}
- public Result_NonePaymentSendFailureZ retry_payment(Route route, PaymentId payment_id) {
- number ret = bindings.ChannelManager_retry_payment(this.ptr, route == null ? 0 : route.ptr & ~1, payment_id == null ? 0 : payment_id.ptr & ~1);
+ public Result_NonePaymentSendFailureZ retry_payment(Route route, Uint8Array payment_id) {
+ number ret = bindings.ChannelManager_retry_payment(this.ptr, route == null ? 0 : route.ptr & ~1, payment_id);
Result_NonePaymentSendFailureZ ret_hu_conv = Result_NonePaymentSendFailureZ.constr_from_ptr(ret);
this.ptrs_to.add(route);
return ret_hu_conv;
return ret;
}
- public void channel_monitor_updated(OutPoint funding_txo, number highest_applied_update_id) {
- bindings.ChannelManager_channel_monitor_updated(this.ptr, funding_txo == null ? 0 : funding_txo.ptr & ~1, highest_applied_update_id);
- this.ptrs_to.add(funding_txo);
- }
-
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);
return ret;
}
+ public Payer as_Payer() {
+ number ret = bindings.ChannelManager_as_Payer(this.ptr);
+ Payer ret_hu_conv = new Payer(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 DefaultRouter extends CommonBase {
+ constructor(_dummy: object, ptr: number) {
+ super(ptr);
+ }
+
+
+ protected finalize() {
+ super.finalize();
+
+ if (this.ptr != 0) {
+ bindings.DefaultRouter_free(this.ptr);
+ }
+ }
+ public static DefaultRouter constructor_new(NetworkGraph network_graph, Logger logger) {
+ number ret = bindings.DefaultRouter_new(network_graph == null ? 0 : network_graph.ptr & ~1, logger == null ? 0 : logger.ptr);
+ const ret_hu_conv: DefaultRouter = new DefaultRouter(null, ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ ret_hu_conv.ptrs_to.add(network_graph);
+ ret_hu_conv.ptrs_to.add(logger);
+ return ret_hu_conv;
+ }
+
+ public Router as_Router() {
+ number ret = bindings.DefaultRouter_as_Router(this.ptr);
+ Router ret_hu_conv = new Router(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
+}
}
}
export class PaymentSent extends Event {
+ public payment_id: Uint8Array;
public payment_preimage: Uint8Array;
public payment_hash: Uint8Array;
+ public fee_paid_msat: Option_u64Z;
private constructor(ptr: number, obj: bindings.LDKEvent.PaymentSent) {
super(null, ptr);
+ this.payment_id = obj.payment_id;
this.payment_preimage = obj.payment_preimage;
this.payment_hash = obj.payment_hash;
+ const fee_paid_msat: number = obj.fee_paid_msat;
+ Option_u64Z fee_paid_msat_hu_conv = Option_u64Z.constr_from_ptr(fee_paid_msat);
+ fee_paid_msat_hu_conv.ptrs_to.add(this);
+ this.fee_paid_msat = fee_paid_msat_hu_conv;
}
}
export class PaymentPathFailed extends Event {
+ public payment_id: Uint8Array;
public payment_hash: Uint8Array;
public rejected_by_dest: boolean;
public network_update: Option_NetworkUpdateZ;
public all_paths_failed: boolean;
public path: RouteHop[];
public short_channel_id: Option_u64Z;
+ public retry: RouteParameters;
private constructor(ptr: number, obj: bindings.LDKEvent.PaymentPathFailed) {
super(null, ptr);
+ this.payment_id = obj.payment_id;
this.payment_hash = obj.payment_hash;
this.rejected_by_dest = obj.rejected_by_dest;
const network_update: number = obj.network_update;
Option_u64Z short_channel_id_hu_conv = Option_u64Z.constr_from_ptr(short_channel_id);
short_channel_id_hu_conv.ptrs_to.add(this);
this.short_channel_id = short_channel_id_hu_conv;
+ const retry: number = obj.retry;
+ const retry_hu_conv: RouteParameters = new RouteParameters(null, retry);
+ retry_hu_conv.ptrs_to.add(this);
+ this.retry = retry_hu_conv;
}
}
export class PendingHTLCsForwardable extends Event {
return ret_hu_conv;
}
- public static Event constructor_payment_sent(Uint8Array payment_preimage, Uint8Array payment_hash) {
- number ret = bindings.Event_payment_sent(payment_preimage, payment_hash);
+ public static Event constructor_payment_sent(Uint8Array payment_id, Uint8Array payment_preimage, Uint8Array payment_hash, Option_u64Z fee_paid_msat) {
+ number ret = bindings.Event_payment_sent(payment_id, payment_preimage, payment_hash, fee_paid_msat.ptr);
Event ret_hu_conv = Event.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
return ret_hu_conv;
}
- public static Event constructor_payment_path_failed(Uint8Array payment_hash, boolean rejected_by_dest, Option_NetworkUpdateZ network_update, boolean all_paths_failed, RouteHop[] path, Option_u64Z short_channel_id) {
- number ret = bindings.Event_payment_path_failed(payment_hash, rejected_by_dest, network_update.ptr, all_paths_failed, 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.ptr);
+ public static Event constructor_payment_path_failed(Uint8Array payment_id, Uint8Array payment_hash, boolean rejected_by_dest, Option_NetworkUpdateZ network_update, boolean all_paths_failed, RouteHop[] path, Option_u64Z short_channel_id, RouteParameters retry) {
+ number ret = bindings.Event_payment_path_failed(payment_id, payment_hash, rejected_by_dest, network_update.ptr, all_paths_failed, 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.ptr, retry == null ? 0 : retry.ptr & ~1);
Event ret_hu_conv = Event.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
return ret_hu_conv;
return ret;
}
+ public boolean is_expired() {
+ boolean ret = bindings.Invoice_is_expired(this.ptr);
+ return ret;
+ }
+
public number min_final_cltv_expiry() {
number ret = bindings.Invoice_min_final_cltv_expiry(this.ptr);
return ret;
return ret;
}
- public Option_u64Z amount_pico_btc() {
- number ret = bindings.Invoice_amount_pico_btc(this.ptr);
+ public Option_u64Z amount_milli_satoshis() {
+ number ret = bindings.Invoice_amount_milli_satoshis(this.ptr);
Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(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 InvoicePayer extends CommonBase {
+ constructor(_dummy: object, ptr: number) {
+ super(ptr);
+ }
+
+
+ protected finalize() {
+ super.finalize();
+
+ if (this.ptr != 0) {
+ bindings.InvoicePayer_free(this.ptr);
+ }
+ }
+ public static InvoicePayer constructor_new(Payer payer, Router router, LockableScore 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);
+ ret_hu_conv.ptrs_to.add(payer);
+ ret_hu_conv.ptrs_to.add(router);
+ ret_hu_conv.ptrs_to.add(scorer);
+ ret_hu_conv.ptrs_to.add(logger);
+ ret_hu_conv.ptrs_to.add(event_handler);
+ return ret_hu_conv;
+ }
+
+ public Result_PaymentIdPaymentErrorZ pay_invoice(Invoice invoice) {
+ number ret = bindings.InvoicePayer_pay_invoice(this.ptr, invoice == null ? 0 : invoice.ptr & ~1);
+ Result_PaymentIdPaymentErrorZ ret_hu_conv = Result_PaymentIdPaymentErrorZ.constr_from_ptr(ret);
+ this.ptrs_to.add(invoice);
+ return ret_hu_conv;
+ }
+
+ public Result_PaymentIdPaymentErrorZ pay_zero_value_invoice(Invoice invoice, number amount_msats) {
+ number ret = bindings.InvoicePayer_pay_zero_value_invoice(this.ptr, invoice == null ? 0 : invoice.ptr & ~1, amount_msats);
+ Result_PaymentIdPaymentErrorZ ret_hu_conv = Result_PaymentIdPaymentErrorZ.constr_from_ptr(ret);
+ this.ptrs_to.add(invoice);
+ return ret_hu_conv;
+ }
+
+ public void remove_cached_payment(Uint8Array payment_hash) {
+ bindings.InvoicePayer_remove_cached_payment(this.ptr, payment_hash);
+ }
+
+ public EventHandler as_EventHandler() {
+ number ret = bindings.InvoicePayer_as_EventHandler(this.ptr);
+ EventHandler ret_hu_conv = new EventHandler(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 LockableScore extends CommonBase {
+ constructor(_dummy: object, ptr: number) {
+ super(ptr);
+ }
+
+
+ protected finalize() {
+ super.finalize();
+
+ if (this.ptr != 0) {
+ bindings.LockableScore_free(this.ptr);
+ }
+ }
+ 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;
+ }
+
+}
bindings.MinFinalCltvExpiry_free(this.ptr);
}
}
+ public number get_a() {
+ number ret = bindings.MinFinalCltvExpiry_get_a(this.ptr);
+ return ret;
+ }
+
+ public void set_a(number val) {
+ bindings.MinFinalCltvExpiry_set_a(this.ptr, val);
+ }
+
+ public static MinFinalCltvExpiry constructor_new(number a_arg) {
+ number ret = bindings.MinFinalCltvExpiry_new(a_arg);
+ const ret_hu_conv: MinFinalCltvExpiry = new MinFinalCltvExpiry(null, ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ return ret_hu_conv;
+ }
+
public MinFinalCltvExpiry clone() {
number ret = bindings.MinFinalCltvExpiry_clone(this.ptr);
const ret_hu_conv: MinFinalCltvExpiry = new MinFinalCltvExpiry(null, ret);
if (raw_val instanceof bindings.LDKMonitorEvent.CommitmentTxConfirmed) {
return new CommitmentTxConfirmed(this.ptr, raw_val);
}
+ if (raw_val instanceof bindings.LDKMonitorEvent.UpdateCompleted) {
+ return new UpdateCompleted(this.ptr, raw_val);
+ }
+ if (raw_val instanceof bindings.LDKMonitorEvent.UpdateFailed) {
+ return new UpdateFailed(this.ptr, raw_val);
+ }
throw new Error('oops, this should be unreachable'); // Unreachable without extending the (internal) bindings interface
}
commitment_tx_confirmed_hu_conv.ptrs_to.add(this);
this.commitment_tx_confirmed = commitment_tx_confirmed_hu_conv;
}
+}
+export class UpdateCompleted extends MonitorEvent {
+ public funding_txo: OutPoint;
+ public monitor_update_id: number;
+ private constructor(ptr: number, obj: bindings.LDKMonitorEvent.UpdateCompleted) {
+ super(null, ptr);
+ const funding_txo: number = obj.funding_txo;
+ const funding_txo_hu_conv: OutPoint = new OutPoint(null, funding_txo);
+ funding_txo_hu_conv.ptrs_to.add(this);
+ this.funding_txo = funding_txo_hu_conv;
+ this.monitor_update_id = obj.monitor_update_id;
+ }
+}
+export class UpdateFailed extends MonitorEvent {
+ public update_failed: OutPoint;
+ private constructor(ptr: number, obj: bindings.LDKMonitorEvent.UpdateFailed) {
+ super(null, ptr);
+ const update_failed: number = obj.update_failed;
+ const update_failed_hu_conv: OutPoint = new OutPoint(null, update_failed);
+ update_failed_hu_conv.ptrs_to.add(this);
+ this.update_failed = update_failed_hu_conv;
+ }
}
public MonitorEvent clone() {
number ret = bindings.MonitorEvent_clone(this.ptr);
return ret_hu_conv;
}
+ public static MonitorEvent constructor_update_completed(OutPoint funding_txo, number monitor_update_id) {
+ number ret = bindings.MonitorEvent_update_completed(funding_txo == null ? 0 : funding_txo.ptr & ~1, monitor_update_id);
+ MonitorEvent ret_hu_conv = MonitorEvent.constr_from_ptr(ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ return ret_hu_conv;
+ }
+
+ public static MonitorEvent constructor_update_failed(OutPoint a) {
+ number ret = bindings.MonitorEvent_update_failed(a == null ? 0 : a.ptr & ~1);
+ MonitorEvent ret_hu_conv = MonitorEvent.constr_from_ptr(ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ return ret_hu_conv;
+ }
+
+ public Uint8Array write() {
+ Uint8Array ret = bindings.MonitorEvent_write(this.ptr);
+ return ret;
+ }
+
}
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 MonitorUpdateError clone() {
number ret = bindings.MonitorUpdateError_clone(this.ptr);
const ret_hu_conv: MonitorUpdateError = new MonitorUpdateError(null, ret);
--- /dev/null
+
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+
+
+ export default class MonitorUpdateId extends CommonBase {
+ constructor(_dummy: object, ptr: number) {
+ super(ptr);
+ }
+
+
+ protected finalize() {
+ super.finalize();
+
+ if (this.ptr != 0) {
+ bindings.MonitorUpdateId_free(this.ptr);
+ }
+ }
+ public MonitorUpdateId clone() {
+ number ret = bindings.MonitorUpdateId_clone(this.ptr);
+ const ret_hu_conv: MonitorUpdateId = new MonitorUpdateId(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
+ public number hash() {
+ number ret = bindings.MonitorUpdateId_hash(this.ptr);
+ return ret;
+ }
+
+ public boolean eq(MonitorUpdateId b) {
+ boolean ret = bindings.MonitorUpdateId_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
+ this.ptrs_to.add(b);
+ return ret;
+ }
+
+}
return ret_hu_conv;
}
- public NetworkGraph get_network_graph() {
- number ret = bindings.NetGraphMsgHandler_get_network_graph(this.ptr);
- const ret_hu_conv: NetworkGraph = new NetworkGraph(null, ret);
- ret_hu_conv.ptrs_to.add(this);
- return ret_hu_conv;
- }
-
- public void set_network_graph(NetworkGraph val) {
- bindings.NetGraphMsgHandler_set_network_graph(this.ptr, val == null ? 0 : val.ptr & ~1);
- }
-
public static NetGraphMsgHandler constructor_new(NetworkGraph network_graph, Option_AccessZ chain_access, Logger logger) {
number ret = bindings.NetGraphMsgHandler_new(network_graph == null ? 0 : network_graph.ptr & ~1, chain_access.ptr, logger == null ? 0 : logger.ptr);
const ret_hu_conv: NetGraphMsgHandler = new NetGraphMsgHandler(null, ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ ret_hu_conv.ptrs_to.add(network_graph);
ret_hu_conv.ptrs_to.add(logger);
return ret_hu_conv;
}
--- /dev/null
+
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+
+
+ export default class Payee extends CommonBase {
+ constructor(_dummy: object, ptr: number) {
+ super(ptr);
+ }
+
+
+ protected finalize() {
+ super.finalize();
+
+ if (this.ptr != 0) {
+ bindings.Payee_free(this.ptr);
+ }
+ }
+ public Uint8Array get_pubkey() {
+ Uint8Array ret = bindings.Payee_get_pubkey(this.ptr);
+ return ret;
+ }
+
+ public void set_pubkey(Uint8Array val) {
+ bindings.Payee_set_pubkey(this.ptr, val);
+ }
+
+ public InvoiceFeatures get_features() {
+ number ret = bindings.Payee_get_features(this.ptr);
+ const ret_hu_conv: InvoiceFeatures = new InvoiceFeatures(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
+ public void set_features(InvoiceFeatures val) {
+ bindings.Payee_set_features(this.ptr, val == null ? 0 : val.ptr & ~1);
+ }
+
+ public RouteHint[] get_route_hints() {
+ number[] ret = bindings.Payee_get_route_hints(this.ptr);
+ RouteHint[] ret_conv_11_arr = new RouteHint[ret.length];
+ for (int l = 0; l < ret.length; l++) {
+ number ret_conv_11 = ret[l];
+ const ret_conv_11_hu_conv: RouteHint = new RouteHint(null, ret_conv_11);
+ ret_conv_11_hu_conv.ptrs_to.add(this);
+ ret_conv_11_arr[l] = ret_conv_11_hu_conv;
+ }
+ return ret_conv_11_arr;
+ }
+
+ public void set_route_hints(RouteHint[] val) {
+ bindings.Payee_set_route_hints(this.ptr, val != null ? Arrays.stream(val).map(val_conv_11 -> val_conv_11 == null ? 0 : val_conv_11.ptr & ~1).toArray(number[]::new) : null);
+ }
+
+ public Option_u64Z get_expiry_time() {
+ number ret = bindings.Payee_get_expiry_time(this.ptr);
+ Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
+ public void set_expiry_time(Option_u64Z val) {
+ bindings.Payee_set_expiry_time(this.ptr, val.ptr);
+ }
+
+ public static Payee constructor_new(Uint8Array pubkey_arg, InvoiceFeatures features_arg, RouteHint[] route_hints_arg, Option_u64Z expiry_time_arg) {
+ number ret = bindings.Payee_new(pubkey_arg, features_arg == null ? 0 : features_arg.ptr & ~1, route_hints_arg != null ? Arrays.stream(route_hints_arg).map(route_hints_arg_conv_11 -> route_hints_arg_conv_11 == null ? 0 : route_hints_arg_conv_11.ptr & ~1).toArray(number[]::new) : null, expiry_time_arg.ptr);
+ const ret_hu_conv: Payee = new Payee(null, ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ return ret_hu_conv;
+ }
+
+ public Payee clone() {
+ number ret = bindings.Payee_clone(this.ptr);
+ const ret_hu_conv: Payee = new Payee(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
+ public number hash() {
+ number ret = bindings.Payee_hash(this.ptr);
+ return ret;
+ }
+
+ public boolean eq(Payee b) {
+ boolean ret = bindings.Payee_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
+ this.ptrs_to.add(b);
+ return ret;
+ }
+
+ public Uint8Array write() {
+ Uint8Array ret = bindings.Payee_write(this.ptr);
+ return ret;
+ }
+
+ public static Result_PayeeDecodeErrorZ constructor_read(Uint8Array ser) {
+ number ret = bindings.Payee_read(ser);
+ Result_PayeeDecodeErrorZ ret_hu_conv = Result_PayeeDecodeErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ public static Payee constructor_from_node_id(Uint8Array pubkey) {
+ number ret = bindings.Payee_from_node_id(pubkey);
+ const ret_hu_conv: Payee = new Payee(null, ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ return ret_hu_conv;
+ }
+
+ public static Payee constructor_for_keysend(Uint8Array pubkey) {
+ number ret = bindings.Payee_for_keysend(pubkey);
+ const ret_hu_conv: Payee = new Payee(null, ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ return ret_hu_conv;
+ }
+
+}
bindings.PayeePubKey_free(this.ptr);
}
}
+ public Uint8Array get_a() {
+ Uint8Array ret = bindings.PayeePubKey_get_a(this.ptr);
+ return ret;
+ }
+
+ public void set_a(Uint8Array val) {
+ bindings.PayeePubKey_set_a(this.ptr, val);
+ }
+
+ public static PayeePubKey constructor_new(Uint8Array a_arg) {
+ number ret = bindings.PayeePubKey_new(a_arg);
+ const ret_hu_conv: PayeePubKey = new PayeePubKey(null, ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ return ret_hu_conv;
+ }
+
public PayeePubKey clone() {
number ret = bindings.PayeePubKey_clone(this.ptr);
const ret_hu_conv: PayeePubKey = new PayeePubKey(null, ret);
--- /dev/null
+
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+
+
+ export class Payer extends CommonBase {
+
+ bindings_instance?: bindings.LDKPayer;
+
+ constructor(ptr?: number, arg?: bindings.LDKPayer) {
+ if (Number.isFinite(ptr)) {
+ super(ptr);
+ this.bindings_instance = null;
+ } else {
+ // TODO: private constructor instantiation
+ super(bindings.LDKPayer_new(arg));
+ this.ptrs_to.push(arg);
+
+ }
+ }
+
+ protected finalize() {
+ if (this.ptr != 0) {
+ bindings.Payer_free(this.ptr);
+ }
+ super.finalize();
+ }
+
+ static new_impl(arg: PayerInterface): Payer {
+ const impl_holder: LDKPayerHolder = new LDKPayerHolder();
+ let structImplementation = <bindings.LDKPayer>{
+ // todo: in-line interface filling
+ node_id (): Uint8Array {
+ Uint8Array ret = arg.node_id();
+ return ret;
+ },
+
+ first_hops (): number[] {
+ ChannelDetails[] ret = arg.first_hops();
+ result: number[] = ret != null ? Arrays.stream(ret).map(ret_conv_16 -> ret_conv_16 == null ? 0 : ret_conv_16.ptr & ~1).toArray(number[]::new) : null;
+ return result;
+ },
+
+ send_payment (route: number, payment_hash: Uint8Array, payment_secret: Uint8Array): number {
+ const route_hu_conv: Route = new Route(null, route);
+ Result_PaymentIdPaymentSendFailureZ ret = arg.send_payment(route_hu_conv, payment_hash, payment_secret);
+ result: number = ret != null ? ret.ptr : 0;
+ 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);
+ result: number = ret != null ? ret.ptr : 0;
+ return result;
+ },
+
+
+ };
+ impl_holder.held = new Payer (null, structImplementation);
+ }
+ }
+
+ export interface PayerInterface {
+ node_id(): Uint8Array;
+ first_hops(): ChannelDetails[];
+ send_payment(route: Route, payment_hash: Uint8Array, payment_secret: Uint8Array): Result_PaymentIdPaymentSendFailureZ;
+ retry_payment(route: Route, payment_id: Uint8Array): Result_NonePaymentSendFailureZ;
+
+ }
+
+ class LDKPayerHolder {
+ held: Payer;
+ }
+ public Uint8Array node_id() {
+ Uint8Array ret = bindings.Payer_node_id(this.ptr);
+ return ret;
+ }
+
+ public ChannelDetails[] first_hops() {
+ number[] ret = bindings.Payer_first_hops(this.ptr);
+ ChannelDetails[] ret_conv_16_arr = new ChannelDetails[ret.length];
+ for (int q = 0; q < ret.length; q++) {
+ number ret_conv_16 = ret[q];
+ const ret_conv_16_hu_conv: ChannelDetails = new ChannelDetails(null, ret_conv_16);
+ ret_conv_16_hu_conv.ptrs_to.add(this);
+ ret_conv_16_arr[q] = ret_conv_16_hu_conv;
+ }
+ return ret_conv_16_arr;
+ }
+
+ public Result_PaymentIdPaymentSendFailureZ send_payment(Route route, Uint8Array payment_hash, Uint8Array payment_secret) {
+ number ret = bindings.Payer_send_payment(this.ptr, route == null ? 0 : route.ptr & ~1, payment_hash, payment_secret);
+ 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, payment_id);
+ Result_NonePaymentSendFailureZ ret_hu_conv = Result_NonePaymentSendFailureZ.constr_from_ptr(ret);
+ this.ptrs_to.add(route);
+ return ret_hu_conv;
+ }
+
+}
--- /dev/null
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+export default class PaymentError extends CommonBase {
+ protected constructor(_dummy: object, ptr: number) { super(ptr); }
+ protected finalize() {
+ super.finalize();
+ if (this.ptr != 0) { bindings.PaymentError_free(this.ptr); }
+ }
+ static constr_from_ptr(ptr: number): PaymentError {
+ const raw_val: bindings.LDKPaymentError = bindings.LDKPaymentError_ref_from_ptr(ptr);
+ if (raw_val instanceof bindings.LDKPaymentError.Invoice) {
+ return new Invoice(this.ptr, raw_val);
+ }
+ if (raw_val instanceof bindings.LDKPaymentError.Routing) {
+ return new Routing(this.ptr, raw_val);
+ }
+ if (raw_val instanceof bindings.LDKPaymentError.Sending) {
+ return new Sending(this.ptr, raw_val);
+ }
+ throw new Error('oops, this should be unreachable'); // Unreachable without extending the (internal) bindings interface
+ }
+
+}
+export class Invoice extends PaymentError {
+ public invoice: String;
+ private constructor(ptr: number, obj: bindings.LDKPaymentError.Invoice) {
+ super(null, ptr);
+ this.invoice = obj.invoice;
+ }
+}
+export class Routing extends PaymentError {
+ public routing: LightningError;
+ private constructor(ptr: number, obj: bindings.LDKPaymentError.Routing) {
+ super(null, ptr);
+ const routing: number = obj.routing;
+ const routing_hu_conv: LightningError = new LightningError(null, routing);
+ routing_hu_conv.ptrs_to.add(this);
+ this.routing = routing_hu_conv;
+ }
+}
+export class Sending extends PaymentError {
+ public sending: PaymentSendFailure;
+ private constructor(ptr: number, obj: bindings.LDKPaymentError.Sending) {
+ super(null, ptr);
+ const sending: number = obj.sending;
+ PaymentSendFailure sending_hu_conv = PaymentSendFailure.constr_from_ptr(sending);
+ sending_hu_conv.ptrs_to.add(this);
+ this.sending = sending_hu_conv;
+ }
+}
+ public PaymentError clone() {
+ number ret = bindings.PaymentError_clone(this.ptr);
+ PaymentError ret_hu_conv = PaymentError.constr_from_ptr(ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
+ public static PaymentError constructor_invoice(String a) {
+ number ret = bindings.PaymentError_invoice(a);
+ PaymentError ret_hu_conv = PaymentError.constr_from_ptr(ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ return ret_hu_conv;
+ }
+
+ public static PaymentError constructor_routing(LightningError a) {
+ number ret = bindings.PaymentError_routing(a == null ? 0 : a.ptr & ~1);
+ PaymentError ret_hu_conv = PaymentError.constr_from_ptr(ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ return ret_hu_conv;
+ }
+
+ public static PaymentError constructor_sending(PaymentSendFailure a) {
+ number ret = bindings.PaymentError_sending(a.ptr);
+ PaymentError ret_hu_conv = PaymentError.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
-
-
-
- export default class PaymentId extends CommonBase {
- constructor(_dummy: object, ptr: number) {
- super(ptr);
- }
-
-
- protected finalize() {
- super.finalize();
-
- if (this.ptr != 0) {
- bindings.PaymentId_free(this.ptr);
- }
- }
- public number hash() {
- number ret = bindings.PaymentId_hash(this.ptr);
- return ret;
- }
-
- public PaymentId clone() {
- number ret = bindings.PaymentId_clone(this.ptr);
- const ret_hu_conv: PaymentId = new PaymentId(null, ret);
- ret_hu_conv.ptrs_to.add(this);
- return ret_hu_conv;
- }
-
- public boolean eq(PaymentId b) {
- boolean ret = bindings.PaymentId_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
- this.ptrs_to.add(b);
- return ret;
- }
-
- public Uint8Array write() {
- Uint8Array ret = bindings.PaymentId_write(this.ptr);
- return ret;
- }
-
- public static Result_PaymentIdDecodeErrorZ constructor_read(Uint8Array ser) {
- number ret = bindings.PaymentId_read(ser);
- Result_PaymentIdDecodeErrorZ ret_hu_conv = Result_PaymentIdDecodeErrorZ.constr_from_ptr(ret);
- return ret_hu_conv;
- }
-
-}
}
}
export class PartialFailure extends PaymentSendFailure {
- public partial_failure: Result_NoneAPIErrorZ[];
+ public results: Result_NoneAPIErrorZ[];
+ public failed_paths_retry: RouteParameters;
+ public payment_id: Uint8Array;
private constructor(ptr: number, obj: bindings.LDKPaymentSendFailure.PartialFailure) {
super(null, ptr);
- const partial_failure: number[] = obj.partial_failure;
- Result_NoneAPIErrorZ[] partial_failure_conv_22_arr = new Result_NoneAPIErrorZ[partial_failure.length];
- for (int w = 0; w < partial_failure.length; w++) {
- number partial_failure_conv_22 = partial_failure[w];
- Result_NoneAPIErrorZ partial_failure_conv_22_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(partial_failure_conv_22);
- partial_failure_conv_22_arr[w] = partial_failure_conv_22_hu_conv;
+ const results: number[] = obj.results;
+ Result_NoneAPIErrorZ[] results_conv_22_arr = new Result_NoneAPIErrorZ[results.length];
+ for (int w = 0; w < results.length; w++) {
+ number results_conv_22 = results[w];
+ Result_NoneAPIErrorZ results_conv_22_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(results_conv_22);
+ results_conv_22_arr[w] = results_conv_22_hu_conv;
}
- this.partial_failure = partial_failure_conv_22_arr;
+ this.results = results_conv_22_arr;
+ const failed_paths_retry: number = obj.failed_paths_retry;
+ const failed_paths_retry_hu_conv: RouteParameters = new RouteParameters(null, failed_paths_retry);
+ failed_paths_retry_hu_conv.ptrs_to.add(this);
+ this.failed_paths_retry = failed_paths_retry_hu_conv;
+ this.payment_id = obj.payment_id;
}
}
public PaymentSendFailure clone() {
return ret_hu_conv;
}
- public static PaymentSendFailure constructor_partial_failure(Result_NoneAPIErrorZ[] a) {
- number ret = bindings.PaymentSendFailure_partial_failure(a != null ? Arrays.stream(a).map(a_conv_22 -> a_conv_22 != null ? a_conv_22.ptr : 0).toArray(number[]::new) : null);
+ public static PaymentSendFailure constructor_partial_failure(Result_NoneAPIErrorZ[] results, RouteParameters failed_paths_retry, Uint8Array payment_id) {
+ number ret = bindings.PaymentSendFailure_partial_failure(results != null ? Arrays.stream(results).map(results_conv_22 -> results_conv_22 != null ? results_conv_22.ptr : 0).toArray(number[]::new) : null, failed_paths_retry == null ? 0 : failed_paths_retry.ptr & ~1, payment_id);
PaymentSendFailure ret_hu_conv = PaymentSendFailure.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
return ret_hu_conv;
bindings.PeerManager_disconnect_by_node_id(this.ptr, node_id, no_connection_possible);
}
+ public void disconnect_all_peers() {
+ bindings.PeerManager_disconnect_all_peers(this.ptr);
+ }
+
public void timer_tick_occurred() {
bindings.PeerManager_timer_tick_occurred(this.ptr);
}
const impl_holder: LDKPersistHolder = new LDKPersistHolder();
let structImplementation = <bindings.LDKPersist>{
// todo: in-line interface filling
- persist_new_channel (id: number, data: number): number {
- const id_hu_conv: OutPoint = new OutPoint(null, id);
- id_hu_conv.ptrs_to.add(this);
+ persist_new_channel (channel_id: number, data: number, update_id: number): number {
+ const channel_id_hu_conv: OutPoint = new OutPoint(null, channel_id);
+ channel_id_hu_conv.ptrs_to.add(this);
const data_hu_conv: ChannelMonitor = new ChannelMonitor(null, data);
- Result_NoneChannelMonitorUpdateErrZ ret = arg.persist_new_channel(id_hu_conv, data_hu_conv);
+ const update_id_hu_conv: MonitorUpdateId = new MonitorUpdateId(null, update_id);
+ update_id_hu_conv.ptrs_to.add(this);
+ Result_NoneChannelMonitorUpdateErrZ ret = arg.persist_new_channel(channel_id_hu_conv, data_hu_conv, update_id_hu_conv);
result: number = ret != null ? ret.ptr : 0;
return result;
},
- update_persisted_channel (id: number, update: number, data: number): number {
- const id_hu_conv: OutPoint = new OutPoint(null, id);
- id_hu_conv.ptrs_to.add(this);
+ update_persisted_channel (channel_id: number, update: number, data: number, update_id: number): number {
+ const channel_id_hu_conv: OutPoint = new OutPoint(null, channel_id);
+ channel_id_hu_conv.ptrs_to.add(this);
const update_hu_conv: ChannelMonitorUpdate = new ChannelMonitorUpdate(null, update);
const data_hu_conv: ChannelMonitor = new ChannelMonitor(null, data);
- Result_NoneChannelMonitorUpdateErrZ ret = arg.update_persisted_channel(id_hu_conv, update_hu_conv, data_hu_conv);
+ const update_id_hu_conv: MonitorUpdateId = new MonitorUpdateId(null, update_id);
+ update_id_hu_conv.ptrs_to.add(this);
+ Result_NoneChannelMonitorUpdateErrZ ret = arg.update_persisted_channel(channel_id_hu_conv, update_hu_conv, data_hu_conv, update_id_hu_conv);
result: number = ret != null ? ret.ptr : 0;
return result;
},
}
export interface PersistInterface {
- persist_new_channel(id: OutPoint, data: ChannelMonitor): Result_NoneChannelMonitorUpdateErrZ;
- update_persisted_channel(id: OutPoint, update: ChannelMonitorUpdate, data: ChannelMonitor): Result_NoneChannelMonitorUpdateErrZ;
+ persist_new_channel(channel_id: OutPoint, data: ChannelMonitor, update_id: MonitorUpdateId): Result_NoneChannelMonitorUpdateErrZ;
+ update_persisted_channel(channel_id: OutPoint, update: ChannelMonitorUpdate, data: ChannelMonitor, update_id: MonitorUpdateId): Result_NoneChannelMonitorUpdateErrZ;
}
class LDKPersistHolder {
held: Persist;
}
- public Result_NoneChannelMonitorUpdateErrZ persist_new_channel(OutPoint id, ChannelMonitor data) {
- number ret = bindings.Persist_persist_new_channel(this.ptr, id == null ? 0 : id.ptr & ~1, data == null ? 0 : data.ptr & ~1);
+ public Result_NoneChannelMonitorUpdateErrZ persist_new_channel(OutPoint channel_id, ChannelMonitor data, MonitorUpdateId update_id) {
+ number 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);
Result_NoneChannelMonitorUpdateErrZ ret_hu_conv = Result_NoneChannelMonitorUpdateErrZ.constr_from_ptr(ret);
this.ptrs_to.add(data);
return ret_hu_conv;
}
- public Result_NoneChannelMonitorUpdateErrZ update_persisted_channel(OutPoint id, ChannelMonitorUpdate update, ChannelMonitor data) {
- number ret = bindings.Persist_update_persisted_channel(this.ptr, id == null ? 0 : id.ptr & ~1, update == null ? 0 : update.ptr & ~1, data == null ? 0 : data.ptr & ~1);
+ public Result_NoneChannelMonitorUpdateErrZ update_persisted_channel(OutPoint channel_id, ChannelMonitorUpdate update, ChannelMonitor data, MonitorUpdateId update_id) {
+ number 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);
Result_NoneChannelMonitorUpdateErrZ ret_hu_conv = Result_NoneChannelMonitorUpdateErrZ.constr_from_ptr(ret);
this.ptrs_to.add(update);
this.ptrs_to.add(data);
+++ /dev/null
-
-import CommonBase from './CommonBase';
-import * as bindings from '../bindings' // TODO: figure out location
-
-public class Result_CResult_NetAddressu8ZDecodeErrorZ extends CommonBase {
- private Result_CResult_NetAddressu8ZDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
- protected void finalize() throws Throwable {
- if (ptr != 0) { bindings.CResult_CResult_NetAddressu8ZDecodeErrorZ_free(ptr); } super.finalize();
- }
-
- static Result_CResult_NetAddressu8ZDecodeErrorZ constr_from_ptr(long ptr) {
- if (bindings.LDKCResult_CResult_NetAddressu8ZDecodeErrorZ_result_ok(ptr)) {
- return new Result_CResult_NetAddressu8ZDecodeErrorZ_OK(null, ptr);
- } else {
- return new Result_CResult_NetAddressu8ZDecodeErrorZ_Err(null, ptr);
- }
- }
- public static final class Result_CResult_NetAddressu8ZDecodeErrorZ_OK extends Result_CResult_NetAddressu8ZDecodeErrorZ {
- public final Result_NetAddressu8Z res;
- private Result_CResult_NetAddressu8ZDecodeErrorZ_OK(Object _dummy, long ptr) {
- super(_dummy, ptr);
- number res = bindings.LDKCResult_CResult_NetAddressu8ZDecodeErrorZ_get_ok(ptr);
- Result_NetAddressu8Z res_hu_conv = Result_NetAddressu8Z.constr_from_ptr(res);
- this.res = res_hu_conv;
- }
- }
-
- public static final class Result_CResult_NetAddressu8ZDecodeErrorZ_Err extends Result_CResult_NetAddressu8ZDecodeErrorZ {
- public final DecodeError err;
- private Result_CResult_NetAddressu8ZDecodeErrorZ_Err(Object _dummy, long ptr) {
- super(_dummy, ptr);
- number err = bindings.LDKCResult_CResult_NetAddressu8ZDecodeErrorZ_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_CResult_NetAddressu8ZDecodeErrorZ constructor_ok(Result_NetAddressu8Z o) {
- number ret = bindings.CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(o != null ? o.ptr : 0);
- Result_CResult_NetAddressu8ZDecodeErrorZ ret_hu_conv = Result_CResult_NetAddressu8ZDecodeErrorZ.constr_from_ptr(ret);
- return ret_hu_conv;
- }
-
- public static Result_CResult_NetAddressu8ZDecodeErrorZ constructor_err(DecodeError e) {
- number ret = bindings.CResult_CResult_NetAddressu8ZDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
- Result_CResult_NetAddressu8ZDecodeErrorZ ret_hu_conv = Result_CResult_NetAddressu8ZDecodeErrorZ.constr_from_ptr(ret);
- return ret_hu_conv;
- }
-
- public Result_CResult_NetAddressu8ZDecodeErrorZ clone() {
- number ret = bindings.CResult_CResult_NetAddressu8ZDecodeErrorZ_clone(this.ptr);
- Result_CResult_NetAddressu8ZDecodeErrorZ ret_hu_conv = Result_CResult_NetAddressu8ZDecodeErrorZ.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_NetAddressu8Z extends CommonBase {
- private Result_NetAddressu8Z(Object _dummy, long ptr) { super(ptr); }
- protected void finalize() throws Throwable {
- if (ptr != 0) { bindings.CResult_NetAddressu8Z_free(ptr); } super.finalize();
- }
-
- static Result_NetAddressu8Z constr_from_ptr(long ptr) {
- if (bindings.LDKCResult_NetAddressu8Z_result_ok(ptr)) {
- return new Result_NetAddressu8Z_OK(null, ptr);
- } else {
- return new Result_NetAddressu8Z_Err(null, ptr);
- }
- }
- public static final class Result_NetAddressu8Z_OK extends Result_NetAddressu8Z {
- public final NetAddress res;
- private Result_NetAddressu8Z_OK(Object _dummy, long ptr) {
- super(_dummy, ptr);
- number res = bindings.LDKCResult_NetAddressu8Z_get_ok(ptr);
- NetAddress res_hu_conv = NetAddress.constr_from_ptr(res);
- res_hu_conv.ptrs_to.add(this);
- this.res = res_hu_conv;
- }
- }
-
- public static final class Result_NetAddressu8Z_Err extends Result_NetAddressu8Z {
- public final number err;
- private Result_NetAddressu8Z_Err(Object _dummy, long ptr) {
- super(_dummy, ptr);
- this.err = bindings.LDKCResult_NetAddressu8Z_get_err(ptr);
- }
- }
-
- public static Result_NetAddressu8Z constructor_ok(NetAddress o) {
- number ret = bindings.CResult_NetAddressu8Z_ok(o.ptr);
- Result_NetAddressu8Z ret_hu_conv = Result_NetAddressu8Z.constr_from_ptr(ret);
- return ret_hu_conv;
- }
-
- public static Result_NetAddressu8Z constructor_err(number e) {
- number ret = bindings.CResult_NetAddressu8Z_err(e);
- Result_NetAddressu8Z ret_hu_conv = Result_NetAddressu8Z.constr_from_ptr(ret);
- return ret_hu_conv;
- }
-
- public Result_NetAddressu8Z clone() {
- number ret = bindings.CResult_NetAddressu8Z_clone(this.ptr);
- Result_NetAddressu8Z ret_hu_conv = Result_NetAddressu8Z.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_PayeeDecodeErrorZ extends CommonBase {
+ private Result_PayeeDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_PayeeDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_PayeeDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_PayeeDecodeErrorZ_result_ok(ptr)) {
+ return new Result_PayeeDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_PayeeDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_PayeeDecodeErrorZ_OK extends Result_PayeeDecodeErrorZ {
+ public final Payee res;
+ private Result_PayeeDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number res = bindings.LDKCResult_PayeeDecodeErrorZ_get_ok(ptr);
+ const res_hu_conv: Payee = new Payee(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ }
+
+ public static final class Result_PayeeDecodeErrorZ_Err extends Result_PayeeDecodeErrorZ {
+ public final DecodeError err;
+ private Result_PayeeDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number err = bindings.LDKCResult_PayeeDecodeErrorZ_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_PayeeDecodeErrorZ constructor_ok(Payee o) {
+ number ret = bindings.CResult_PayeeDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Result_PayeeDecodeErrorZ ret_hu_conv = Result_PayeeDecodeErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ public static Result_PayeeDecodeErrorZ constructor_err(DecodeError e) {
+ number ret = bindings.CResult_PayeeDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Result_PayeeDecodeErrorZ ret_hu_conv = Result_PayeeDecodeErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ public Result_PayeeDecodeErrorZ clone() {
+ number ret = bindings.CResult_PayeeDecodeErrorZ_clone(this.ptr);
+ Result_PayeeDecodeErrorZ ret_hu_conv = Result_PayeeDecodeErrorZ.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_PaymentIdDecodeErrorZ extends CommonBase {
- private Result_PaymentIdDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
- protected void finalize() throws Throwable {
- if (ptr != 0) { bindings.CResult_PaymentIdDecodeErrorZ_free(ptr); } super.finalize();
- }
-
- static Result_PaymentIdDecodeErrorZ constr_from_ptr(long ptr) {
- if (bindings.LDKCResult_PaymentIdDecodeErrorZ_result_ok(ptr)) {
- return new Result_PaymentIdDecodeErrorZ_OK(null, ptr);
- } else {
- return new Result_PaymentIdDecodeErrorZ_Err(null, ptr);
- }
- }
- public static final class Result_PaymentIdDecodeErrorZ_OK extends Result_PaymentIdDecodeErrorZ {
- public final PaymentId res;
- private Result_PaymentIdDecodeErrorZ_OK(Object _dummy, long ptr) {
- super(_dummy, ptr);
- number res = bindings.LDKCResult_PaymentIdDecodeErrorZ_get_ok(ptr);
- const res_hu_conv: PaymentId = new PaymentId(null, res);
- res_hu_conv.ptrs_to.add(this);
- this.res = res_hu_conv;
- }
- }
-
- public static final class Result_PaymentIdDecodeErrorZ_Err extends Result_PaymentIdDecodeErrorZ {
- public final DecodeError err;
- private Result_PaymentIdDecodeErrorZ_Err(Object _dummy, long ptr) {
- super(_dummy, ptr);
- number err = bindings.LDKCResult_PaymentIdDecodeErrorZ_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_PaymentIdDecodeErrorZ constructor_ok(PaymentId o) {
- number ret = bindings.CResult_PaymentIdDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
- Result_PaymentIdDecodeErrorZ ret_hu_conv = Result_PaymentIdDecodeErrorZ.constr_from_ptr(ret);
- return ret_hu_conv;
- }
-
- public static Result_PaymentIdDecodeErrorZ constructor_err(DecodeError e) {
- number ret = bindings.CResult_PaymentIdDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
- Result_PaymentIdDecodeErrorZ ret_hu_conv = Result_PaymentIdDecodeErrorZ.constr_from_ptr(ret);
- return ret_hu_conv;
- }
-
- public Result_PaymentIdDecodeErrorZ clone() {
- number ret = bindings.CResult_PaymentIdDecodeErrorZ_clone(this.ptr);
- Result_PaymentIdDecodeErrorZ ret_hu_conv = Result_PaymentIdDecodeErrorZ.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_PaymentIdPaymentErrorZ extends CommonBase {
+ private Result_PaymentIdPaymentErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_PaymentIdPaymentErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_PaymentIdPaymentErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_PaymentIdPaymentErrorZ_result_ok(ptr)) {
+ return new Result_PaymentIdPaymentErrorZ_OK(null, ptr);
+ } else {
+ return new Result_PaymentIdPaymentErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_PaymentIdPaymentErrorZ_OK extends Result_PaymentIdPaymentErrorZ {
+ public final Uint8Array res;
+ private Result_PaymentIdPaymentErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ this.res = bindings.LDKCResult_PaymentIdPaymentErrorZ_get_ok(ptr);
+ }
+ }
+
+ public static final class Result_PaymentIdPaymentErrorZ_Err extends Result_PaymentIdPaymentErrorZ {
+ public final PaymentError err;
+ private Result_PaymentIdPaymentErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number err = bindings.LDKCResult_PaymentIdPaymentErrorZ_get_err(ptr);
+ PaymentError err_hu_conv = PaymentError.constr_from_ptr(err);
+ err_hu_conv.ptrs_to.add(this);
+ this.err = err_hu_conv;
+ }
+ }
+
+ public static Result_PaymentIdPaymentErrorZ constructor_ok(Uint8Array o) {
+ number ret = bindings.CResult_PaymentIdPaymentErrorZ_ok(o);
+ Result_PaymentIdPaymentErrorZ ret_hu_conv = Result_PaymentIdPaymentErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ public static Result_PaymentIdPaymentErrorZ constructor_err(PaymentError e) {
+ number ret = bindings.CResult_PaymentIdPaymentErrorZ_err(e.ptr);
+ Result_PaymentIdPaymentErrorZ ret_hu_conv = Result_PaymentIdPaymentErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ public Result_PaymentIdPaymentErrorZ clone() {
+ number ret = bindings.CResult_PaymentIdPaymentErrorZ_clone(this.ptr);
+ Result_PaymentIdPaymentErrorZ ret_hu_conv = Result_PaymentIdPaymentErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+}
}
}
public static final class Result_PaymentIdPaymentSendFailureZ_OK extends Result_PaymentIdPaymentSendFailureZ {
- public final PaymentId res;
+ public final Uint8Array res;
private Result_PaymentIdPaymentSendFailureZ_OK(Object _dummy, long ptr) {
super(_dummy, ptr);
- number res = bindings.LDKCResult_PaymentIdPaymentSendFailureZ_get_ok(ptr);
- const res_hu_conv: PaymentId = new PaymentId(null, res);
- res_hu_conv.ptrs_to.add(this);
- this.res = res_hu_conv;
+ this.res = bindings.LDKCResult_PaymentIdPaymentSendFailureZ_get_ok(ptr);
}
}
}
}
- public static Result_PaymentIdPaymentSendFailureZ constructor_ok(PaymentId o) {
- number ret = bindings.CResult_PaymentIdPaymentSendFailureZ_ok(o == null ? 0 : o.ptr & ~1);
+ public static Result_PaymentIdPaymentSendFailureZ constructor_ok(Uint8Array o) {
+ number ret = bindings.CResult_PaymentIdPaymentSendFailureZ_ok(o);
Result_PaymentIdPaymentSendFailureZ ret_hu_conv = Result_PaymentIdPaymentSendFailureZ.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_RouteHintDecodeErrorZ extends CommonBase {
+ private Result_RouteHintDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_RouteHintDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_RouteHintDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_RouteHintDecodeErrorZ_result_ok(ptr)) {
+ return new Result_RouteHintDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_RouteHintDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_RouteHintDecodeErrorZ_OK extends Result_RouteHintDecodeErrorZ {
+ public final RouteHint res;
+ private Result_RouteHintDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number res = bindings.LDKCResult_RouteHintDecodeErrorZ_get_ok(ptr);
+ const res_hu_conv: RouteHint = new RouteHint(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ }
+
+ public static final class Result_RouteHintDecodeErrorZ_Err extends Result_RouteHintDecodeErrorZ {
+ public final DecodeError err;
+ private Result_RouteHintDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number err = bindings.LDKCResult_RouteHintDecodeErrorZ_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_RouteHintDecodeErrorZ constructor_ok(RouteHint o) {
+ number ret = bindings.CResult_RouteHintDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Result_RouteHintDecodeErrorZ ret_hu_conv = Result_RouteHintDecodeErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ public static Result_RouteHintDecodeErrorZ constructor_err(DecodeError e) {
+ number ret = bindings.CResult_RouteHintDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Result_RouteHintDecodeErrorZ ret_hu_conv = Result_RouteHintDecodeErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ public Result_RouteHintDecodeErrorZ clone() {
+ number ret = bindings.CResult_RouteHintDecodeErrorZ_clone(this.ptr);
+ Result_RouteHintDecodeErrorZ ret_hu_conv = Result_RouteHintDecodeErrorZ.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_RouteHintHopDecodeErrorZ extends CommonBase {
+ private Result_RouteHintHopDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_RouteHintHopDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_RouteHintHopDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_RouteHintHopDecodeErrorZ_result_ok(ptr)) {
+ return new Result_RouteHintHopDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_RouteHintHopDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_RouteHintHopDecodeErrorZ_OK extends Result_RouteHintHopDecodeErrorZ {
+ public final RouteHintHop res;
+ private Result_RouteHintHopDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number res = bindings.LDKCResult_RouteHintHopDecodeErrorZ_get_ok(ptr);
+ const res_hu_conv: RouteHintHop = new RouteHintHop(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ }
+
+ public static final class Result_RouteHintHopDecodeErrorZ_Err extends Result_RouteHintHopDecodeErrorZ {
+ public final DecodeError err;
+ private Result_RouteHintHopDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number err = bindings.LDKCResult_RouteHintHopDecodeErrorZ_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_RouteHintHopDecodeErrorZ constructor_ok(RouteHintHop o) {
+ number ret = bindings.CResult_RouteHintHopDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Result_RouteHintHopDecodeErrorZ ret_hu_conv = Result_RouteHintHopDecodeErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ public static Result_RouteHintHopDecodeErrorZ constructor_err(DecodeError e) {
+ number ret = bindings.CResult_RouteHintHopDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Result_RouteHintHopDecodeErrorZ ret_hu_conv = Result_RouteHintHopDecodeErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ public Result_RouteHintHopDecodeErrorZ clone() {
+ number ret = bindings.CResult_RouteHintHopDecodeErrorZ_clone(this.ptr);
+ Result_RouteHintHopDecodeErrorZ ret_hu_conv = Result_RouteHintHopDecodeErrorZ.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_RouteParametersDecodeErrorZ extends CommonBase {
+ private Result_RouteParametersDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_RouteParametersDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_RouteParametersDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_RouteParametersDecodeErrorZ_result_ok(ptr)) {
+ return new Result_RouteParametersDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_RouteParametersDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_RouteParametersDecodeErrorZ_OK extends Result_RouteParametersDecodeErrorZ {
+ public final RouteParameters res;
+ private Result_RouteParametersDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number res = bindings.LDKCResult_RouteParametersDecodeErrorZ_get_ok(ptr);
+ const res_hu_conv: RouteParameters = new RouteParameters(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ }
+
+ public static final class Result_RouteParametersDecodeErrorZ_Err extends Result_RouteParametersDecodeErrorZ {
+ public final DecodeError err;
+ private Result_RouteParametersDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number err = bindings.LDKCResult_RouteParametersDecodeErrorZ_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_RouteParametersDecodeErrorZ constructor_ok(RouteParameters o) {
+ number ret = bindings.CResult_RouteParametersDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+ Result_RouteParametersDecodeErrorZ ret_hu_conv = Result_RouteParametersDecodeErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ public static Result_RouteParametersDecodeErrorZ constructor_err(DecodeError e) {
+ number ret = bindings.CResult_RouteParametersDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+ Result_RouteParametersDecodeErrorZ ret_hu_conv = Result_RouteParametersDecodeErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ public Result_RouteParametersDecodeErrorZ clone() {
+ number ret = bindings.CResult_RouteParametersDecodeErrorZ_clone(this.ptr);
+ Result_RouteParametersDecodeErrorZ ret_hu_conv = Result_RouteParametersDecodeErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+}
--- /dev/null
+
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+
+
+ export default class RetryAttempts extends CommonBase {
+ constructor(_dummy: object, ptr: number) {
+ super(ptr);
+ }
+
+
+ protected finalize() {
+ super.finalize();
+
+ if (this.ptr != 0) {
+ bindings.RetryAttempts_free(this.ptr);
+ }
+ }
+ public number get_a() {
+ number ret = bindings.RetryAttempts_get_a(this.ptr);
+ return ret;
+ }
+
+ public void set_a(number val) {
+ bindings.RetryAttempts_set_a(this.ptr, val);
+ }
+
+ public static RetryAttempts constructor_new(number a_arg) {
+ number ret = bindings.RetryAttempts_new(a_arg);
+ const ret_hu_conv: RetryAttempts = new RetryAttempts(null, ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ return ret_hu_conv;
+ }
+
+ public RetryAttempts clone() {
+ number ret = bindings.RetryAttempts_clone(this.ptr);
+ const ret_hu_conv: RetryAttempts = new RetryAttempts(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
+ public boolean eq(RetryAttempts b) {
+ boolean ret = bindings.RetryAttempts_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
+ this.ptrs_to.add(b);
+ return ret;
+ }
+
+ public number hash() {
+ number ret = bindings.RetryAttempts_hash(this.ptr);
+ return ret;
+ }
+
+}
bindings.Route_set_paths(this.ptr, val != null ? Arrays.stream(val).map(val_conv_12 -> val_conv_12 != null ? Arrays.stream(val_conv_12).map(val_conv_12_conv_10 -> val_conv_12_conv_10 == null ? 0 : val_conv_12_conv_10.ptr & ~1).toArray(number[]::new) : null).toArray(number[][]::new) : null);
}
- public static Route constructor_new(RouteHop[][] paths_arg) {
- number 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).map(paths_arg_conv_12_conv_10 -> paths_arg_conv_12_conv_10 == null ? 0 : paths_arg_conv_12_conv_10.ptr & ~1).toArray(number[]::new) : null).toArray(number[][]::new) : null);
+ public Payee get_payee() {
+ number ret = bindings.Route_get_payee(this.ptr);
+ const ret_hu_conv: Payee = new Payee(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
+ public void set_payee(Payee val) {
+ bindings.Route_set_payee(this.ptr, val == null ? 0 : val.ptr & ~1);
+ }
+
+ public static Route constructor_new(RouteHop[][] paths_arg, Payee payee_arg) {
+ number 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).map(paths_arg_conv_12_conv_10 -> paths_arg_conv_12_conv_10 == null ? 0 : paths_arg_conv_12_conv_10.ptr & ~1).toArray(number[]::new) : null).toArray(number[][]::new) : null, payee_arg == null ? 0 : payee_arg.ptr & ~1);
const ret_hu_conv: Route = new Route(null, ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
return ret_hu_conv;
bindings.RouteHint_free(this.ptr);
}
}
+ public RouteHintHop[] get_a() {
+ number[] ret = bindings.RouteHint_get_a(this.ptr);
+ RouteHintHop[] ret_conv_14_arr = new RouteHintHop[ret.length];
+ for (int o = 0; o < ret.length; o++) {
+ number ret_conv_14 = ret[o];
+ const ret_conv_14_hu_conv: RouteHintHop = new RouteHintHop(null, ret_conv_14);
+ ret_conv_14_hu_conv.ptrs_to.add(this);
+ ret_conv_14_arr[o] = ret_conv_14_hu_conv;
+ }
+ return ret_conv_14_arr;
+ }
+
+ public void set_a(RouteHintHop[] val) {
+ bindings.RouteHint_set_a(this.ptr, val != null ? Arrays.stream(val).map(val_conv_14 -> val_conv_14 == null ? 0 : val_conv_14.ptr & ~1).toArray(number[]::new) : null);
+ }
+
+ public static RouteHint constructor_new(RouteHintHop[] a_arg) {
+ number ret = bindings.RouteHint_new(a_arg != null ? Arrays.stream(a_arg).map(a_arg_conv_14 -> a_arg_conv_14 == null ? 0 : a_arg_conv_14.ptr & ~1).toArray(number[]::new) : null);
+ const ret_hu_conv: RouteHint = new RouteHint(null, ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ return ret_hu_conv;
+ }
+
public RouteHint clone() {
number ret = bindings.RouteHint_clone(this.ptr);
const ret_hu_conv: RouteHint = new RouteHint(null, ret);
return ret;
}
+ public Uint8Array write() {
+ Uint8Array ret = bindings.RouteHint_write(this.ptr);
+ return ret;
+ }
+
+ public static Result_RouteHintDecodeErrorZ constructor_read(Uint8Array ser) {
+ number ret = bindings.RouteHint_read(ser);
+ Result_RouteHintDecodeErrorZ ret_hu_conv = Result_RouteHintDecodeErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
}
return ret;
}
+ public Uint8Array write() {
+ Uint8Array ret = bindings.RouteHintHop_write(this.ptr);
+ return ret;
+ }
+
+ public static Result_RouteHintHopDecodeErrorZ constructor_read(Uint8Array ser) {
+ number ret = bindings.RouteHintHop_read(ser);
+ Result_RouteHintHopDecodeErrorZ ret_hu_conv = Result_RouteHintHopDecodeErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
}
--- /dev/null
+
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+
+
+ export default class RouteParameters extends CommonBase {
+ constructor(_dummy: object, ptr: number) {
+ super(ptr);
+ }
+
+
+ protected finalize() {
+ super.finalize();
+
+ if (this.ptr != 0) {
+ bindings.RouteParameters_free(this.ptr);
+ }
+ }
+ public Payee get_payee() {
+ number ret = bindings.RouteParameters_get_payee(this.ptr);
+ const ret_hu_conv: Payee = new Payee(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
+ public void set_payee(Payee val) {
+ bindings.RouteParameters_set_payee(this.ptr, val == null ? 0 : val.ptr & ~1);
+ }
+
+ public number get_final_value_msat() {
+ number ret = bindings.RouteParameters_get_final_value_msat(this.ptr);
+ return ret;
+ }
+
+ public void set_final_value_msat(number val) {
+ bindings.RouteParameters_set_final_value_msat(this.ptr, val);
+ }
+
+ public number get_final_cltv_expiry_delta() {
+ number ret = bindings.RouteParameters_get_final_cltv_expiry_delta(this.ptr);
+ return ret;
+ }
+
+ public void set_final_cltv_expiry_delta(number val) {
+ bindings.RouteParameters_set_final_cltv_expiry_delta(this.ptr, val);
+ }
+
+ public static RouteParameters constructor_new(Payee payee_arg, number final_value_msat_arg, number final_cltv_expiry_delta_arg) {
+ number ret = bindings.RouteParameters_new(payee_arg == null ? 0 : payee_arg.ptr & ~1, final_value_msat_arg, final_cltv_expiry_delta_arg);
+ const ret_hu_conv: RouteParameters = new RouteParameters(null, ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ return ret_hu_conv;
+ }
+
+ public RouteParameters clone() {
+ number ret = bindings.RouteParameters_clone(this.ptr);
+ const ret_hu_conv: RouteParameters = new RouteParameters(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
+ public Uint8Array write() {
+ Uint8Array ret = bindings.RouteParameters_write(this.ptr);
+ return ret;
+ }
+
+ public static Result_RouteParametersDecodeErrorZ constructor_read(Uint8Array ser) {
+ number ret = bindings.RouteParameters_read(ser);
+ Result_RouteParametersDecodeErrorZ ret_hu_conv = Result_RouteParametersDecodeErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+}
--- /dev/null
+
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+
+
+ export class Router extends CommonBase {
+
+ bindings_instance?: bindings.LDKRouter;
+
+ constructor(ptr?: number, arg?: bindings.LDKRouter) {
+ if (Number.isFinite(ptr)) {
+ super(ptr);
+ this.bindings_instance = null;
+ } else {
+ // TODO: private constructor instantiation
+ super(bindings.LDKRouter_new(arg));
+ this.ptrs_to.push(arg);
+
+ }
+ }
+
+ protected finalize() {
+ if (this.ptr != 0) {
+ bindings.Router_free(this.ptr);
+ }
+ super.finalize();
+ }
+
+ static new_impl(arg: RouterInterface): Router {
+ 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 {
+ 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++) {
+ number first_hops_conv_16 = first_hops[q];
+ const first_hops_conv_16_hu_conv: ChannelDetails = new ChannelDetails(null, first_hops_conv_16);
+ first_hops_conv_16_hu_conv.ptrs_to.add(this);
+ first_hops_conv_16_arr[q] = first_hops_conv_16_hu_conv;
+ }
+ 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: number = ret != null ? ret.ptr : 0;
+ return result;
+ },
+
+
+ };
+ impl_holder.held = new Router (null, structImplementation);
+ }
+ }
+
+ export interface RouterInterface {
+ find_route(payer: Uint8Array, params: RouteParameters, 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, payer, 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);
+ 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); };
+ this.ptrs_to.add(scorer);
+ return ret_hu_conv;
+ }
+
+}
const impl_holder: LDKScoreHolder = new LDKScoreHolder();
let structImplementation = <bindings.LDKScore>{
// todo: in-line interface filling
- channel_penalty_msat (short_channel_id: number): number {
- number ret = arg.channel_penalty_msat(short_channel_id);
+ channel_penalty_msat (short_channel_id: number, source: number, target: number): number {
+ 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);
+ return ret;
+ },
+
+ payment_path_failed (path: number[], short_channel_id: 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_failed(path_conv_10_arr, short_channel_id);
+ },
+
+ write (): Uint8Array {
+ Uint8Array ret = arg.write();
return ret;
},
}
export interface ScoreInterface {
- channel_penalty_msat(short_channel_id: number): number;
+ channel_penalty_msat(short_channel_id: number, source: NodeId, target: NodeId): number;
+ payment_path_failed(path: RouteHop[], short_channel_id: number): void;
+ write(): Uint8Array;
}
class LDKScoreHolder {
held: Score;
}
- public number channel_penalty_msat(number short_channel_id) {
- number ret = bindings.Score_channel_penalty_msat(this.ptr, short_channel_id);
+ 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);
+ this.ptrs_to.add(source);
+ this.ptrs_to.add(target);
+ return ret;
+ }
+
+ public void payment_path_failed(RouteHop[] path, number short_channel_id) {
+ 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 Uint8Array write() {
+ Uint8Array ret = bindings.Score_write(this.ptr);
return ret;
}
bindings.Scorer_free(this.ptr);
}
}
- public static Scorer constructor_new(number base_penalty_msat) {
- number ret = bindings.Scorer_new(base_penalty_msat);
+ 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));
const ret_hu_conv: Scorer = new Scorer(null, ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
return ret_hu_conv;
return ret_hu_conv;
}
+ public Uint8Array write() {
+ Uint8Array ret = bindings.Scorer_write(this.ptr);
+ return ret;
+ }
+
+ public static Result_ScorerDecodeErrorZ constructor_read(Uint8Array ser) {
+ number ret = bindings.Scorer_read(ser);
+ Result_ScorerDecodeErrorZ ret_hu_conv = Result_ScorerDecodeErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
}
--- /dev/null
+
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+
+
+ export default class ScoringParameters extends CommonBase {
+ constructor(_dummy: object, ptr: number) {
+ super(ptr);
+ }
+
+
+ protected finalize() {
+ super.finalize();
+
+ if (this.ptr != 0) {
+ bindings.ScoringParameters_free(this.ptr);
+ }
+ }
+ public number get_base_penalty_msat() {
+ number ret = bindings.ScoringParameters_get_base_penalty_msat(this.ptr);
+ return ret;
+ }
+
+ public void set_base_penalty_msat(number val) {
+ bindings.ScoringParameters_set_base_penalty_msat(this.ptr, val);
+ }
+
+ public number get_failure_penalty_msat() {
+ number ret = bindings.ScoringParameters_get_failure_penalty_msat(this.ptr);
+ return ret;
+ }
+
+ public void set_failure_penalty_msat(number val) {
+ bindings.ScoringParameters_set_failure_penalty_msat(this.ptr, val);
+ }
+
+ public number get_failure_penalty_half_life() {
+ number ret = bindings.ScoringParameters_get_failure_penalty_half_life(this.ptr);
+ return ret;
+ }
+
+ public void set_failure_penalty_half_life(number val) {
+ 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);
+ const ret_hu_conv: ScoringParameters = new ScoringParameters(null, ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ return ret_hu_conv;
+ }
+
+ public Uint8Array write() {
+ Uint8Array ret = bindings.ScoringParameters_write(this.ptr);
+ return ret;
+ }
+
+ public static Result_ScoringParametersDecodeErrorZ constructor_read(Uint8Array ser) {
+ number ret = bindings.ScoringParameters_read(ser);
+ Result_ScoringParametersDecodeErrorZ ret_hu_conv = Result_ScoringParametersDecodeErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ public static ScoringParameters constructor_default() {
+ number ret = bindings.ScoringParameters_default();
+ const ret_hu_conv: ScoringParameters = new ScoringParameters(null, ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ return ret_hu_conv;
+ }
+
+}
return ret;
}
- public PaymentId get_b() {
- number ret = bindings.C2Tuple_PaymentHashPaymentIdZ_get_b(this.ptr);
- const ret_hu_conv: PaymentId = new PaymentId(null, ret);
- ret_hu_conv.ptrs_to.add(this);
- return ret_hu_conv;
+ public Uint8Array get_b() {
+ Uint8Array ret = bindings.C2Tuple_PaymentHashPaymentIdZ_get_b(this.ptr);
+ return ret;
}
public TwoTuple_PaymentHashPaymentIdZ clone() {
return ret_hu_conv;
}
- public static TwoTuple_PaymentHashPaymentIdZ constructor_new(Uint8Array a, PaymentId b) {
- number ret = bindings.C2Tuple_PaymentHashPaymentIdZ_new(a, b == null ? 0 : b.ptr & ~1);
+ public static TwoTuple_PaymentHashPaymentIdZ constructor_new(Uint8Array a, Uint8Array b) {
+ number ret = bindings.C2Tuple_PaymentHashPaymentIdZ_new(a, b);
TwoTuple_PaymentHashPaymentIdZ ret_hu_conv = new TwoTuple_PaymentHashPaymentIdZ(null, ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
return ret_hu_conv;
return ret;
}
- public static Result_RouteLightningErrorZ constructor_get_keysend_route(Uint8Array our_node_pubkey, NetworkGraph network, Uint8Array payee, ChannelDetails[] first_hops, RouteHint[] last_hops, number final_value_msat, number final_cltv, Logger logger, Score scorer) {
- number ret = bindings.get_keysend_route(our_node_pubkey, network == null ? 0 : network.ptr & ~1, payee, 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, last_hops != null ? Arrays.stream(last_hops).map(last_hops_conv_11 -> last_hops_conv_11 == null ? 0 : last_hops_conv_11.ptr & ~1).toArray(number[]::new) : null, final_value_msat, final_cltv, logger == null ? 0 : logger.ptr, scorer == null ? 0 : scorer.ptr);
- Result_RouteLightningErrorZ ret_hu_conv = Result_RouteLightningErrorZ.constr_from_ptr(ret);
- ret_hu_conv.ptrs_to.add(network);
- for (ChannelDetails first_hops_conv_16: first_hops) { ret_hu_conv.ptrs_to.add(first_hops_conv_16); };
- ret_hu_conv.ptrs_to.add(logger);
- ret_hu_conv.ptrs_to.add(scorer);
- return ret_hu_conv;
- }
-
- public static Result_RouteLightningErrorZ constructor_get_route(Uint8Array our_node_pubkey, NetworkGraph network, Uint8Array payee, InvoiceFeatures payee_features, ChannelDetails[] first_hops, RouteHint[] last_hops, number final_value_msat, number final_cltv, Logger logger, Score scorer) {
- number ret = bindings.get_route(our_node_pubkey, network == null ? 0 : network.ptr & ~1, payee, payee_features == null ? 0 : payee_features.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, last_hops != null ? Arrays.stream(last_hops).map(last_hops_conv_11 -> last_hops_conv_11 == null ? 0 : last_hops_conv_11.ptr & ~1).toArray(number[]::new) : null, final_value_msat, final_cltv, logger == null ? 0 : logger.ptr, scorer == null ? 0 : scorer.ptr);
+ public static Result_RouteLightningErrorZ constructor_find_route(Uint8Array our_node_pubkey, RouteParameters params, NetworkGraph network, ChannelDetails[] first_hops, Logger logger, Score scorer) {
+ number ret = bindings.find_route(our_node_pubkey, params == null ? 0 : params.ptr & ~1, network == null ? 0 : network.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, logger == null ? 0 : logger.ptr, scorer == null ? 0 : scorer.ptr);
Result_RouteLightningErrorZ ret_hu_conv = Result_RouteLightningErrorZ.constr_from_ptr(ret);
+ ret_hu_conv.ptrs_to.add(params);
ret_hu_conv.ptrs_to.add(network);
for (ChannelDetails first_hops_conv_16: first_hops) { ret_hu_conv.ptrs_to.add(first_hops_conv_16); };
ret_hu_conv.ptrs_to.add(logger);