/**
* An error when accessing the chain via [`Access`].
- *
- * [`Access`]: trait.Access.html
*/
public enum LDKAccessError {
LDKAccessError_UnknownChain,
public long msg;
SendShortIdsQuery(byte[] node_id, long msg) { this.node_id = node_id; this.msg = msg; }
}
+ public final static class SendReplyChannelRange extends LDKMessageSendEvent {
+ public byte[] node_id;
+ public long msg;
+ SendReplyChannelRange(byte[] node_id, long msg) { this.node_id = node_id; this.msg = msg; }
+ }
static native void init();
}
static { LDKMessageSendEvent.init(); }
void peer_disconnected(byte[] their_node_id, boolean no_connection_possible);
void peer_connected(byte[] their_node_id, long msg);
void handle_channel_reestablish(byte[] their_node_id, long msg);
+ void handle_channel_update(byte[] their_node_id, long msg);
void handle_error(byte[] their_node_id, long msg);
}
public static native long LDKChannelMessageHandler_new(LDKChannelMessageHandler impl, LDKMessageSendEventsProvider MessageSendEventsProvider);
public static native void ChannelMessageHandler_peer_connected(long this_arg, byte[] their_node_id, long msg);
// void ChannelMessageHandler_handle_channel_reestablish LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg
public static native void ChannelMessageHandler_handle_channel_reestablish(long this_arg, byte[] their_node_id, long msg);
+ // void ChannelMessageHandler_handle_channel_update LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelUpdate *NONNULL_PTR msg
+ public static native void ChannelMessageHandler_handle_channel_update(long this_arg, byte[] their_node_id, long msg);
// void ChannelMessageHandler_handle_error LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg
public static native void ChannelMessageHandler_handle_error(long this_arg, byte[] their_node_id, long msg);
public interface LDKRoutingMessageHandler {
public static native int ChannelConfig_get_fee_proportional_millionths(long this_ptr);
// void ChannelConfig_set_fee_proportional_millionths(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
public static native void ChannelConfig_set_fee_proportional_millionths(long this_ptr, int val);
+ // uint16_t ChannelConfig_get_cltv_expiry_delta(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
+ public static native short ChannelConfig_get_cltv_expiry_delta(long this_ptr);
+ // void ChannelConfig_set_cltv_expiry_delta(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint16_t val);
+ public static native void ChannelConfig_set_cltv_expiry_delta(long this_ptr, short val);
// bool ChannelConfig_get_announced_channel(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
public static native boolean ChannelConfig_get_announced_channel(long this_ptr);
// void ChannelConfig_set_announced_channel(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
public static native boolean ChannelConfig_get_commit_upfront_shutdown_pubkey(long this_ptr);
// void ChannelConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
public static native void ChannelConfig_set_commit_upfront_shutdown_pubkey(long this_ptr, boolean val);
- // MUST_USE_RES struct LDKChannelConfig ChannelConfig_new(uint32_t fee_proportional_millionths_arg, bool announced_channel_arg, bool commit_upfront_shutdown_pubkey_arg);
- public static native long ChannelConfig_new(int fee_proportional_millionths_arg, boolean announced_channel_arg, boolean commit_upfront_shutdown_pubkey_arg);
+ // MUST_USE_RES struct LDKChannelConfig ChannelConfig_new(uint32_t fee_proportional_millionths_arg, uint16_t cltv_expiry_delta_arg, bool announced_channel_arg, bool commit_upfront_shutdown_pubkey_arg);
+ public static native long ChannelConfig_new(int fee_proportional_millionths_arg, short cltv_expiry_delta_arg, boolean announced_channel_arg, boolean commit_upfront_shutdown_pubkey_arg);
// struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig);
public static native long ChannelConfig_clone(long orig);
// MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void);
public static native long ReplyShortChannelIdsEnd_read(byte[] ser);
// struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj);
public static native byte[] ReplyShortChannelIdsEnd_write(long obj);
+ // MUST_USE_RES uint32_t QueryChannelRange_end_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_arg);
+ public static native int QueryChannelRange_end_blocknum(long this_arg);
// struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser);
public static native long QueryChannelRange_read(byte[] ser);
// struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj);
* or used independently to monitor channels remotely. See the [module-level documentation] for
* details.
*
- * [`chain::Watch`]: ../trait.Watch.html
- * [`ChannelManager`]: ../../ln/channelmanager/struct.ChannelManager.html
- * [module-level documentation]: index.html
+ * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
+ * [module-level documentation]: crate::chain::chainmonitor
*/
@SuppressWarnings("unchecked") // We correctly assign various generic arrays
public class ChainMonitor extends CommonBase {
* calls must not exclude any transactions matching the new outputs nor any in-block
* descendants of such transactions. It is not necessary to re-fetch the block to obtain
* updated `txdata`.
- *
- * [`ChannelMonitor::block_connected`]: ../channelmonitor/struct.ChannelMonitor.html#method.block_connected
- * [`chain::Watch::release_pending_monitor_events`]: ../trait.Watch.html#tymethod.release_pending_monitor_events
- * [`chain::Filter`]: ../trait.Filter.html
*/
public void block_connected(byte[] header, TwoTuple<Long, byte[]>[] txdata, int height) {
bindings.ChainMonitor_block_connected(this.ptr, header, Arrays.stream(txdata).mapToLong(txdata_conv_24 -> bindings.C2Tuple_usizeTransactionZ_new(txdata_conv_24.a, txdata_conv_24.b)).toArray(), height);
* Dispatches to per-channel monitors, which are responsible for updating their on-chain view
* of a channel based on the disconnected block. See [`ChannelMonitor::block_disconnected`] for
* details.
- *
- * [`ChannelMonitor::block_disconnected`]: ../channelmonitor/struct.ChannelMonitor.html#method.block_disconnected
*/
public void block_disconnected(byte[] header, int disconnected_height) {
bindings.ChainMonitor_block_disconnected(this.ptr, header, disconnected_height);
* pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may
* always need to fetch full blocks absent another means for determining which blocks contain
* transactions relevant to the watched channels.
- *
- * [`chain::Filter`]: ../trait.Filter.html
*/
public static ChainMonitor constructor_new(Filter chain_source, BroadcasterInterface broadcaster, Logger logger, FeeEstimator feeest, Persist persister) {
long ret = bindings.ChainMonitor_new(chain_source == null ? 0 : chain_source.ptr, broadcaster == null ? 0 : broadcaster.ptr, logger == null ? 0 : logger.ptr, feeest == null ? 0 : feeest.ptr, persister == null ? 0 : persister.ptr);
bindings.ChannelConfig_set_fee_proportional_millionths(this.ptr, val);
}
+ /**
+ * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
+ * the channel this config applies to.
+ *
+ * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
+ * HTLC balance when a channel appears on-chain whereas
+ * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
+ * (non-HTLC-encumbered) balance.
+ *
+ * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
+ * we (or one of our watchtowers) MUST be online to check for broadcast of the current
+ * commitment transaction at least once per this many blocks (minus some margin to allow us
+ * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
+ * the spending transaction).
+ *
+ * Default value: 72 (12 hours at an average of 6 blocks/hour).
+ * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
+ * [`MIN_CLTV_EXPIRY_DELTA`] instead.
+ *
+ * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
+ */
+ public short get_cltv_expiry_delta() {
+ short ret = bindings.ChannelConfig_get_cltv_expiry_delta(this.ptr);
+ return ret;
+ }
+
+ /**
+ * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
+ * the channel this config applies to.
+ *
+ * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
+ * HTLC balance when a channel appears on-chain whereas
+ * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
+ * (non-HTLC-encumbered) balance.
+ *
+ * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
+ * we (or one of our watchtowers) MUST be online to check for broadcast of the current
+ * commitment transaction at least once per this many blocks (minus some margin to allow us
+ * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
+ * the spending transaction).
+ *
+ * Default value: 72 (12 hours at an average of 6 blocks/hour).
+ * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
+ * [`MIN_CLTV_EXPIRY_DELTA`] instead.
+ *
+ * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
+ */
+ public void set_cltv_expiry_delta(short val) {
+ bindings.ChannelConfig_set_cltv_expiry_delta(this.ptr, val);
+ }
+
/**
* Set to announce the channel publicly and notify all nodes that they can route via this
* channel.
/**
* Constructs a new ChannelConfig given each field
*/
- public static ChannelConfig constructor_new(int fee_proportional_millionths_arg, boolean announced_channel_arg, boolean commit_upfront_shutdown_pubkey_arg) {
- long ret = bindings.ChannelConfig_new(fee_proportional_millionths_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg);
+ public static ChannelConfig constructor_new(int fee_proportional_millionths_arg, short cltv_expiry_delta_arg, boolean announced_channel_arg, boolean commit_upfront_shutdown_pubkey_arg) {
+ long ret = bindings.ChannelConfig_new(fee_proportional_millionths_arg, cltv_expiry_delta_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg);
ChannelConfig ret_hu_conv = new ChannelConfig(null, ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
return ret_hu_conv;
}
/**
- * Creates features known by the implementation as defined by [`T::KNOWN_FEATURE_FLAGS`].
- *
- * [`T::KNOWN_FEATURE_FLAGS`]: sealed/trait.Context.html#associatedconstant.KNOWN_FEATURE_FLAGS
+ * Creates a Features with the bits set which are known by the implementation
*/
public static ChannelFeatures constructor_known() {
long ret = bindings.ChannelFeatures_known();
}
/**
- * Set to the amount of time we require our counterparty to wait to claim their money.
+ * Set to the number of blocks we require our counterparty to wait to claim their money (ie
+ * the number of blocks we have to punish our counterparty if they broadcast a revoked
+ * transaction).
*
- * It's one of the main parameter of our security model. We (or one of our watchtowers) MUST
- * be online to check for peer having broadcast a revoked transaction to steal our funds
- * at least once every our_to_self_delay blocks.
+ * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
+ * be online to check for revoked transactions on-chain at least once every our_to_self_delay
+ * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
+ * possibly with time in between to RBF the spending transaction).
*
* Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
* case of an honest unilateral channel close, which implicitly decrease the economic value of
* our channel.
*
- * Default value: BREAKDOWN_TIMEOUT (currently 144), we enforce it as a minimum at channel
- * opening so you can tweak config to ask for more security, not less.
+ * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
+ * can tweak config to ask for more security, not less.
*/
public short get_our_to_self_delay() {
short ret = bindings.ChannelHandshakeConfig_get_our_to_self_delay(this.ptr);
}
/**
- * Set to the amount of time we require our counterparty to wait to claim their money.
+ * Set to the number of blocks we require our counterparty to wait to claim their money (ie
+ * the number of blocks we have to punish our counterparty if they broadcast a revoked
+ * transaction).
*
- * It's one of the main parameter of our security model. We (or one of our watchtowers) MUST
- * be online to check for peer having broadcast a revoked transaction to steal our funds
- * at least once every our_to_self_delay blocks.
+ * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
+ * be online to check for revoked transactions on-chain at least once every our_to_self_delay
+ * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
+ * possibly with time in between to RBF the spending transaction).
*
* Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
* case of an honest unilateral channel close, which implicitly decrease the economic value of
* our channel.
*
- * Default value: BREAKDOWN_TIMEOUT (currently 144), we enforce it as a minimum at channel
- * opening so you can tweak config to ask for more security, not less.
+ * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
+ * can tweak config to ask for more security, not less.
*/
public void set_our_to_self_delay(short val) {
bindings.ChannelHandshakeConfig_set_our_to_self_delay(this.ptr, val);
* Handle an incoming channel_reestablish message from the given peer.
*/
void handle_channel_reestablish(byte[] their_node_id, ChannelReestablish msg);
+ /**
+ * Handle an incoming channel update from the given peer.
+ */
+ void handle_channel_update(byte[] their_node_id, ChannelUpdate msg);
/**
* Handle an incoming error message from the given peer.
*/
ChannelReestablish 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);
+ 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);
arg.handle_error(their_node_id, msg_hu_conv);
this.ptrs_to.add(msg);
}
+ /**
+ * Handle an incoming channel update from the given peer.
+ */
+ public void handle_channel_update(byte[] their_node_id, ChannelUpdate msg) {
+ bindings.ChannelMessageHandler_handle_channel_update(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1);
+ this.ptrs_to.add(msg);
+ }
+
/**
* Handle an incoming error message from the given peer.
*/
/**
* Get the list of HTLCs who's status has been updated on chain. This should be called by
* ChannelManager via [`chain::Watch::release_pending_monitor_events`].
- *
- * [`chain::Watch::release_pending_monitor_events`]: ../trait.Watch.html#tymethod.release_pending_monitor_events
*/
public MonitorEvent[] get_and_clear_pending_monitor_events() {
long[] ret = bindings.ChannelMonitor_get_and_clear_pending_monitor_events(this.ptr);
* The only instance where update_id values are not strictly increasing is the case where we
* allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
* its docs for more details.
- *
- * [`CLOSED_CHANNEL_UPDATE_ID`]: constant.CLOSED_CHANNEL_UPDATE_ID.html
*/
public long get_update_id() {
long ret = bindings.ChannelMonitorUpdate_get_update_id(this.ptr);
* The only instance where update_id values are not strictly increasing is the case where we
* allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
* its docs for more details.
- *
- * [`CLOSED_CHANNEL_UPDATE_ID`]: constant.CLOSED_CHANNEL_UPDATE_ID.html
*/
public void set_update_id(long val) {
bindings.ChannelMonitorUpdate_set_update_id(this.ptr, val);
*
* Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter`
* should not block on I/O. Implementations should instead queue the newly monitored data to be
- * processed later. Then, in order to block until the data has been processed, any `Watch`
+ * processed later. Then, in order to block until the data has been processed, any [`Watch`]
* invocation that has called the `Filter` must return [`TemporaryFailure`].
*
- * [`Watch`]: trait.Watch.html
- * [`TemporaryFailure`]: channelmonitor/enum.ChannelMonitorUpdateErr.html#variant.TemporaryFailure
+ * [`TemporaryFailure`]: channelmonitor::ChannelMonitorUpdateErr::TemporaryFailure
* [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki
* [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
*/
* Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on
* chain. Used to update the corresponding HTLC in the backward channel. Failing to pass the
* preimage claim backward will lead to loss of funds.
- *
- * [`chain::Watch`]: ../trait.Watch.html
*/
@SuppressWarnings("unchecked") // We correctly assign various generic arrays
public class HTLCUpdate extends CommonBase {
}
/**
- * Creates features known by the implementation as defined by [`T::KNOWN_FEATURE_FLAGS`].
- *
- * [`T::KNOWN_FEATURE_FLAGS`]: sealed/trait.Context.html#associatedconstant.KNOWN_FEATURE_FLAGS
+ * Creates a Features with the bits set which are known by the implementation
*/
public static InitFeatures constructor_known() {
long ret = bindings.InitFeatures_known();
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+
+
+/**
+ * Features used within an invoice.
+ */
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class InvoiceFeatures extends CommonBase {
+ InvoiceFeatures(Object _dummy, long ptr) { super(ptr); }
+ @Override @SuppressWarnings("deprecation")
+ protected void finalize() throws Throwable {
+ super.finalize();
+ if (ptr != 0) { bindings.InvoiceFeatures_free(ptr); }
+ }
+
+ /**
+ * Creates a copy of the InvoiceFeatures
+ */
+ public InvoiceFeatures clone() {
+ long ret = bindings.InvoiceFeatures_clone(this.ptr);
+ InvoiceFeatures ret_hu_conv = new InvoiceFeatures(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Create a blank Features with no features set
+ */
+ public static InvoiceFeatures constructor_empty() {
+ long ret = bindings.InvoiceFeatures_empty();
+ InvoiceFeatures ret_hu_conv = new InvoiceFeatures(null, ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Creates a Features with the bits set which are known by the implementation
+ */
+ public static InvoiceFeatures constructor_known() {
+ long ret = bindings.InvoiceFeatures_known();
+ InvoiceFeatures ret_hu_conv = new InvoiceFeatures(null, ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Serialize the InvoiceFeatures object into a byte array which can be read by InvoiceFeatures_read
+ */
+ public byte[] write() {
+ byte[] ret = bindings.InvoiceFeatures_write(this.ptr);
+ return ret;
+ }
+
+ /**
+ * Read a InvoiceFeatures from a byte array, created by InvoiceFeatures_write
+ */
+ public static Result_InvoiceFeaturesDecodeErrorZ constructor_read(byte[] ser) {
+ long ret = bindings.InvoiceFeatures_read(ser);
+ Result_InvoiceFeaturesDecodeErrorZ ret_hu_conv = Result_InvoiceFeaturesDecodeErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+}
if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendShortIdsQuery.class) {
return new SendShortIdsQuery(ptr, (bindings.LDKMessageSendEvent.SendShortIdsQuery)raw_val);
}
+ if (raw_val.getClass() == bindings.LDKMessageSendEvent.SendReplyChannelRange.class) {
+ return new SendReplyChannelRange(ptr, (bindings.LDKMessageSendEvent.SendReplyChannelRange)raw_val);
+ }
assert false; return null; // Unreachable without extending the (internal) bindings interface
}
this.msg = msg_hu_conv;
}
}
+ public final static class SendReplyChannelRange extends MessageSendEvent {
+ public final byte[] node_id;
+ public final ReplyChannelRange msg;
+ private SendReplyChannelRange(long ptr, bindings.LDKMessageSendEvent.SendReplyChannelRange obj) {
+ super(null, ptr);
+ this.node_id = obj.node_id;
+ long msg = obj.msg;
+ ReplyChannelRange msg_hu_conv = new ReplyChannelRange(null, msg);
+ msg_hu_conv.ptrs_to.add(this);
+ this.msg = msg_hu_conv;
+ }
+ }
}
}
/**
- * Creates features known by the implementation as defined by [`T::KNOWN_FEATURE_FLAGS`].
- *
- * [`T::KNOWN_FEATURE_FLAGS`]: sealed/trait.Context.html#associatedconstant.KNOWN_FEATURE_FLAGS
+ * Creates a Features with the bits set which are known by the implementation
*/
public static NodeFeatures constructor_known() {
long ret = bindings.NodeFeatures_known();
* stored channel data). Note that you **must** persist every new monitor to
* disk. See the `Persist` trait documentation for more details.
*
- * See [`ChannelMonitor::serialize_for_disk`] for writing out a `ChannelMonitor`,
+ * See [`ChannelMonitor::write`] for writing out a `ChannelMonitor`,
* and [`ChannelMonitorUpdateErr`] for requirements when returning errors.
- *
- * [`ChannelMonitor::serialize_for_disk`]: struct.ChannelMonitor.html#method.serialize_for_disk
- * [`ChannelMonitorUpdateErr`]: enum.ChannelMonitorUpdateErr.html
*/
Result_NoneChannelMonitorUpdateErrZ persist_new_channel(OutPoint id, ChannelMonitor data);
/**
* them in batches. The size of each monitor grows `O(number of state updates)`
* whereas updates are small and `O(1)`.
*
- * See [`ChannelMonitor::serialize_for_disk`] for writing out a `ChannelMonitor`,
+ * See [`ChannelMonitor::write`] for writing out a `ChannelMonitor`,
* [`ChannelMonitorUpdate::write`] for writing out an update, and
* [`ChannelMonitorUpdateErr`] for requirements when returning errors.
- *
- * [`ChannelMonitor::update_monitor`]: struct.ChannelMonitor.html#impl-1
- * [`ChannelMonitor::serialize_for_disk`]: struct.ChannelMonitor.html#method.serialize_for_disk
- * [`ChannelMonitorUpdate::write`]: struct.ChannelMonitorUpdate.html#method.write
- * [`ChannelMonitorUpdateErr`]: enum.ChannelMonitorUpdateErr.html
*/
Result_NoneChannelMonitorUpdateErrZ update_persisted_channel(OutPoint id, ChannelMonitorUpdate update, ChannelMonitor data);
}
* stored channel data). Note that you **must** persist every new monitor to
* disk. See the `Persist` trait documentation for more details.
*
- * See [`ChannelMonitor::serialize_for_disk`] for writing out a `ChannelMonitor`,
+ * See [`ChannelMonitor::write`] for writing out a `ChannelMonitor`,
* and [`ChannelMonitorUpdateErr`] for requirements when returning errors.
- *
- * [`ChannelMonitor::serialize_for_disk`]: struct.ChannelMonitor.html#method.serialize_for_disk
- * [`ChannelMonitorUpdateErr`]: enum.ChannelMonitorUpdateErr.html
*/
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);
* them in batches. The size of each monitor grows `O(number of state updates)`
* whereas updates are small and `O(1)`.
*
- * See [`ChannelMonitor::serialize_for_disk`] for writing out a `ChannelMonitor`,
+ * See [`ChannelMonitor::write`] for writing out a `ChannelMonitor`,
* [`ChannelMonitorUpdate::write`] for writing out an update, and
* [`ChannelMonitorUpdateErr`] for requirements when returning errors.
- *
- * [`ChannelMonitor::update_monitor`]: struct.ChannelMonitor.html#impl-1
- * [`ChannelMonitor::serialize_for_disk`]: struct.ChannelMonitor.html#method.serialize_for_disk
- * [`ChannelMonitorUpdate::write`]: struct.ChannelMonitorUpdate.html#method.write
- * [`ChannelMonitorUpdateErr`]: enum.ChannelMonitorUpdateErr.html
*/
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);
return ret_hu_conv;
}
+ /**
+ * \n\t * Calculates the overflow safe ending block height for the query.\n\t * Overflow returns `0xffffffff`, otherwise returns `first_blocknum + number_of_blocks`\n\t
+ */
+ public int end_blocknum() {
+ int ret = bindings.QueryChannelRange_end_blocknum(this.ptr);
+ return ret;
+ }
+
/**
* Read a QueryChannelRange from a byte array, created by QueryChannelRange_write
*/
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+
+public class Result_InvoiceFeaturesDecodeErrorZ extends CommonBase {
+ private Result_InvoiceFeaturesDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_InvoiceFeaturesDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_InvoiceFeaturesDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_InvoiceFeaturesDecodeErrorZ_result_ok(ptr)) {
+ return new Result_InvoiceFeaturesDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_InvoiceFeaturesDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_InvoiceFeaturesDecodeErrorZ_OK extends Result_InvoiceFeaturesDecodeErrorZ {
+ public final InvoiceFeatures res;
+ 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);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_InvoiceFeaturesDecodeErrorZ_OK(InvoiceFeatures res) {
+ this(null, bindings.CResult_InvoiceFeaturesDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_InvoiceFeaturesDecodeErrorZ_Err extends Result_InvoiceFeaturesDecodeErrorZ {
+ public final DecodeError err;
+ 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);
+ err_hu_conv.ptrs_to.add(this);
+ this.err = err_hu_conv;
+ }
+ public Result_InvoiceFeaturesDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_InvoiceFeaturesDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
}
/**
- * The number of blocks to subtract from incoming HTLC cltv_expiry values
+ * The number of blocks such that if:
+ * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
+ * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
+ * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
+ * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
+ * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
+ * forwarding. Note that the HTLC sender is the one who originally sets this value when
+ * constructing the route.
*/
public short get_cltv_expiry_delta() {
short ret = bindings.UnsignedChannelUpdate_get_cltv_expiry_delta(this.ptr);
}
/**
- * The number of blocks to subtract from incoming HTLC cltv_expiry values
+ * The number of blocks such that if:
+ * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
+ * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
+ * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
+ * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
+ * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
+ * forwarding. Note that the HTLC sender is the one who originally sets this value when
+ * constructing the route.
*/
public void set_cltv_expiry_delta(short val) {
bindings.UnsignedChannelUpdate_set_cltv_expiry_delta(this.ptr, val);
* funds in the channel. See [`ChannelMonitorUpdateErr`] for more details about how to handle
* multiple instances.
*
- * [`ChannelMonitor`]: channelmonitor/struct.ChannelMonitor.html
- * [`ChannelMonitorUpdateErr`]: channelmonitor/enum.ChannelMonitorUpdateErr.html
- * [`PermanentFailure`]: channelmonitor/enum.ChannelMonitorUpdateErr.html#variant.PermanentFailure
+ * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
+ * [`ChannelMonitorUpdateErr`]: channelmonitor::ChannelMonitorUpdateErr
+ * [`PermanentFailure`]: channelmonitor::ChannelMonitorUpdateErr::PermanentFailure
*/
@SuppressWarnings("unchecked") // We correctly assign various generic arrays
public class Watch extends CommonBase {
* with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means
* calling [`block_connected`] and [`block_disconnected`] on the monitor.
*
- * [`get_outputs_to_watch`]: channelmonitor/struct.ChannelMonitor.html#method.get_outputs_to_watch
- * [`block_connected`]: channelmonitor/struct.ChannelMonitor.html#method.block_connected
- * [`block_disconnected`]: channelmonitor/struct.ChannelMonitor.html#method.block_disconnected
+ * [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch
+ * [`block_connected`]: channelmonitor::ChannelMonitor::block_connected
+ * [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected
*/
Result_NoneChannelMonitorUpdateErrZ watch_channel(OutPoint funding_txo, ChannelMonitor monitor);
/**
* Implementations must call [`update_monitor`] with the given update. See
* [`ChannelMonitorUpdateErr`] for invariants around returning an error.
*
- * [`update_monitor`]: channelmonitor/struct.ChannelMonitor.html#method.update_monitor
- * [`ChannelMonitorUpdateErr`]: channelmonitor/enum.ChannelMonitorUpdateErr.html
+ * [`update_monitor`]: channelmonitor::ChannelMonitor::update_monitor
+ * [`ChannelMonitorUpdateErr`]: channelmonitor::ChannelMonitorUpdateErr
*/
Result_NoneChannelMonitorUpdateErrZ update_channel(OutPoint funding_txo, ChannelMonitorUpdate update);
/**
* with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means
* calling [`block_connected`] and [`block_disconnected`] on the monitor.
*
- * [`get_outputs_to_watch`]: channelmonitor/struct.ChannelMonitor.html#method.get_outputs_to_watch
- * [`block_connected`]: channelmonitor/struct.ChannelMonitor.html#method.block_connected
- * [`block_disconnected`]: channelmonitor/struct.ChannelMonitor.html#method.block_disconnected
+ * [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch
+ * [`block_connected`]: channelmonitor::ChannelMonitor::block_connected
+ * [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected
*/
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);
* Implementations must call [`update_monitor`] with the given update. See
* [`ChannelMonitorUpdateErr`] for invariants around returning an error.
*
- * [`update_monitor`]: channelmonitor/struct.ChannelMonitor.html#method.update_monitor
- * [`ChannelMonitorUpdateErr`]: channelmonitor/enum.ChannelMonitorUpdateErr.html
+ * [`update_monitor`]: channelmonitor::ChannelMonitor::update_monitor
+ * [`ChannelMonitorUpdateErr`]: channelmonitor::ChannelMonitorUpdateErr
*/
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);
static jmethodID LDKMessageSendEvent_SendChannelRangeQuery_meth = NULL;
static jclass LDKMessageSendEvent_SendShortIdsQuery_class = NULL;
static jmethodID LDKMessageSendEvent_SendShortIdsQuery_meth = NULL;
+static jclass LDKMessageSendEvent_SendReplyChannelRange_class = NULL;
+static jmethodID LDKMessageSendEvent_SendReplyChannelRange_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMessageSendEvent_init (JNIEnv *env, jclass clz) {
LDKMessageSendEvent_SendAcceptChannel_class =
(*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendAcceptChannel;"));
CHECK(LDKMessageSendEvent_SendShortIdsQuery_class != NULL);
LDKMessageSendEvent_SendShortIdsQuery_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendShortIdsQuery_class, "<init>", "([BJ)V");
CHECK(LDKMessageSendEvent_SendShortIdsQuery_meth != NULL);
+ LDKMessageSendEvent_SendReplyChannelRange_class =
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendReplyChannelRange;"));
+ CHECK(LDKMessageSendEvent_SendReplyChannelRange_class != NULL);
+ LDKMessageSendEvent_SendReplyChannelRange_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendReplyChannelRange_class, "<init>", "([BJ)V");
+ CHECK(LDKMessageSendEvent_SendReplyChannelRange_meth != NULL);
}
JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
LDKMessageSendEvent *obj = (LDKMessageSendEvent*)ptr;
long msg_ref = (long)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;
+ CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long msg_ref = (long)msg_var.inner & ~1;
+ return (*env)->NewObject(env, LDKMessageSendEvent_SendReplyChannelRange_class, LDKMessageSendEvent_SendReplyChannelRange_meth, node_id_arr, msg_ref);
+ }
default: abort();
}
}
FREE(j_calls);
}
}
-LDKPublicKey get_per_commitment_point_jcall(const void* this_arg, uint64_t idx) {
+LDKPublicKey get_per_commitment_point_LDKSign_jcall(const void* this_arg, uint64_t idx) {
LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
(*env)->GetByteArrayRegion(env, ret, 0, 33, ret_ref.compressed_form);
return ret_ref;
}
-LDKThirtyTwoBytes release_commitment_secret_jcall(const void* this_arg, uint64_t idx) {
+LDKThirtyTwoBytes release_commitment_secret_LDKSign_jcall(const void* this_arg, uint64_t idx) {
LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
(*env)->GetByteArrayRegion(env, ret, 0, 32, ret_ref.data);
return ret_ref;
}
-LDKThirtyTwoBytes channel_keys_id_jcall(const void* this_arg) {
+LDKThirtyTwoBytes channel_keys_id_LDKSign_jcall(const void* this_arg) {
LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
(*env)->GetByteArrayRegion(env, ret, 0, 32, ret_ref.data);
return ret_ref;
}
-LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment_jcall(const void* this_arg, const LDKCommitmentTransaction * commitment_tx) {
+LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment_LDKSign_jcall(const void* this_arg, const LDKCommitmentTransaction * commitment_tx) {
LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)ret);
return ret_conv;
}
-LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htlcs_jcall(const void* this_arg, const LDKHolderCommitmentTransaction * commitment_tx) {
+LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htlcs_LDKSign_jcall(const void* this_arg, const LDKHolderCommitmentTransaction * commitment_tx) {
LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)ret);
return ret_conv;
}
-LDKCResult_SignatureNoneZ sign_justice_transaction_jcall(const void* this_arg, LDKTransaction justice_tx, uintptr_t input, uint64_t amount, const uint8_t (* per_commitment_key)[32], const LDKHTLCOutputInCommitment * htlc) {
+LDKCResult_SignatureNoneZ sign_justice_transaction_LDKSign_jcall(const void* this_arg, LDKTransaction justice_tx, uintptr_t input, uint64_t amount, const uint8_t (* per_commitment_key)[32], const LDKHTLCOutputInCommitment * htlc) {
LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)ret);
return ret_conv;
}
-LDKCResult_SignatureNoneZ sign_counterparty_htlc_transaction_jcall(const void* this_arg, LDKTransaction htlc_tx, uintptr_t input, uint64_t amount, LDKPublicKey per_commitment_point, const LDKHTLCOutputInCommitment * htlc) {
+LDKCResult_SignatureNoneZ sign_counterparty_htlc_transaction_LDKSign_jcall(const void* this_arg, LDKTransaction htlc_tx, uintptr_t input, uint64_t amount, LDKPublicKey per_commitment_point, const LDKHTLCOutputInCommitment * htlc) {
LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)ret);
return ret_conv;
}
-LDKCResult_SignatureNoneZ sign_closing_transaction_jcall(const void* this_arg, LDKTransaction closing_tx) {
+LDKCResult_SignatureNoneZ sign_closing_transaction_LDKSign_jcall(const void* this_arg, LDKTransaction closing_tx) {
LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)ret);
return ret_conv;
}
-LDKCResult_SignatureNoneZ sign_channel_announcement_jcall(const void* this_arg, const LDKUnsignedChannelAnnouncement * msg) {
+LDKCResult_SignatureNoneZ sign_channel_announcement_LDKSign_jcall(const void* this_arg, const LDKUnsignedChannelAnnouncement * msg) {
LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)ret);
return ret_conv;
}
-void ready_channel_jcall(void* this_arg, const LDKChannelTransactionParameters * channel_parameters) {
+void ready_channel_LDKSign_jcall(void* this_arg, const LDKChannelTransactionParameters * channel_parameters) {
LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
CHECK(obj != NULL);
return (*env)->CallVoidMethod(env, obj, j_calls->ready_channel_meth, channel_parameters_ref);
}
-LDKCVec_u8Z write_jcall(const void* this_arg) {
+LDKCVec_u8Z write_LDKSign_jcall(const void* this_arg) {
LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
LDKSign ret = {
.this_arg = (void*) calls,
- .get_per_commitment_point = get_per_commitment_point_jcall,
- .release_commitment_secret = release_commitment_secret_jcall,
- .channel_keys_id = channel_keys_id_jcall,
- .sign_counterparty_commitment = sign_counterparty_commitment_jcall,
- .sign_holder_commitment_and_htlcs = sign_holder_commitment_and_htlcs_jcall,
- .sign_justice_transaction = sign_justice_transaction_jcall,
- .sign_counterparty_htlc_transaction = sign_counterparty_htlc_transaction_jcall,
- .sign_closing_transaction = sign_closing_transaction_jcall,
- .sign_channel_announcement = sign_channel_announcement_jcall,
- .ready_channel = ready_channel_jcall,
+ .get_per_commitment_point = get_per_commitment_point_LDKSign_jcall,
+ .release_commitment_secret = release_commitment_secret_LDKSign_jcall,
+ .channel_keys_id = channel_keys_id_LDKSign_jcall,
+ .sign_counterparty_commitment = sign_counterparty_commitment_LDKSign_jcall,
+ .sign_holder_commitment_and_htlcs = sign_holder_commitment_and_htlcs_LDKSign_jcall,
+ .sign_justice_transaction = sign_justice_transaction_LDKSign_jcall,
+ .sign_counterparty_htlc_transaction = sign_counterparty_htlc_transaction_LDKSign_jcall,
+ .sign_closing_transaction = sign_closing_transaction_LDKSign_jcall,
+ .sign_channel_announcement = sign_channel_announcement_LDKSign_jcall,
+ .ready_channel = ready_channel_LDKSign_jcall,
.clone = LDKSign_JCalls_clone,
- .write = write_jcall,
+ .write = write_LDKSign_jcall,
.free = LDKSign_JCalls_free,
.pubkeys = pubkeys_conv,
.set_pubkeys = NULL,
FREE(j_calls);
}
}
-LDKCResult_NoneChannelMonitorUpdateErrZ watch_channel_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitor monitor) {
+LDKCResult_NoneChannelMonitorUpdateErrZ watch_channel_LDKWatch_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitor monitor) {
LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)ret);
return ret_conv;
}
-LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitorUpdate update) {
+LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_LDKWatch_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitorUpdate update) {
LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)ret);
return ret_conv;
}
-LDKCVec_MonitorEventZ release_pending_monitor_events_jcall(const void* this_arg) {
+LDKCVec_MonitorEventZ release_pending_monitor_events_LDKWatch_jcall(const void* this_arg) {
LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
LDKWatch ret = {
.this_arg = (void*) calls,
- .watch_channel = watch_channel_jcall,
- .update_channel = update_channel_jcall,
- .release_pending_monitor_events = release_pending_monitor_events_jcall,
+ .watch_channel = watch_channel_LDKWatch_jcall,
+ .update_channel = update_channel_LDKWatch_jcall,
+ .release_pending_monitor_events = release_pending_monitor_events_LDKWatch_jcall,
.free = LDKWatch_JCalls_free,
};
return ret;
FREE(j_calls);
}
}
-void broadcast_transaction_jcall(const void* this_arg, LDKTransaction tx) {
+void broadcast_transaction_LDKBroadcasterInterface_jcall(const void* this_arg, LDKTransaction tx) {
LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
LDKBroadcasterInterface ret = {
.this_arg = (void*) calls,
- .broadcast_transaction = broadcast_transaction_jcall,
+ .broadcast_transaction = broadcast_transaction_LDKBroadcasterInterface_jcall,
.free = LDKBroadcasterInterface_JCalls_free,
};
return ret;
FREE(j_calls);
}
}
-LDKSecretKey get_node_secret_jcall(const void* this_arg) {
+LDKSecretKey get_node_secret_LDKKeysInterface_jcall(const void* this_arg) {
LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
(*env)->GetByteArrayRegion(env, ret, 0, 32, ret_ref.bytes);
return ret_ref;
}
-LDKCVec_u8Z get_destination_script_jcall(const void* this_arg) {
+LDKCVec_u8Z get_destination_script_LDKKeysInterface_jcall(const void* this_arg) {
LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
(*env)->GetByteArrayRegion(env, ret, 0, ret_ref.datalen, ret_ref.data);
return ret_ref;
}
-LDKPublicKey get_shutdown_pubkey_jcall(const void* this_arg) {
+LDKPublicKey get_shutdown_pubkey_LDKKeysInterface_jcall(const void* this_arg) {
LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
(*env)->GetByteArrayRegion(env, ret, 0, 33, ret_ref.compressed_form);
return ret_ref;
}
-LDKSign get_channel_signer_jcall(const void* this_arg, bool inbound, uint64_t channel_value_satoshis) {
+LDKSign get_channel_signer_LDKKeysInterface_jcall(const void* this_arg, bool inbound, uint64_t channel_value_satoshis) {
LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
ret_conv = Sign_clone(ret);
return ret_conv;
}
-LDKThirtyTwoBytes get_secure_random_bytes_jcall(const void* this_arg) {
+LDKThirtyTwoBytes get_secure_random_bytes_LDKKeysInterface_jcall(const void* this_arg) {
LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
(*env)->GetByteArrayRegion(env, ret, 0, 32, ret_ref.data);
return ret_ref;
}
-LDKCResult_SignDecodeErrorZ read_chan_signer_jcall(const void* this_arg, LDKu8slice reader) {
+LDKCResult_SignDecodeErrorZ read_chan_signer_LDKKeysInterface_jcall(const void* this_arg, LDKu8slice reader) {
LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
LDKKeysInterface ret = {
.this_arg = (void*) calls,
- .get_node_secret = get_node_secret_jcall,
- .get_destination_script = get_destination_script_jcall,
- .get_shutdown_pubkey = get_shutdown_pubkey_jcall,
- .get_channel_signer = get_channel_signer_jcall,
- .get_secure_random_bytes = get_secure_random_bytes_jcall,
- .read_chan_signer = read_chan_signer_jcall,
+ .get_node_secret = get_node_secret_LDKKeysInterface_jcall,
+ .get_destination_script = get_destination_script_LDKKeysInterface_jcall,
+ .get_shutdown_pubkey = get_shutdown_pubkey_LDKKeysInterface_jcall,
+ .get_channel_signer = get_channel_signer_LDKKeysInterface_jcall,
+ .get_secure_random_bytes = get_secure_random_bytes_LDKKeysInterface_jcall,
+ .read_chan_signer = read_chan_signer_LDKKeysInterface_jcall,
.free = LDKKeysInterface_JCalls_free,
};
return ret;
FREE(j_calls);
}
}
-uint32_t get_est_sat_per_1000_weight_jcall(const void* this_arg, LDKConfirmationTarget confirmation_target) {
+uint32_t get_est_sat_per_1000_weight_LDKFeeEstimator_jcall(const void* this_arg, LDKConfirmationTarget confirmation_target) {
LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
LDKFeeEstimator ret = {
.this_arg = (void*) calls,
- .get_est_sat_per_1000_weight = get_est_sat_per_1000_weight_jcall,
+ .get_est_sat_per_1000_weight = get_est_sat_per_1000_weight_LDKFeeEstimator_jcall,
.free = LDKFeeEstimator_JCalls_free,
};
return ret;
FREE(j_calls);
}
}
-void log_jcall(const void* this_arg, const char* record) {
+void log_LDKLogger_jcall(const void* this_arg, const char* record) {
LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
LDKLogger ret = {
.this_arg = (void*) calls,
- .log = log_jcall,
+ .log = log_LDKLogger_jcall,
.free = LDKLogger_JCalls_free,
};
return ret;
FREE(j_calls);
}
}
-LDKCVec_MessageSendEventZ get_and_clear_pending_msg_events_jcall(const void* this_arg) {
+LDKCVec_MessageSendEventZ get_and_clear_pending_msg_events_LDKMessageSendEventsProvider_jcall(const void* this_arg) {
LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
LDKMessageSendEventsProvider ret = {
.this_arg = (void*) calls,
- .get_and_clear_pending_msg_events = get_and_clear_pending_msg_events_jcall,
+ .get_and_clear_pending_msg_events = get_and_clear_pending_msg_events_LDKMessageSendEventsProvider_jcall,
.free = LDKMessageSendEventsProvider_JCalls_free,
};
return ret;
FREE(j_calls);
}
}
-LDKCVec_EventZ get_and_clear_pending_events_jcall(const void* this_arg) {
+LDKCVec_EventZ get_and_clear_pending_events_LDKEventsProvider_jcall(const void* this_arg) {
LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
LDKEventsProvider ret = {
.this_arg = (void*) calls,
- .get_and_clear_pending_events = get_and_clear_pending_events_jcall,
+ .get_and_clear_pending_events = get_and_clear_pending_events_LDKEventsProvider_jcall,
.free = LDKEventsProvider_JCalls_free,
};
return ret;
FREE(j_calls);
}
}
-LDKCResult_TxOutAccessErrorZ get_utxo_jcall(const void* this_arg, const uint8_t (* genesis_hash)[32], uint64_t short_channel_id) {
+LDKCResult_TxOutAccessErrorZ get_utxo_LDKAccess_jcall(const void* this_arg, const uint8_t (* genesis_hash)[32], uint64_t short_channel_id) {
LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
LDKAccess ret = {
.this_arg = (void*) calls,
- .get_utxo = get_utxo_jcall,
+ .get_utxo = get_utxo_LDKAccess_jcall,
.free = LDKAccess_JCalls_free,
};
return ret;
FREE(j_calls);
}
}
-void block_connected_jcall(const void* this_arg, LDKu8slice block, uint32_t height) {
+void block_connected_LDKListen_jcall(const void* this_arg, LDKu8slice block, uint32_t height) {
LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
CHECK(obj != NULL);
return (*env)->CallVoidMethod(env, obj, j_calls->block_connected_meth, block_arr, height);
}
-void block_disconnected_jcall(const void* this_arg, const uint8_t (* header)[80], uint32_t height) {
+void block_disconnected_LDKListen_jcall(const void* this_arg, const uint8_t (* header)[80], uint32_t height) {
LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
LDKListen ret = {
.this_arg = (void*) calls,
- .block_connected = block_connected_jcall,
- .block_disconnected = block_disconnected_jcall,
+ .block_connected = block_connected_LDKListen_jcall,
+ .block_disconnected = block_disconnected_LDKListen_jcall,
.free = LDKListen_JCalls_free,
};
return ret;
FREE(j_calls);
}
}
-void register_tx_jcall(const void* this_arg, const uint8_t (* txid)[32], LDKu8slice script_pubkey) {
+void register_tx_LDKFilter_jcall(const void* this_arg, const uint8_t (* txid)[32], LDKu8slice script_pubkey) {
LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
CHECK(obj != NULL);
return (*env)->CallVoidMethod(env, obj, j_calls->register_tx_meth, txid_arr, script_pubkey_arr);
}
-void register_output_jcall(const void* this_arg, const LDKOutPoint * outpoint, LDKu8slice script_pubkey) {
+void register_output_LDKFilter_jcall(const void* this_arg, const LDKOutPoint * outpoint, LDKu8slice script_pubkey) {
LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
LDKFilter ret = {
.this_arg = (void*) calls,
- .register_tx = register_tx_jcall,
- .register_output = register_output_jcall,
+ .register_tx = register_tx_LDKFilter_jcall,
+ .register_output = register_output_LDKFilter_jcall,
.free = LDKFilter_JCalls_free,
};
return ret;
FREE(j_calls);
}
}
-LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_jcall(const void* this_arg, LDKOutPoint id, const LDKChannelMonitor * data) {
+LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint id, const LDKChannelMonitor * data) {
LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)ret);
return ret_conv;
}
-LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_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 id, const LDKChannelMonitorUpdate * update, const LDKChannelMonitor * data) {
LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
LDKPersist ret = {
.this_arg = (void*) calls,
- .persist_new_channel = persist_new_channel_jcall,
- .update_persisted_channel = update_persisted_channel_jcall,
+ .persist_new_channel = persist_new_channel_LDKPersist_jcall,
+ .update_persisted_channel = update_persisted_channel_LDKPersist_jcall,
.free = LDKPersist_JCalls_free,
};
return ret;
jmethodID peer_disconnected_meth;
jmethodID peer_connected_meth;
jmethodID handle_channel_reestablish_meth;
+ jmethodID handle_channel_update_meth;
jmethodID handle_error_meth;
} LDKChannelMessageHandler_JCalls;
static void LDKChannelMessageHandler_JCalls_free(void* this_arg) {
FREE(j_calls);
}
}
-void handle_open_channel_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKOpenChannel * msg) {
+void handle_open_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKOpenChannel * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
CHECK(obj != NULL);
return (*env)->CallVoidMethod(env, obj, j_calls->handle_open_channel_meth, their_node_id_arr, their_features_ref, msg_ref);
}
-void handle_accept_channel_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKAcceptChannel * msg) {
+void handle_accept_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKAcceptChannel * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
CHECK(obj != NULL);
return (*env)->CallVoidMethod(env, obj, j_calls->handle_accept_channel_meth, their_node_id_arr, their_features_ref, msg_ref);
}
-void handle_funding_created_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingCreated * msg) {
+void handle_funding_created_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingCreated * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
CHECK(obj != NULL);
return (*env)->CallVoidMethod(env, obj, j_calls->handle_funding_created_meth, their_node_id_arr, msg_ref);
}
-void handle_funding_signed_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingSigned * msg) {
+void handle_funding_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingSigned * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
CHECK(obj != NULL);
return (*env)->CallVoidMethod(env, obj, j_calls->handle_funding_signed_meth, their_node_id_arr, msg_ref);
}
-void handle_funding_locked_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingLocked * msg) {
+void handle_funding_locked_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingLocked * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
CHECK(obj != NULL);
return (*env)->CallVoidMethod(env, obj, j_calls->handle_funding_locked_meth, their_node_id_arr, msg_ref);
}
-void handle_shutdown_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInitFeatures * their_features, const LDKShutdown * msg) {
+void handle_shutdown_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInitFeatures * their_features, const LDKShutdown * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
CHECK(obj != NULL);
return (*env)->CallVoidMethod(env, obj, j_calls->handle_shutdown_meth, their_node_id_arr, their_features_ref, msg_ref);
}
-void handle_closing_signed_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKClosingSigned * msg) {
+void handle_closing_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKClosingSigned * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
CHECK(obj != NULL);
return (*env)->CallVoidMethod(env, obj, j_calls->handle_closing_signed_meth, their_node_id_arr, msg_ref);
}
-void handle_update_add_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateAddHTLC * msg) {
+void handle_update_add_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateAddHTLC * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
CHECK(obj != NULL);
return (*env)->CallVoidMethod(env, obj, j_calls->handle_update_add_htlc_meth, their_node_id_arr, msg_ref);
}
-void handle_update_fulfill_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFulfillHTLC * msg) {
+void handle_update_fulfill_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFulfillHTLC * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
CHECK(obj != NULL);
return (*env)->CallVoidMethod(env, obj, j_calls->handle_update_fulfill_htlc_meth, their_node_id_arr, msg_ref);
}
-void handle_update_fail_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailHTLC * msg) {
+void handle_update_fail_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailHTLC * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
CHECK(obj != NULL);
return (*env)->CallVoidMethod(env, obj, j_calls->handle_update_fail_htlc_meth, their_node_id_arr, msg_ref);
}
-void handle_update_fail_malformed_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailMalformedHTLC * msg) {
+void handle_update_fail_malformed_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailMalformedHTLC * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
CHECK(obj != NULL);
return (*env)->CallVoidMethod(env, obj, j_calls->handle_update_fail_malformed_htlc_meth, their_node_id_arr, msg_ref);
}
-void handle_commitment_signed_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKCommitmentSigned * msg) {
+void handle_commitment_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKCommitmentSigned * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
CHECK(obj != NULL);
return (*env)->CallVoidMethod(env, obj, j_calls->handle_commitment_signed_meth, their_node_id_arr, msg_ref);
}
-void handle_revoke_and_ack_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKRevokeAndACK * msg) {
+void handle_revoke_and_ack_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKRevokeAndACK * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
CHECK(obj != NULL);
return (*env)->CallVoidMethod(env, obj, j_calls->handle_revoke_and_ack_meth, their_node_id_arr, msg_ref);
}
-void handle_update_fee_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFee * msg) {
+void handle_update_fee_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFee * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
CHECK(obj != NULL);
return (*env)->CallVoidMethod(env, obj, j_calls->handle_update_fee_meth, their_node_id_arr, msg_ref);
}
-void handle_announcement_signatures_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKAnnouncementSignatures * msg) {
+void handle_announcement_signatures_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKAnnouncementSignatures * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
CHECK(obj != NULL);
return (*env)->CallVoidMethod(env, obj, j_calls->handle_announcement_signatures_meth, their_node_id_arr, msg_ref);
}
-void peer_disconnected_jcall(const void* this_arg, LDKPublicKey their_node_id, bool no_connection_possible) {
+void peer_disconnected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, bool no_connection_possible) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
CHECK(obj != NULL);
return (*env)->CallVoidMethod(env, obj, j_calls->peer_disconnected_meth, their_node_id_arr, no_connection_possible);
}
-void peer_connected_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * msg) {
+void peer_connected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
CHECK(obj != NULL);
return (*env)->CallVoidMethod(env, obj, j_calls->peer_connected_meth, their_node_id_arr, msg_ref);
}
-void handle_channel_reestablish_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelReestablish * msg) {
+void handle_channel_reestablish_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelReestablish * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
CHECK(obj != NULL);
return (*env)->CallVoidMethod(env, obj, j_calls->handle_channel_reestablish_meth, their_node_id_arr, msg_ref);
}
-void handle_error_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKErrorMessage * msg) {
+void handle_channel_update_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelUpdate * msg) {
+ LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
+ JNIEnv *env;
+ DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
+ 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;
+ msg_var = ChannelUpdate_clone(msg);
+ CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long msg_ref = (long)msg_var.inner;
+ if (msg_var.is_owned) {
+ msg_ref |= 1;
+ }
+ jobject obj = (*env)->NewLocalRef(env, j_calls->o);
+ CHECK(obj != NULL);
+ return (*env)->CallVoidMethod(env, obj, j_calls->handle_channel_update_meth, their_node_id_arr, msg_ref);
+}
+void handle_error_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKErrorMessage * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
CHECK(calls->peer_connected_meth != NULL);
calls->handle_channel_reestablish_meth = (*env)->GetMethodID(env, c, "handle_channel_reestablish", "([BJ)V");
CHECK(calls->handle_channel_reestablish_meth != NULL);
+ calls->handle_channel_update_meth = (*env)->GetMethodID(env, c, "handle_channel_update", "([BJ)V");
+ CHECK(calls->handle_channel_update_meth != NULL);
calls->handle_error_meth = (*env)->GetMethodID(env, c, "handle_error", "([BJ)V");
CHECK(calls->handle_error_meth != NULL);
LDKChannelMessageHandler ret = {
.this_arg = (void*) calls,
- .handle_open_channel = handle_open_channel_jcall,
- .handle_accept_channel = handle_accept_channel_jcall,
- .handle_funding_created = handle_funding_created_jcall,
- .handle_funding_signed = handle_funding_signed_jcall,
- .handle_funding_locked = handle_funding_locked_jcall,
- .handle_shutdown = handle_shutdown_jcall,
- .handle_closing_signed = handle_closing_signed_jcall,
- .handle_update_add_htlc = handle_update_add_htlc_jcall,
- .handle_update_fulfill_htlc = handle_update_fulfill_htlc_jcall,
- .handle_update_fail_htlc = handle_update_fail_htlc_jcall,
- .handle_update_fail_malformed_htlc = handle_update_fail_malformed_htlc_jcall,
- .handle_commitment_signed = handle_commitment_signed_jcall,
- .handle_revoke_and_ack = handle_revoke_and_ack_jcall,
- .handle_update_fee = handle_update_fee_jcall,
- .handle_announcement_signatures = handle_announcement_signatures_jcall,
- .peer_disconnected = peer_disconnected_jcall,
- .peer_connected = peer_connected_jcall,
- .handle_channel_reestablish = handle_channel_reestablish_jcall,
- .handle_error = handle_error_jcall,
+ .handle_open_channel = handle_open_channel_LDKChannelMessageHandler_jcall,
+ .handle_accept_channel = handle_accept_channel_LDKChannelMessageHandler_jcall,
+ .handle_funding_created = handle_funding_created_LDKChannelMessageHandler_jcall,
+ .handle_funding_signed = handle_funding_signed_LDKChannelMessageHandler_jcall,
+ .handle_funding_locked = handle_funding_locked_LDKChannelMessageHandler_jcall,
+ .handle_shutdown = handle_shutdown_LDKChannelMessageHandler_jcall,
+ .handle_closing_signed = handle_closing_signed_LDKChannelMessageHandler_jcall,
+ .handle_update_add_htlc = handle_update_add_htlc_LDKChannelMessageHandler_jcall,
+ .handle_update_fulfill_htlc = handle_update_fulfill_htlc_LDKChannelMessageHandler_jcall,
+ .handle_update_fail_htlc = handle_update_fail_htlc_LDKChannelMessageHandler_jcall,
+ .handle_update_fail_malformed_htlc = handle_update_fail_malformed_htlc_LDKChannelMessageHandler_jcall,
+ .handle_commitment_signed = handle_commitment_signed_LDKChannelMessageHandler_jcall,
+ .handle_revoke_and_ack = handle_revoke_and_ack_LDKChannelMessageHandler_jcall,
+ .handle_update_fee = handle_update_fee_LDKChannelMessageHandler_jcall,
+ .handle_announcement_signatures = handle_announcement_signatures_LDKChannelMessageHandler_jcall,
+ .peer_disconnected = peer_disconnected_LDKChannelMessageHandler_jcall,
+ .peer_connected = peer_connected_LDKChannelMessageHandler_jcall,
+ .handle_channel_reestablish = handle_channel_reestablish_LDKChannelMessageHandler_jcall,
+ .handle_channel_update = handle_channel_update_LDKChannelMessageHandler_jcall,
+ .handle_error = handle_error_LDKChannelMessageHandler_jcall,
.free = LDKChannelMessageHandler_JCalls_free,
.MessageSendEventsProvider = LDKMessageSendEventsProvider_init(env, clz, MessageSendEventsProvider),
};
(this_arg_conv->handle_channel_reestablish)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
}
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1channel_1update(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ LDKPublicKey their_node_id_ref;
+ CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
+ (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
+ LDKChannelUpdate msg_conv;
+ msg_conv.inner = (void*)(msg & (~1));
+ msg_conv.is_owned = false;
+ (this_arg_conv->handle_channel_update)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1error(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
LDKPublicKey their_node_id_ref;
FREE(j_calls);
}
}
-LDKCResult_boolLightningErrorZ handle_node_announcement_jcall(const void* this_arg, const LDKNodeAnnouncement * msg) {
+LDKCResult_boolLightningErrorZ handle_node_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKNodeAnnouncement * msg) {
LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
ret_conv = CResult_boolLightningErrorZ_clone((LDKCResult_boolLightningErrorZ*)ret);
return ret_conv;
}
-LDKCResult_boolLightningErrorZ handle_channel_announcement_jcall(const void* this_arg, const LDKChannelAnnouncement * msg) {
+LDKCResult_boolLightningErrorZ handle_channel_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKChannelAnnouncement * msg) {
LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
ret_conv = CResult_boolLightningErrorZ_clone((LDKCResult_boolLightningErrorZ*)ret);
return ret_conv;
}
-LDKCResult_boolLightningErrorZ handle_channel_update_jcall(const void* this_arg, const LDKChannelUpdate * msg) {
+LDKCResult_boolLightningErrorZ handle_channel_update_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKChannelUpdate * msg) {
LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
ret_conv = CResult_boolLightningErrorZ_clone((LDKCResult_boolLightningErrorZ*)ret);
return ret_conv;
}
-void handle_htlc_fail_channel_update_jcall(const void* this_arg, const LDKHTLCFailChannelUpdate * update) {
+void handle_htlc_fail_channel_update_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKHTLCFailChannelUpdate * update) {
LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
CHECK(obj != NULL);
return (*env)->CallVoidMethod(env, obj, j_calls->handle_htlc_fail_channel_update_meth, ret_update);
}
-LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ get_next_channel_announcements_jcall(const void* this_arg, uint64_t starting_point, uint8_t batch_amount) {
+LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ get_next_channel_announcements_LDKRoutingMessageHandler_jcall(const void* this_arg, uint64_t starting_point, uint8_t batch_amount) {
LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
(*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0);
return ret_constr;
}
-LDKCVec_NodeAnnouncementZ get_next_node_announcements_jcall(const void* this_arg, LDKPublicKey starting_point, uint8_t batch_amount) {
+LDKCVec_NodeAnnouncementZ get_next_node_announcements_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey starting_point, uint8_t batch_amount) {
LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
(*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0);
return ret_constr;
}
-void sync_routing_table_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * init) {
+void sync_routing_table_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * init) {
LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
CHECK(obj != NULL);
return (*env)->CallVoidMethod(env, obj, j_calls->sync_routing_table_meth, their_node_id_arr, init_ref);
}
-LDKCResult_NoneLightningErrorZ handle_reply_channel_range_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKReplyChannelRange msg) {
+LDKCResult_NoneLightningErrorZ handle_reply_channel_range_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKReplyChannelRange msg) {
LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)ret);
return ret_conv;
}
-LDKCResult_NoneLightningErrorZ handle_reply_short_channel_ids_end_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKReplyShortChannelIdsEnd msg) {
+LDKCResult_NoneLightningErrorZ handle_reply_short_channel_ids_end_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKReplyShortChannelIdsEnd msg) {
LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)ret);
return ret_conv;
}
-LDKCResult_NoneLightningErrorZ handle_query_channel_range_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKQueryChannelRange msg) {
+LDKCResult_NoneLightningErrorZ handle_query_channel_range_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKQueryChannelRange msg) {
LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)ret);
return ret_conv;
}
-LDKCResult_NoneLightningErrorZ handle_query_short_channel_ids_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKQueryShortChannelIds msg) {
+LDKCResult_NoneLightningErrorZ handle_query_short_channel_ids_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKQueryShortChannelIds msg) {
LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
LDKRoutingMessageHandler ret = {
.this_arg = (void*) calls,
- .handle_node_announcement = handle_node_announcement_jcall,
- .handle_channel_announcement = handle_channel_announcement_jcall,
- .handle_channel_update = handle_channel_update_jcall,
- .handle_htlc_fail_channel_update = handle_htlc_fail_channel_update_jcall,
- .get_next_channel_announcements = get_next_channel_announcements_jcall,
- .get_next_node_announcements = get_next_node_announcements_jcall,
- .sync_routing_table = sync_routing_table_jcall,
- .handle_reply_channel_range = handle_reply_channel_range_jcall,
- .handle_reply_short_channel_ids_end = handle_reply_short_channel_ids_end_jcall,
- .handle_query_channel_range = handle_query_channel_range_jcall,
- .handle_query_short_channel_ids = handle_query_short_channel_ids_jcall,
+ .handle_node_announcement = handle_node_announcement_LDKRoutingMessageHandler_jcall,
+ .handle_channel_announcement = handle_channel_announcement_LDKRoutingMessageHandler_jcall,
+ .handle_channel_update = handle_channel_update_LDKRoutingMessageHandler_jcall,
+ .handle_htlc_fail_channel_update = handle_htlc_fail_channel_update_LDKRoutingMessageHandler_jcall,
+ .get_next_channel_announcements = get_next_channel_announcements_LDKRoutingMessageHandler_jcall,
+ .get_next_node_announcements = get_next_node_announcements_LDKRoutingMessageHandler_jcall,
+ .sync_routing_table = sync_routing_table_LDKRoutingMessageHandler_jcall,
+ .handle_reply_channel_range = handle_reply_channel_range_LDKRoutingMessageHandler_jcall,
+ .handle_reply_short_channel_ids_end = handle_reply_short_channel_ids_end_LDKRoutingMessageHandler_jcall,
+ .handle_query_channel_range = handle_query_channel_range_LDKRoutingMessageHandler_jcall,
+ .handle_query_short_channel_ids = handle_query_short_channel_ids_LDKRoutingMessageHandler_jcall,
.free = LDKRoutingMessageHandler_JCalls_free,
.MessageSendEventsProvider = LDKMessageSendEventsProvider_init(env, clz, MessageSendEventsProvider),
};
FREE(j_calls);
}
}
-uintptr_t send_data_jcall(void* this_arg, LDKu8slice data, bool resume_read) {
+uintptr_t send_data_LDKSocketDescriptor_jcall(void* this_arg, LDKu8slice data, bool resume_read) {
LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
CHECK(obj != NULL);
return (*env)->CallLongMethod(env, obj, j_calls->send_data_meth, data_arr, resume_read);
}
-void disconnect_socket_jcall(void* this_arg) {
+void disconnect_socket_LDKSocketDescriptor_jcall(void* this_arg) {
LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
CHECK(obj != NULL);
return (*env)->CallVoidMethod(env, obj, j_calls->disconnect_socket_meth);
}
-bool eq_jcall(const void* this_arg, const LDKSocketDescriptor * other_arg) {
+bool eq_LDKSocketDescriptor_jcall(const void* this_arg, const LDKSocketDescriptor * other_arg) {
LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
CHECK(obj != NULL);
return (*env)->CallBooleanMethod(env, obj, j_calls->eq_meth, (long)other_arg_clone);
}
-uint64_t hash_jcall(const void* this_arg) {
+uint64_t hash_LDKSocketDescriptor_jcall(const void* this_arg) {
LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
LDKSocketDescriptor ret = {
.this_arg = (void*) calls,
- .send_data = send_data_jcall,
- .disconnect_socket = disconnect_socket_jcall,
- .eq = eq_jcall,
- .hash = hash_jcall,
+ .send_data = send_data_LDKSocketDescriptor_jcall,
+ .disconnect_socket = disconnect_socket_LDKSocketDescriptor_jcall,
+ .eq = eq_LDKSocketDescriptor_jcall,
+ .hash = hash_LDKSocketDescriptor_jcall,
.clone = LDKSocketDescriptor_JCalls_clone,
.free = LDKSocketDescriptor_JCalls_free,
};
ChannelConfig_set_fee_proportional_millionths(&this_ptr_conv, val);
}
+JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKChannelConfig this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ int16_t ret_val = ChannelConfig_get_cltv_expiry_delta(&this_ptr_conv);
+ return ret_val;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
+ LDKChannelConfig this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ ChannelConfig_set_cltv_expiry_delta(&this_ptr_conv, val);
+}
+
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1announced_1channel(JNIEnv *env, jclass clz, int64_t this_ptr) {
LDKChannelConfig this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
ChannelConfig_set_commit_upfront_shutdown_pubkey(&this_ptr_conv, val);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1new(JNIEnv *env, jclass clz, int32_t fee_proportional_millionths_arg, jboolean announced_channel_arg, jboolean commit_upfront_shutdown_pubkey_arg) {
- LDKChannelConfig ret_var = ChannelConfig_new(fee_proportional_millionths_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg);
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1new(JNIEnv *env, jclass clz, int32_t fee_proportional_millionths_arg, int16_t cltv_expiry_delta_arg, jboolean announced_channel_arg, jboolean commit_upfront_shutdown_pubkey_arg) {
+ LDKChannelConfig ret_var = ChannelConfig_new(fee_proportional_millionths_arg, cltv_expiry_delta_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg);
CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
long ret_ref = (long)ret_var.inner;
return ret_arr;
}
+JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1end_1blocknum(JNIEnv *env, jclass clz, int64_t this_arg) {
+ LDKQueryChannelRange this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ int32_t ret_val = QueryChannelRange_end_blocknum(&this_arg_conv);
+ return ret_val;
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = (*env)->GetArrayLength(env, ser);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1channel_1reestablish
(JNIEnv *, jclass, jlong, jbyteArray, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ChannelMessageHandler_handle_channel_update
+ * Signature: (J[BJ)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1channel_1update
+ (JNIEnv *, jclass, jlong, jbyteArray, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: ChannelMessageHandler_handle_error
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1fee_1proportional_1millionths
(JNIEnv *, jclass, jlong, jint);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ChannelConfig_get_cltv_expiry_delta
+ * Signature: (J)S
+ */
+JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1cltv_1expiry_1delta
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ChannelConfig_set_cltv_expiry_delta
+ * Signature: (JS)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1cltv_1expiry_1delta
+ (JNIEnv *, jclass, jlong, jshort);
+
/*
* Class: org_ldk_impl_bindings
* Method: ChannelConfig_get_announced_channel
/*
* Class: org_ldk_impl_bindings
* Method: ChannelConfig_new
- * Signature: (IZZ)J
+ * Signature: (ISZZ)J
*/
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1new
- (JNIEnv *, jclass, jint, jboolean, jboolean);
+ (JNIEnv *, jclass, jint, jshort, jboolean, jboolean);
/*
* Class: org_ldk_impl_bindings
JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1write
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: QueryChannelRange_end_blocknum
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1end_1blocknum
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: QueryChannelRange_read
long msg_ref = (long)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;
+ CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long msg_ref = (long)msg_var.inner & ~1;
+ return 0 /* LDKMessageSendEvent - SendReplyChannelRange */; (void) node_id_arr; (void) msg_ref;
+ }
default: abort();
}
}
FREE(j_calls);
}
}
-LDKPublicKey get_per_commitment_point_jcall(const void* this_arg, uint64_t idx) {
+LDKPublicKey get_per_commitment_point_LDKSign_jcall(const void* this_arg, uint64_t idx) {
LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
int8_tArray ret = js_invoke_function_1(j_calls->get_per_commitment_point_meth, idx);
LDKPublicKey ret_ref;
memcpy(ret_ref.compressed_form, (uint8_t*)(ret + 4), 33);
return ret_ref;
}
-LDKThirtyTwoBytes release_commitment_secret_jcall(const void* this_arg, uint64_t idx) {
+LDKThirtyTwoBytes release_commitment_secret_LDKSign_jcall(const void* this_arg, uint64_t idx) {
LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
int8_tArray ret = js_invoke_function_1(j_calls->release_commitment_secret_meth, idx);
LDKThirtyTwoBytes ret_ref;
memcpy(ret_ref.data, (uint8_t*)(ret + 4), 32);
return ret_ref;
}
-LDKThirtyTwoBytes channel_keys_id_jcall(const void* this_arg) {
+LDKThirtyTwoBytes channel_keys_id_LDKSign_jcall(const void* this_arg) {
LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
int8_tArray ret = js_invoke_function_0(j_calls->channel_keys_id_meth);
LDKThirtyTwoBytes ret_ref;
memcpy(ret_ref.data, (uint8_t*)(ret + 4), 32);
return ret_ref;
}
-LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment_jcall(const void* this_arg, const LDKCommitmentTransaction * commitment_tx) {
+LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment_LDKSign_jcall(const void* this_arg, const LDKCommitmentTransaction * commitment_tx) {
LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
LDKCommitmentTransaction commitment_tx_var = *commitment_tx;
commitment_tx_var = CommitmentTransaction_clone(commitment_tx);
ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)ret);
return ret_conv;
}
-LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htlcs_jcall(const void* this_arg, const LDKHolderCommitmentTransaction * commitment_tx) {
+LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htlcs_LDKSign_jcall(const void* this_arg, const LDKHolderCommitmentTransaction * commitment_tx) {
LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
LDKHolderCommitmentTransaction commitment_tx_var = *commitment_tx;
commitment_tx_var = HolderCommitmentTransaction_clone(commitment_tx);
ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)ret);
return ret_conv;
}
-LDKCResult_SignatureNoneZ sign_justice_transaction_jcall(const void* this_arg, LDKTransaction justice_tx, uintptr_t input, uint64_t amount, const uint8_t (* per_commitment_key)[32], const LDKHTLCOutputInCommitment * htlc) {
+LDKCResult_SignatureNoneZ sign_justice_transaction_LDKSign_jcall(const void* this_arg, LDKTransaction justice_tx, uintptr_t input, uint64_t amount, const uint8_t (* per_commitment_key)[32], const LDKHTLCOutputInCommitment * htlc) {
LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
LDKTransaction justice_tx_var = justice_tx;
int8_tArray justice_tx_arr = init_arr(justice_tx_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)ret);
return ret_conv;
}
-LDKCResult_SignatureNoneZ sign_counterparty_htlc_transaction_jcall(const void* this_arg, LDKTransaction htlc_tx, uintptr_t input, uint64_t amount, LDKPublicKey per_commitment_point, const LDKHTLCOutputInCommitment * htlc) {
+LDKCResult_SignatureNoneZ sign_counterparty_htlc_transaction_LDKSign_jcall(const void* this_arg, LDKTransaction htlc_tx, uintptr_t input, uint64_t amount, LDKPublicKey per_commitment_point, const LDKHTLCOutputInCommitment * htlc) {
LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
LDKTransaction htlc_tx_var = htlc_tx;
int8_tArray htlc_tx_arr = init_arr(htlc_tx_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)ret);
return ret_conv;
}
-LDKCResult_SignatureNoneZ sign_closing_transaction_jcall(const void* this_arg, LDKTransaction closing_tx) {
+LDKCResult_SignatureNoneZ sign_closing_transaction_LDKSign_jcall(const void* this_arg, LDKTransaction closing_tx) {
LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
LDKTransaction closing_tx_var = closing_tx;
int8_tArray closing_tx_arr = init_arr(closing_tx_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)ret);
return ret_conv;
}
-LDKCResult_SignatureNoneZ sign_channel_announcement_jcall(const void* this_arg, const LDKUnsignedChannelAnnouncement * msg) {
+LDKCResult_SignatureNoneZ sign_channel_announcement_LDKSign_jcall(const void* this_arg, const LDKUnsignedChannelAnnouncement * msg) {
LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
LDKUnsignedChannelAnnouncement msg_var = *msg;
msg_var = UnsignedChannelAnnouncement_clone(msg);
ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)ret);
return ret_conv;
}
-void ready_channel_jcall(void* this_arg, const LDKChannelTransactionParameters * channel_parameters) {
+void ready_channel_LDKSign_jcall(void* this_arg, const LDKChannelTransactionParameters * channel_parameters) {
LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
LDKChannelTransactionParameters channel_parameters_var = *channel_parameters;
channel_parameters_var = ChannelTransactionParameters_clone(channel_parameters);
}
js_invoke_function_1(j_calls->ready_channel_meth, channel_parameters_ref);
}
-LDKCVec_u8Z write_jcall(const void* this_arg) {
+LDKCVec_u8Z write_LDKSign_jcall(const void* this_arg) {
LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
int8_tArray ret = js_invoke_function_0(j_calls->write_meth);
LDKCVec_u8Z ret_ref;
LDKSign ret = {
.this_arg = (void*) calls,
- .get_per_commitment_point = get_per_commitment_point_jcall,
- .release_commitment_secret = release_commitment_secret_jcall,
- .channel_keys_id = channel_keys_id_jcall,
- .sign_counterparty_commitment = sign_counterparty_commitment_jcall,
- .sign_holder_commitment_and_htlcs = sign_holder_commitment_and_htlcs_jcall,
- .sign_justice_transaction = sign_justice_transaction_jcall,
- .sign_counterparty_htlc_transaction = sign_counterparty_htlc_transaction_jcall,
- .sign_closing_transaction = sign_closing_transaction_jcall,
- .sign_channel_announcement = sign_channel_announcement_jcall,
- .ready_channel = ready_channel_jcall,
+ .get_per_commitment_point = get_per_commitment_point_LDKSign_jcall,
+ .release_commitment_secret = release_commitment_secret_LDKSign_jcall,
+ .channel_keys_id = channel_keys_id_LDKSign_jcall,
+ .sign_counterparty_commitment = sign_counterparty_commitment_LDKSign_jcall,
+ .sign_holder_commitment_and_htlcs = sign_holder_commitment_and_htlcs_LDKSign_jcall,
+ .sign_justice_transaction = sign_justice_transaction_LDKSign_jcall,
+ .sign_counterparty_htlc_transaction = sign_counterparty_htlc_transaction_LDKSign_jcall,
+ .sign_closing_transaction = sign_closing_transaction_LDKSign_jcall,
+ .sign_channel_announcement = sign_channel_announcement_LDKSign_jcall,
+ .ready_channel = ready_channel_LDKSign_jcall,
.clone = LDKSign_JCalls_clone,
- .write = write_jcall,
+ .write = write_LDKSign_jcall,
.free = LDKSign_JCalls_free,
.pubkeys = pubkeys_conv,
.set_pubkeys = NULL,
FREE(j_calls);
}
}
-LDKCResult_NoneChannelMonitorUpdateErrZ watch_channel_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitor monitor) {
+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;
CHECK((((long)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)ret);
return ret_conv;
}
-LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitorUpdate update) {
+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;
CHECK((((long)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)ret);
return ret_conv;
}
-LDKCVec_MonitorEventZ release_pending_monitor_events_jcall(const void* this_arg) {
+LDKCVec_MonitorEventZ release_pending_monitor_events_LDKWatch_jcall(const void* this_arg) {
LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
uint32_tArray ret = js_invoke_function_0(j_calls->release_pending_monitor_events_meth);
LDKCVec_MonitorEventZ ret_constr;
LDKWatch ret = {
.this_arg = (void*) calls,
- .watch_channel = watch_channel_jcall,
- .update_channel = update_channel_jcall,
- .release_pending_monitor_events = release_pending_monitor_events_jcall,
+ .watch_channel = watch_channel_LDKWatch_jcall,
+ .update_channel = update_channel_LDKWatch_jcall,
+ .release_pending_monitor_events = release_pending_monitor_events_LDKWatch_jcall,
.free = LDKWatch_JCalls_free,
};
return ret;
FREE(j_calls);
}
}
-void broadcast_transaction_jcall(const void* this_arg, LDKTransaction tx) {
+void broadcast_transaction_LDKBroadcasterInterface_jcall(const void* this_arg, LDKTransaction tx) {
LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg;
LDKTransaction tx_var = tx;
int8_tArray tx_arr = init_arr(tx_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
LDKBroadcasterInterface ret = {
.this_arg = (void*) calls,
- .broadcast_transaction = broadcast_transaction_jcall,
+ .broadcast_transaction = broadcast_transaction_LDKBroadcasterInterface_jcall,
.free = LDKBroadcasterInterface_JCalls_free,
};
return ret;
FREE(j_calls);
}
}
-LDKSecretKey get_node_secret_jcall(const void* this_arg) {
+LDKSecretKey get_node_secret_LDKKeysInterface_jcall(const void* this_arg) {
LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
int8_tArray ret = js_invoke_function_0(j_calls->get_node_secret_meth);
LDKSecretKey ret_ref;
memcpy(ret_ref.bytes, (uint8_t*)(ret + 4), 32);
return ret_ref;
}
-LDKCVec_u8Z get_destination_script_jcall(const void* this_arg) {
+LDKCVec_u8Z get_destination_script_LDKKeysInterface_jcall(const void* this_arg) {
LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
int8_tArray ret = js_invoke_function_0(j_calls->get_destination_script_meth);
LDKCVec_u8Z ret_ref;
memcpy(ret_ref.data, (uint8_t*)(ret + 4), ret_ref.datalen);
return ret_ref;
}
-LDKPublicKey get_shutdown_pubkey_jcall(const void* this_arg) {
+LDKPublicKey get_shutdown_pubkey_LDKKeysInterface_jcall(const void* this_arg) {
LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
int8_tArray ret = js_invoke_function_0(j_calls->get_shutdown_pubkey_meth);
LDKPublicKey ret_ref;
memcpy(ret_ref.compressed_form, (uint8_t*)(ret + 4), 33);
return ret_ref;
}
-LDKSign get_channel_signer_jcall(const void* this_arg, bool inbound, uint64_t channel_value_satoshis) {
+LDKSign get_channel_signer_LDKKeysInterface_jcall(const void* this_arg, bool inbound, uint64_t channel_value_satoshis) {
LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
LDKSign* ret = (LDKSign*)js_invoke_function_2(j_calls->get_channel_signer_meth, inbound, channel_value_satoshis);
LDKSign ret_conv = *(LDKSign*)(((uint64_t)ret) & ~1);
ret_conv = Sign_clone(ret);
return ret_conv;
}
-LDKThirtyTwoBytes get_secure_random_bytes_jcall(const void* this_arg) {
+LDKThirtyTwoBytes get_secure_random_bytes_LDKKeysInterface_jcall(const void* this_arg) {
LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
int8_tArray ret = js_invoke_function_0(j_calls->get_secure_random_bytes_meth);
LDKThirtyTwoBytes ret_ref;
memcpy(ret_ref.data, (uint8_t*)(ret + 4), 32);
return ret_ref;
}
-LDKCResult_SignDecodeErrorZ read_chan_signer_jcall(const void* this_arg, LDKu8slice reader) {
+LDKCResult_SignDecodeErrorZ read_chan_signer_LDKKeysInterface_jcall(const void* this_arg, LDKu8slice reader) {
LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
LDKu8slice reader_var = reader;
int8_tArray reader_arr = init_arr(reader_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
LDKKeysInterface ret = {
.this_arg = (void*) calls,
- .get_node_secret = get_node_secret_jcall,
- .get_destination_script = get_destination_script_jcall,
- .get_shutdown_pubkey = get_shutdown_pubkey_jcall,
- .get_channel_signer = get_channel_signer_jcall,
- .get_secure_random_bytes = get_secure_random_bytes_jcall,
- .read_chan_signer = read_chan_signer_jcall,
+ .get_node_secret = get_node_secret_LDKKeysInterface_jcall,
+ .get_destination_script = get_destination_script_LDKKeysInterface_jcall,
+ .get_shutdown_pubkey = get_shutdown_pubkey_LDKKeysInterface_jcall,
+ .get_channel_signer = get_channel_signer_LDKKeysInterface_jcall,
+ .get_secure_random_bytes = get_secure_random_bytes_LDKKeysInterface_jcall,
+ .read_chan_signer = read_chan_signer_LDKKeysInterface_jcall,
.free = LDKKeysInterface_JCalls_free,
};
return ret;
FREE(j_calls);
}
}
-uint32_t get_est_sat_per_1000_weight_jcall(const void* this_arg, LDKConfirmationTarget confirmation_target) {
+uint32_t get_est_sat_per_1000_weight_LDKFeeEstimator_jcall(const void* this_arg, LDKConfirmationTarget confirmation_target) {
LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg;
uint32_t confirmation_target_conv = LDKConfirmationTarget_to_js(confirmation_target);
return js_invoke_function_1(j_calls->get_est_sat_per_1000_weight_meth, confirmation_target_conv);
LDKFeeEstimator ret = {
.this_arg = (void*) calls,
- .get_est_sat_per_1000_weight = get_est_sat_per_1000_weight_jcall,
+ .get_est_sat_per_1000_weight = get_est_sat_per_1000_weight_LDKFeeEstimator_jcall,
.free = LDKFeeEstimator_JCalls_free,
};
return ret;
FREE(j_calls);
}
}
-void log_jcall(const void* this_arg, const char* record) {
+void log_LDKLogger_jcall(const void* this_arg, const char* record) {
LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg;
const char* record_str = record;
jstring record_conv = str_ref_to_ts(record_str, strlen(record_str));
LDKLogger ret = {
.this_arg = (void*) calls,
- .log = log_jcall,
+ .log = log_LDKLogger_jcall,
.free = LDKLogger_JCalls_free,
};
return ret;
FREE(j_calls);
}
}
-LDKCVec_MessageSendEventZ get_and_clear_pending_msg_events_jcall(const void* this_arg) {
+LDKCVec_MessageSendEventZ get_and_clear_pending_msg_events_LDKMessageSendEventsProvider_jcall(const void* this_arg) {
LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
uint32_tArray ret = js_invoke_function_0(j_calls->get_and_clear_pending_msg_events_meth);
LDKCVec_MessageSendEventZ ret_constr;
LDKMessageSendEventsProvider ret = {
.this_arg = (void*) calls,
- .get_and_clear_pending_msg_events = get_and_clear_pending_msg_events_jcall,
+ .get_and_clear_pending_msg_events = get_and_clear_pending_msg_events_LDKMessageSendEventsProvider_jcall,
.free = LDKMessageSendEventsProvider_JCalls_free,
};
return ret;
FREE(j_calls);
}
}
-LDKCVec_EventZ get_and_clear_pending_events_jcall(const void* this_arg) {
+LDKCVec_EventZ get_and_clear_pending_events_LDKEventsProvider_jcall(const void* this_arg) {
LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
uint32_tArray ret = js_invoke_function_0(j_calls->get_and_clear_pending_events_meth);
LDKCVec_EventZ ret_constr;
LDKEventsProvider ret = {
.this_arg = (void*) calls,
- .get_and_clear_pending_events = get_and_clear_pending_events_jcall,
+ .get_and_clear_pending_events = get_and_clear_pending_events_LDKEventsProvider_jcall,
.free = LDKEventsProvider_JCalls_free,
};
return ret;
FREE(j_calls);
}
}
-LDKCResult_TxOutAccessErrorZ get_utxo_jcall(const void* this_arg, const uint8_t (* genesis_hash)[32], uint64_t short_channel_id) {
+LDKCResult_TxOutAccessErrorZ get_utxo_LDKAccess_jcall(const void* this_arg, const uint8_t (* genesis_hash)[32], uint64_t short_channel_id) {
LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg;
int8_tArray genesis_hash_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(genesis_hash_arr + 4), *genesis_hash, 32);
LDKAccess ret = {
.this_arg = (void*) calls,
- .get_utxo = get_utxo_jcall,
+ .get_utxo = get_utxo_LDKAccess_jcall,
.free = LDKAccess_JCalls_free,
};
return ret;
FREE(j_calls);
}
}
-void block_connected_jcall(const void* this_arg, LDKu8slice block, uint32_t height) {
+void block_connected_LDKListen_jcall(const void* this_arg, LDKu8slice block, uint32_t height) {
LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
LDKu8slice block_var = block;
int8_tArray block_arr = init_arr(block_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(block_arr + 4), block_var.data, block_var.datalen);
js_invoke_function_2(j_calls->block_connected_meth, block_arr, height);
}
-void block_disconnected_jcall(const void* this_arg, const uint8_t (* header)[80], uint32_t height) {
+void block_disconnected_LDKListen_jcall(const void* this_arg, const uint8_t (* header)[80], uint32_t height) {
LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
int8_tArray header_arr = init_arr(80, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(header_arr + 4), *header, 80);
LDKListen ret = {
.this_arg = (void*) calls,
- .block_connected = block_connected_jcall,
- .block_disconnected = block_disconnected_jcall,
+ .block_connected = block_connected_LDKListen_jcall,
+ .block_disconnected = block_disconnected_LDKListen_jcall,
.free = LDKListen_JCalls_free,
};
return ret;
FREE(j_calls);
}
}
-void register_tx_jcall(const void* this_arg, const uint8_t (* txid)[32], LDKu8slice script_pubkey) {
+void register_tx_LDKFilter_jcall(const void* this_arg, const uint8_t (* txid)[32], LDKu8slice script_pubkey) {
LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
int8_tArray txid_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(txid_arr + 4), *txid, 32);
memcpy((uint8_t*)(script_pubkey_arr + 4), script_pubkey_var.data, script_pubkey_var.datalen);
js_invoke_function_2(j_calls->register_tx_meth, txid_arr, script_pubkey_arr);
}
-void register_output_jcall(const void* this_arg, const LDKOutPoint * outpoint, LDKu8slice script_pubkey) {
+void register_output_LDKFilter_jcall(const void* this_arg, const LDKOutPoint * outpoint, LDKu8slice script_pubkey) {
LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
LDKOutPoint outpoint_var = *outpoint;
outpoint_var = OutPoint_clone(outpoint);
LDKFilter ret = {
.this_arg = (void*) calls,
- .register_tx = register_tx_jcall,
- .register_output = register_output_jcall,
+ .register_tx = register_tx_LDKFilter_jcall,
+ .register_output = register_output_LDKFilter_jcall,
.free = LDKFilter_JCalls_free,
};
return ret;
FREE(j_calls);
}
}
-LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_jcall(const void* this_arg, LDKOutPoint id, const LDKChannelMonitor * data) {
+LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint id, const LDKChannelMonitor * data) {
LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg;
LDKOutPoint id_var = id;
CHECK((((long)id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)ret);
return ret_conv;
}
-LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_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 id, const LDKChannelMonitorUpdate * update, const LDKChannelMonitor * data) {
LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg;
LDKOutPoint id_var = id;
CHECK((((long)id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
LDKPersist ret = {
.this_arg = (void*) calls,
- .persist_new_channel = persist_new_channel_jcall,
- .update_persisted_channel = update_persisted_channel_jcall,
+ .persist_new_channel = persist_new_channel_LDKPersist_jcall,
+ .update_persisted_channel = update_persisted_channel_LDKPersist_jcall,
.free = LDKPersist_JCalls_free,
};
return ret;
uint32_t peer_disconnected_meth;
uint32_t peer_connected_meth;
uint32_t handle_channel_reestablish_meth;
+ uint32_t handle_channel_update_meth;
uint32_t handle_error_meth;
} LDKChannelMessageHandler_JCalls;
static void LDKChannelMessageHandler_JCalls_free(void* this_arg) {
js_free(j_calls->peer_disconnected_meth);
js_free(j_calls->peer_connected_meth);
js_free(j_calls->handle_channel_reestablish_meth);
+ js_free(j_calls->handle_channel_update_meth);
js_free(j_calls->handle_error_meth);
FREE(j_calls);
}
}
-void handle_open_channel_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKOpenChannel * msg) {
+void handle_open_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKOpenChannel * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
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);
}
js_invoke_function_3(j_calls->handle_open_channel_meth, their_node_id_arr, their_features_ref, msg_ref);
}
-void handle_accept_channel_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKAcceptChannel * msg) {
+void handle_accept_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKAcceptChannel * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
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);
}
js_invoke_function_3(j_calls->handle_accept_channel_meth, their_node_id_arr, their_features_ref, msg_ref);
}
-void handle_funding_created_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingCreated * msg) {
+void handle_funding_created_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingCreated * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
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);
}
js_invoke_function_2(j_calls->handle_funding_created_meth, their_node_id_arr, msg_ref);
}
-void handle_funding_signed_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingSigned * msg) {
+void handle_funding_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingSigned * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
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);
}
js_invoke_function_2(j_calls->handle_funding_signed_meth, their_node_id_arr, msg_ref);
}
-void handle_funding_locked_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingLocked * msg) {
+void handle_funding_locked_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingLocked * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
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);
}
js_invoke_function_2(j_calls->handle_funding_locked_meth, their_node_id_arr, msg_ref);
}
-void handle_shutdown_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInitFeatures * their_features, const LDKShutdown * msg) {
+void handle_shutdown_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInitFeatures * their_features, const LDKShutdown * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
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);
}
js_invoke_function_3(j_calls->handle_shutdown_meth, their_node_id_arr, their_features_ref, msg_ref);
}
-void handle_closing_signed_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKClosingSigned * msg) {
+void handle_closing_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKClosingSigned * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
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);
}
js_invoke_function_2(j_calls->handle_closing_signed_meth, their_node_id_arr, msg_ref);
}
-void handle_update_add_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateAddHTLC * msg) {
+void handle_update_add_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateAddHTLC * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
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);
}
js_invoke_function_2(j_calls->handle_update_add_htlc_meth, their_node_id_arr, msg_ref);
}
-void handle_update_fulfill_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFulfillHTLC * msg) {
+void handle_update_fulfill_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFulfillHTLC * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
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);
}
js_invoke_function_2(j_calls->handle_update_fulfill_htlc_meth, their_node_id_arr, msg_ref);
}
-void handle_update_fail_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailHTLC * msg) {
+void handle_update_fail_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailHTLC * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
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);
}
js_invoke_function_2(j_calls->handle_update_fail_htlc_meth, their_node_id_arr, msg_ref);
}
-void handle_update_fail_malformed_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailMalformedHTLC * msg) {
+void handle_update_fail_malformed_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailMalformedHTLC * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
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);
}
js_invoke_function_2(j_calls->handle_update_fail_malformed_htlc_meth, their_node_id_arr, msg_ref);
}
-void handle_commitment_signed_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKCommitmentSigned * msg) {
+void handle_commitment_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKCommitmentSigned * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
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);
}
js_invoke_function_2(j_calls->handle_commitment_signed_meth, their_node_id_arr, msg_ref);
}
-void handle_revoke_and_ack_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKRevokeAndACK * msg) {
+void handle_revoke_and_ack_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKRevokeAndACK * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
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);
}
js_invoke_function_2(j_calls->handle_revoke_and_ack_meth, their_node_id_arr, msg_ref);
}
-void handle_update_fee_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFee * msg) {
+void handle_update_fee_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFee * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
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);
}
js_invoke_function_2(j_calls->handle_update_fee_meth, their_node_id_arr, msg_ref);
}
-void handle_announcement_signatures_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKAnnouncementSignatures * msg) {
+void handle_announcement_signatures_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKAnnouncementSignatures * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
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);
}
js_invoke_function_2(j_calls->handle_announcement_signatures_meth, their_node_id_arr, msg_ref);
}
-void peer_disconnected_jcall(const void* this_arg, LDKPublicKey their_node_id, bool no_connection_possible) {
+void peer_disconnected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, bool no_connection_possible) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
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);
js_invoke_function_2(j_calls->peer_disconnected_meth, their_node_id_arr, no_connection_possible);
}
-void peer_connected_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * msg) {
+void peer_connected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
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);
}
js_invoke_function_2(j_calls->peer_connected_meth, their_node_id_arr, msg_ref);
}
-void handle_channel_reestablish_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelReestablish * msg) {
+void handle_channel_reestablish_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelReestablish * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
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);
}
js_invoke_function_2(j_calls->handle_channel_reestablish_meth, their_node_id_arr, msg_ref);
}
-void handle_error_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKErrorMessage * msg) {
+void handle_channel_update_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelUpdate * msg) {
+ LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
+ 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;
+ msg_var = ChannelUpdate_clone(msg);
+ CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long msg_ref = (long)msg_var.inner;
+ if (msg_var.is_owned) {
+ msg_ref |= 1;
+ }
+ js_invoke_function_2(j_calls->handle_channel_update_meth, their_node_id_arr, msg_ref);
+}
+void handle_error_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKErrorMessage * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
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);
LDKChannelMessageHandler ret = {
.this_arg = (void*) calls,
- .handle_open_channel = handle_open_channel_jcall,
- .handle_accept_channel = handle_accept_channel_jcall,
- .handle_funding_created = handle_funding_created_jcall,
- .handle_funding_signed = handle_funding_signed_jcall,
- .handle_funding_locked = handle_funding_locked_jcall,
- .handle_shutdown = handle_shutdown_jcall,
- .handle_closing_signed = handle_closing_signed_jcall,
- .handle_update_add_htlc = handle_update_add_htlc_jcall,
- .handle_update_fulfill_htlc = handle_update_fulfill_htlc_jcall,
- .handle_update_fail_htlc = handle_update_fail_htlc_jcall,
- .handle_update_fail_malformed_htlc = handle_update_fail_malformed_htlc_jcall,
- .handle_commitment_signed = handle_commitment_signed_jcall,
- .handle_revoke_and_ack = handle_revoke_and_ack_jcall,
- .handle_update_fee = handle_update_fee_jcall,
- .handle_announcement_signatures = handle_announcement_signatures_jcall,
- .peer_disconnected = peer_disconnected_jcall,
- .peer_connected = peer_connected_jcall,
- .handle_channel_reestablish = handle_channel_reestablish_jcall,
- .handle_error = handle_error_jcall,
+ .handle_open_channel = handle_open_channel_LDKChannelMessageHandler_jcall,
+ .handle_accept_channel = handle_accept_channel_LDKChannelMessageHandler_jcall,
+ .handle_funding_created = handle_funding_created_LDKChannelMessageHandler_jcall,
+ .handle_funding_signed = handle_funding_signed_LDKChannelMessageHandler_jcall,
+ .handle_funding_locked = handle_funding_locked_LDKChannelMessageHandler_jcall,
+ .handle_shutdown = handle_shutdown_LDKChannelMessageHandler_jcall,
+ .handle_closing_signed = handle_closing_signed_LDKChannelMessageHandler_jcall,
+ .handle_update_add_htlc = handle_update_add_htlc_LDKChannelMessageHandler_jcall,
+ .handle_update_fulfill_htlc = handle_update_fulfill_htlc_LDKChannelMessageHandler_jcall,
+ .handle_update_fail_htlc = handle_update_fail_htlc_LDKChannelMessageHandler_jcall,
+ .handle_update_fail_malformed_htlc = handle_update_fail_malformed_htlc_LDKChannelMessageHandler_jcall,
+ .handle_commitment_signed = handle_commitment_signed_LDKChannelMessageHandler_jcall,
+ .handle_revoke_and_ack = handle_revoke_and_ack_LDKChannelMessageHandler_jcall,
+ .handle_update_fee = handle_update_fee_LDKChannelMessageHandler_jcall,
+ .handle_announcement_signatures = handle_announcement_signatures_LDKChannelMessageHandler_jcall,
+ .peer_disconnected = peer_disconnected_LDKChannelMessageHandler_jcall,
+ .peer_connected = peer_connected_LDKChannelMessageHandler_jcall,
+ .handle_channel_reestablish = handle_channel_reestablish_LDKChannelMessageHandler_jcall,
+ .handle_channel_update = handle_channel_update_LDKChannelMessageHandler_jcall,
+ .handle_error = handle_error_LDKChannelMessageHandler_jcall,
.free = LDKChannelMessageHandler_JCalls_free,
.MessageSendEventsProvider = LDKMessageSendEventsProvider_init(MessageSendEventsProvider),
};
(this_arg_conv->handle_channel_reestablish)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
}
+void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_channel_update(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) {
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ LDKPublicKey their_node_id_ref;
+ CHECK(*((uint32_t*)their_node_id) == 33);
+ memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
+ LDKChannelUpdate msg_conv;
+ msg_conv.inner = (void*)(msg & (~1));
+ msg_conv.is_owned = false;
+ (this_arg_conv->handle_channel_update)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
+}
+
void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_error(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) {
LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
LDKPublicKey their_node_id_ref;
FREE(j_calls);
}
}
-LDKCResult_boolLightningErrorZ handle_node_announcement_jcall(const void* this_arg, const LDKNodeAnnouncement * msg) {
+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;
msg_var = NodeAnnouncement_clone(msg);
ret_conv = CResult_boolLightningErrorZ_clone((LDKCResult_boolLightningErrorZ*)ret);
return ret_conv;
}
-LDKCResult_boolLightningErrorZ handle_channel_announcement_jcall(const void* this_arg, const LDKChannelAnnouncement * msg) {
+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;
msg_var = ChannelAnnouncement_clone(msg);
ret_conv = CResult_boolLightningErrorZ_clone((LDKCResult_boolLightningErrorZ*)ret);
return ret_conv;
}
-LDKCResult_boolLightningErrorZ handle_channel_update_jcall(const void* this_arg, const LDKChannelUpdate * msg) {
+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;
msg_var = ChannelUpdate_clone(msg);
ret_conv = CResult_boolLightningErrorZ_clone((LDKCResult_boolLightningErrorZ*)ret);
return ret_conv;
}
-void handle_htlc_fail_channel_update_jcall(const void* this_arg, const LDKHTLCFailChannelUpdate * update) {
+void handle_htlc_fail_channel_update_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKHTLCFailChannelUpdate * update) {
LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
long ret_update = (long)update;
js_invoke_function_1(j_calls->handle_htlc_fail_channel_update_meth, ret_update);
}
-LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ get_next_channel_announcements_jcall(const void* this_arg, uint64_t starting_point, uint8_t batch_amount) {
+LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ get_next_channel_announcements_LDKRoutingMessageHandler_jcall(const void* this_arg, uint64_t starting_point, uint8_t batch_amount) {
LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
uint32_tArray ret = js_invoke_function_2(j_calls->get_next_channel_announcements_meth, starting_point, batch_amount);
LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret_constr;
}
return ret_constr;
}
-LDKCVec_NodeAnnouncementZ get_next_node_announcements_jcall(const void* this_arg, LDKPublicKey starting_point, uint8_t batch_amount) {
+LDKCVec_NodeAnnouncementZ get_next_node_announcements_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey starting_point, uint8_t batch_amount) {
LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
int8_tArray starting_point_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(starting_point_arr + 4), starting_point.compressed_form, 33);
}
return ret_constr;
}
-void sync_routing_table_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * init) {
+void sync_routing_table_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * init) {
LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
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);
}
js_invoke_function_2(j_calls->sync_routing_table_meth, their_node_id_arr, init_ref);
}
-LDKCResult_NoneLightningErrorZ handle_reply_channel_range_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKReplyChannelRange msg) {
+LDKCResult_NoneLightningErrorZ handle_reply_channel_range_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKReplyChannelRange msg) {
LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
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);
ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)ret);
return ret_conv;
}
-LDKCResult_NoneLightningErrorZ handle_reply_short_channel_ids_end_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKReplyShortChannelIdsEnd msg) {
+LDKCResult_NoneLightningErrorZ handle_reply_short_channel_ids_end_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKReplyShortChannelIdsEnd msg) {
LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
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);
ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)ret);
return ret_conv;
}
-LDKCResult_NoneLightningErrorZ handle_query_channel_range_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKQueryChannelRange msg) {
+LDKCResult_NoneLightningErrorZ handle_query_channel_range_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKQueryChannelRange msg) {
LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
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);
ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)ret);
return ret_conv;
}
-LDKCResult_NoneLightningErrorZ handle_query_short_channel_ids_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKQueryShortChannelIds msg) {
+LDKCResult_NoneLightningErrorZ handle_query_short_channel_ids_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKQueryShortChannelIds msg) {
LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
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);
LDKRoutingMessageHandler ret = {
.this_arg = (void*) calls,
- .handle_node_announcement = handle_node_announcement_jcall,
- .handle_channel_announcement = handle_channel_announcement_jcall,
- .handle_channel_update = handle_channel_update_jcall,
- .handle_htlc_fail_channel_update = handle_htlc_fail_channel_update_jcall,
- .get_next_channel_announcements = get_next_channel_announcements_jcall,
- .get_next_node_announcements = get_next_node_announcements_jcall,
- .sync_routing_table = sync_routing_table_jcall,
- .handle_reply_channel_range = handle_reply_channel_range_jcall,
- .handle_reply_short_channel_ids_end = handle_reply_short_channel_ids_end_jcall,
- .handle_query_channel_range = handle_query_channel_range_jcall,
- .handle_query_short_channel_ids = handle_query_short_channel_ids_jcall,
+ .handle_node_announcement = handle_node_announcement_LDKRoutingMessageHandler_jcall,
+ .handle_channel_announcement = handle_channel_announcement_LDKRoutingMessageHandler_jcall,
+ .handle_channel_update = handle_channel_update_LDKRoutingMessageHandler_jcall,
+ .handle_htlc_fail_channel_update = handle_htlc_fail_channel_update_LDKRoutingMessageHandler_jcall,
+ .get_next_channel_announcements = get_next_channel_announcements_LDKRoutingMessageHandler_jcall,
+ .get_next_node_announcements = get_next_node_announcements_LDKRoutingMessageHandler_jcall,
+ .sync_routing_table = sync_routing_table_LDKRoutingMessageHandler_jcall,
+ .handle_reply_channel_range = handle_reply_channel_range_LDKRoutingMessageHandler_jcall,
+ .handle_reply_short_channel_ids_end = handle_reply_short_channel_ids_end_LDKRoutingMessageHandler_jcall,
+ .handle_query_channel_range = handle_query_channel_range_LDKRoutingMessageHandler_jcall,
+ .handle_query_short_channel_ids = handle_query_short_channel_ids_LDKRoutingMessageHandler_jcall,
.free = LDKRoutingMessageHandler_JCalls_free,
.MessageSendEventsProvider = LDKMessageSendEventsProvider_init(MessageSendEventsProvider),
};
FREE(j_calls);
}
}
-uintptr_t send_data_jcall(void* this_arg, LDKu8slice data, bool resume_read) {
+uintptr_t send_data_LDKSocketDescriptor_jcall(void* this_arg, LDKu8slice data, bool resume_read) {
LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
LDKu8slice data_var = data;
int8_tArray data_arr = init_arr(data_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(data_arr + 4), data_var.data, data_var.datalen);
return js_invoke_function_2(j_calls->send_data_meth, data_arr, resume_read);
}
-void disconnect_socket_jcall(void* this_arg) {
+void disconnect_socket_LDKSocketDescriptor_jcall(void* this_arg) {
LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
js_invoke_function_0(j_calls->disconnect_socket_meth);
}
-bool eq_jcall(const void* this_arg, const LDKSocketDescriptor * other_arg) {
+bool eq_LDKSocketDescriptor_jcall(const void* this_arg, const LDKSocketDescriptor * other_arg) {
LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
LDKSocketDescriptor *other_arg_clone = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
*other_arg_clone = SocketDescriptor_clone(other_arg);
return js_invoke_function_1(j_calls->eq_meth, (long)other_arg_clone);
}
-uint64_t hash_jcall(const void* this_arg) {
+uint64_t hash_LDKSocketDescriptor_jcall(const void* this_arg) {
LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
return js_invoke_function_0(j_calls->hash_meth);
}
LDKSocketDescriptor ret = {
.this_arg = (void*) calls,
- .send_data = send_data_jcall,
- .disconnect_socket = disconnect_socket_jcall,
- .eq = eq_jcall,
- .hash = hash_jcall,
+ .send_data = send_data_LDKSocketDescriptor_jcall,
+ .disconnect_socket = disconnect_socket_LDKSocketDescriptor_jcall,
+ .eq = eq_LDKSocketDescriptor_jcall,
+ .hash = hash_LDKSocketDescriptor_jcall,
.clone = LDKSocketDescriptor_JCalls_clone,
.free = LDKSocketDescriptor_JCalls_free,
};
ChannelConfig_set_fee_proportional_millionths(&this_ptr_conv, val);
}
+int16_t __attribute__((visibility("default"))) TS_ChannelConfig_get_cltv_expiry_delta(uint32_t this_ptr) {
+ LDKChannelConfig this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ int16_t ret_val = ChannelConfig_get_cltv_expiry_delta(&this_ptr_conv);
+ return ret_val;
+}
+
+void __attribute__((visibility("default"))) TS_ChannelConfig_set_cltv_expiry_delta(uint32_t this_ptr, int16_t val) {
+ LDKChannelConfig this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ ChannelConfig_set_cltv_expiry_delta(&this_ptr_conv, val);
+}
+
jboolean __attribute__((visibility("default"))) TS_ChannelConfig_get_announced_channel(uint32_t this_ptr) {
LDKChannelConfig this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
ChannelConfig_set_commit_upfront_shutdown_pubkey(&this_ptr_conv, val);
}
-uint32_t __attribute__((visibility("default"))) TS_ChannelConfig_new(int32_t fee_proportional_millionths_arg, jboolean announced_channel_arg, jboolean commit_upfront_shutdown_pubkey_arg) {
- LDKChannelConfig ret_var = ChannelConfig_new(fee_proportional_millionths_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg);
+uint32_t __attribute__((visibility("default"))) TS_ChannelConfig_new(int32_t fee_proportional_millionths_arg, int16_t cltv_expiry_delta_arg, jboolean announced_channel_arg, jboolean commit_upfront_shutdown_pubkey_arg) {
+ LDKChannelConfig ret_var = ChannelConfig_new(fee_proportional_millionths_arg, cltv_expiry_delta_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg);
CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
long ret_ref = (long)ret_var.inner;
return ret_arr;
}
+int32_t __attribute__((visibility("default"))) TS_QueryChannelRange_end_blocknum(uint32_t this_arg) {
+ LDKQueryChannelRange this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ int32_t ret_val = QueryChannelRange_end_blocknum(&this_arg_conv);
+ return ret_val;
+}
+
uint32_t __attribute__((visibility("default"))) TS_QueryChannelRange_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = *((uint32_t*)ser);
public number msg;
SendShortIdsQuery(Uint8Array node_id, number msg) { this.node_id = node_id; this.msg = msg; }
}
+ export class SendReplyChannelRange extends LDKMessageSendEvent {
+ public Uint8Array node_id;
+ public number msg;
+ SendReplyChannelRange(Uint8Array node_id, number msg) { this.node_id = node_id; this.msg = msg; }
+ }
static native void init();
}
static { LDKMessageSendEvent.init(); }
peer_disconnected (their_node_id: Uint8Array, no_connection_possible: boolean): void;
peer_connected (their_node_id: Uint8Array, msg: number): void;
handle_channel_reestablish (their_node_id: Uint8Array, msg: number): void;
+ handle_channel_update (their_node_id: Uint8Array, msg: number): void;
handle_error (their_node_id: Uint8Array, msg: number): void;
}
const nativeResponseValue = wasm.ChannelMessageHandler_handle_channel_reestablish(this_arg, encodeArray(their_node_id), msg);
// debug statements here
}
+ // void ChannelMessageHandler_handle_channel_update LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelUpdate *NONNULL_PTR msg
+ export function ChannelMessageHandler_handle_channel_update(this_arg: number, their_node_id: Uint8Array, msg: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.ChannelMessageHandler_handle_channel_update(this_arg, encodeArray(their_node_id), msg);
+ // debug statements here
+ }
// void ChannelMessageHandler_handle_error LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg
export function ChannelMessageHandler_handle_error(this_arg: number, their_node_id: Uint8Array, msg: number): void {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.ChannelConfig_set_fee_proportional_millionths(this_ptr, val);
// debug statements here
}
+ // uint16_t ChannelConfig_get_cltv_expiry_delta(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
+ export function ChannelConfig_get_cltv_expiry_delta(this_ptr: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.ChannelConfig_get_cltv_expiry_delta(this_ptr);
+ return nativeResponseValue;
+ }
+ // void ChannelConfig_set_cltv_expiry_delta(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint16_t val);
+ export function ChannelConfig_set_cltv_expiry_delta(this_ptr: number, val: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.ChannelConfig_set_cltv_expiry_delta(this_ptr, val);
+ // debug statements here
+ }
// bool ChannelConfig_get_announced_channel(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
export function ChannelConfig_get_announced_channel(this_ptr: number): boolean {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.ChannelConfig_set_commit_upfront_shutdown_pubkey(this_ptr, val);
// debug statements here
}
- // MUST_USE_RES struct LDKChannelConfig ChannelConfig_new(uint32_t fee_proportional_millionths_arg, bool announced_channel_arg, bool commit_upfront_shutdown_pubkey_arg);
- export function ChannelConfig_new(fee_proportional_millionths_arg: number, announced_channel_arg: boolean, commit_upfront_shutdown_pubkey_arg: boolean): number {
+ // MUST_USE_RES struct LDKChannelConfig ChannelConfig_new(uint32_t fee_proportional_millionths_arg, uint16_t cltv_expiry_delta_arg, bool announced_channel_arg, bool commit_upfront_shutdown_pubkey_arg);
+ export function ChannelConfig_new(fee_proportional_millionths_arg: number, cltv_expiry_delta_arg: number, announced_channel_arg: boolean, commit_upfront_shutdown_pubkey_arg: boolean): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.ChannelConfig_new(fee_proportional_millionths_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg);
+ const nativeResponseValue = wasm.ChannelConfig_new(fee_proportional_millionths_arg, cltv_expiry_delta_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg);
return nativeResponseValue;
}
// struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig);
const nativeResponseValue = wasm.ReplyShortChannelIdsEnd_write(obj);
return decodeArray(nativeResponseValue);
}
+ // MUST_USE_RES uint32_t QueryChannelRange_end_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_arg);
+ export function QueryChannelRange_end_blocknum(this_arg: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.QueryChannelRange_end_blocknum(this_arg);
+ return nativeResponseValue;
+ }
// struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser);
export function QueryChannelRange_read(ser: Uint8Array): number {
if(!isWasmInitialized) {
bindings.ChannelConfig_set_fee_proportional_millionths(this.ptr, val);
}
+ public number get_cltv_expiry_delta() {
+ number ret = bindings.ChannelConfig_get_cltv_expiry_delta(this.ptr);
+ return ret;
+ }
+
+ public void set_cltv_expiry_delta(number val) {
+ bindings.ChannelConfig_set_cltv_expiry_delta(this.ptr, val);
+ }
+
public boolean get_announced_channel() {
boolean ret = bindings.ChannelConfig_get_announced_channel(this.ptr);
return ret;
bindings.ChannelConfig_set_commit_upfront_shutdown_pubkey(this.ptr, val);
}
- public static ChannelConfig constructor_new(number fee_proportional_millionths_arg, boolean announced_channel_arg, boolean commit_upfront_shutdown_pubkey_arg) {
- number ret = bindings.ChannelConfig_new(fee_proportional_millionths_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg);
+ public static ChannelConfig constructor_new(number fee_proportional_millionths_arg, number cltv_expiry_delta_arg, boolean announced_channel_arg, boolean commit_upfront_shutdown_pubkey_arg) {
+ number ret = bindings.ChannelConfig_new(fee_proportional_millionths_arg, cltv_expiry_delta_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg);
const ret_hu_conv: ChannelConfig = new ChannelConfig(null, ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
return ret_hu_conv;
arg.handle_channel_reestablish(their_node_id, msg_hu_conv);
},
+ handle_channel_update (their_node_id: Uint8Array, msg: number): void {
+ const msg_hu_conv: ChannelUpdate = new ChannelUpdate(null, msg);
+ arg.handle_channel_update(their_node_id, msg_hu_conv);
+ },
+
handle_error (their_node_id: Uint8Array, msg: number): void {
const msg_hu_conv: ErrorMessage = new ErrorMessage(null, msg);
arg.handle_error(their_node_id, msg_hu_conv);
peer_disconnected(their_node_id: Uint8Array, no_connection_possible: boolean): void;
peer_connected(their_node_id: Uint8Array, msg: Init): void;
handle_channel_reestablish(their_node_id: Uint8Array, msg: ChannelReestablish): void;
+ handle_channel_update(their_node_id: Uint8Array, msg: ChannelUpdate): void;
handle_error(their_node_id: Uint8Array, msg: ErrorMessage): void;
}
this.ptrs_to.add(msg);
}
+ public void handle_channel_update(Uint8Array their_node_id, ChannelUpdate msg) {
+ bindings.ChannelMessageHandler_handle_channel_update(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1);
+ this.ptrs_to.add(msg);
+ }
+
public void handle_error(Uint8Array their_node_id, ErrorMessage msg) {
bindings.ChannelMessageHandler_handle_error(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1);
this.ptrs_to.add(msg);
--- /dev/null
+
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+
+
+ export default class InvoiceFeatures extends CommonBase {
+ constructor(_dummy: object, ptr: number) {
+ super(ptr);
+ }
+
+
+ protected finalize() {
+ super.finalize();
+
+ if (this.ptr != 0) {
+ bindings.InvoiceFeatures_free(this.ptr);
+ }
+ }
+ public InvoiceFeatures clone() {
+ number ret = bindings.InvoiceFeatures_clone(this.ptr);
+ const ret_hu_conv: InvoiceFeatures = new InvoiceFeatures(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
+ public static InvoiceFeatures constructor_empty() {
+ number ret = bindings.InvoiceFeatures_empty();
+ const ret_hu_conv: InvoiceFeatures = new InvoiceFeatures(null, ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ return ret_hu_conv;
+ }
+
+ public static InvoiceFeatures constructor_known() {
+ number ret = bindings.InvoiceFeatures_known();
+ const ret_hu_conv: InvoiceFeatures = new InvoiceFeatures(null, ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ return ret_hu_conv;
+ }
+
+ public Uint8Array write() {
+ Uint8Array ret = bindings.InvoiceFeatures_write(this.ptr);
+ return ret;
+ }
+
+ public static Result_InvoiceFeaturesDecodeErrorZ constructor_read(Uint8Array ser) {
+ number ret = bindings.InvoiceFeatures_read(ser);
+ Result_InvoiceFeaturesDecodeErrorZ ret_hu_conv = Result_InvoiceFeaturesDecodeErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+}
if (raw_val instanceof bindings.LDKMessageSendEvent.SendShortIdsQuery) {
return new SendShortIdsQuery(this.ptr, raw_val);
}
+ if (raw_val instanceof bindings.LDKMessageSendEvent.SendReplyChannelRange) {
+ return new SendReplyChannelRange(this.ptr, raw_val);
+ }
throw new Error('oops, this should be unreachable'); // Unreachable without extending the (internal) bindings interface
}
this.msg = msg_hu_conv;
}
}
+export class SendReplyChannelRange extends MessageSendEvent {
+ public node_id: Uint8Array;
+ public msg: ReplyChannelRange;
+ private constructor(ptr: number, obj: bindings.LDKMessageSendEvent.SendReplyChannelRange) {
+ super(null, ptr);
+ this.node_id = obj.node_id;
+ const msg: number = obj.msg;
+ const msg_hu_conv: ReplyChannelRange = new ReplyChannelRange(null, msg);
+ msg_hu_conv.ptrs_to.add(this);
+ this.msg = msg_hu_conv;
+ }
+}
return ret_hu_conv;
}
+ public number end_blocknum() {
+ number ret = bindings.QueryChannelRange_end_blocknum(this.ptr);
+ return ret;
+ }
+
public static Result_QueryChannelRangeDecodeErrorZ constructor_read(Uint8Array ser) {
number ret = bindings.QueryChannelRange_read(ser);
Result_QueryChannelRangeDecodeErrorZ ret_hu_conv = Result_QueryChannelRangeDecodeErrorZ.constr_from_ptr(ret);
--- /dev/null
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+public class Result_InvoiceFeaturesDecodeErrorZ extends CommonBase {
+ private Result_InvoiceFeaturesDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_InvoiceFeaturesDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_InvoiceFeaturesDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_InvoiceFeaturesDecodeErrorZ_result_ok(ptr)) {
+ return new Result_InvoiceFeaturesDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_InvoiceFeaturesDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_InvoiceFeaturesDecodeErrorZ_OK extends Result_InvoiceFeaturesDecodeErrorZ {
+ public final InvoiceFeatures res;
+ private Result_InvoiceFeaturesDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number res = bindings.LDKCResult_InvoiceFeaturesDecodeErrorZ_get_ok(ptr);
+ const res_hu_conv: InvoiceFeatures = new InvoiceFeatures(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_InvoiceFeaturesDecodeErrorZ_OK(InvoiceFeatures res) {
+ this(null, bindings.CResult_InvoiceFeaturesDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_InvoiceFeaturesDecodeErrorZ_Err extends Result_InvoiceFeaturesDecodeErrorZ {
+ public final DecodeError err;
+ private Result_InvoiceFeaturesDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number err = bindings.LDKCResult_InvoiceFeaturesDecodeErrorZ_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 Result_InvoiceFeaturesDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_InvoiceFeaturesDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}