LDKSecp256k1Error_InvalidSecretKey,
LDKSecp256k1Error_InvalidRecoveryId,
LDKSecp256k1Error_InvalidTweak,
+ LDKSecp256k1Error_TweakCheckFailed,
LDKSecp256k1Error_NotEnoughMemory,
- LDKSecp256k1Error_CallbackPanicked,
; static native void init();
static { init(); }
}
\ No newline at end of file
public static native boolean LDKCResult_NoneChannelMonitorUpdateErrZ_result_ok(long arg);
public static native void LDKCResult_NoneChannelMonitorUpdateErrZ_get_ok(long arg);
public static native LDKChannelMonitorUpdateErr LDKCResult_NoneChannelMonitorUpdateErrZ_get_err(long arg);
+ public static class LDKMonitorEvent {
+ private LDKMonitorEvent() {}
+ public final static class HTLCEvent extends LDKMonitorEvent {
+ HTLCEvent() { }
+ }
+ public final static class CommitmentTxBroadcasted extends LDKMonitorEvent {
+ CommitmentTxBroadcasted() { }
+ }
+ static native void init();
+ }
+ static { LDKMonitorEvent.init(); }
+ public static native LDKMonitorEvent LDKMonitorEvent_ref_from_ptr(long ptr);
public static native long LDKCVec_MonitorEventZ_new(long[] elems);
- public static native long LDKC2Tuple_u64u64Z_new(long a, long b);
- public static native long LDKC2Tuple_u64u64Z_get_a(long ptr);
- public static native long LDKC2Tuple_u64u64Z_get_b(long ptr);
public static class LDKSpendableOutputDescriptor {
private LDKSpendableOutputDescriptor() {}
public final static class StaticOutput extends LDKSpendableOutputDescriptor {
public long output;
StaticOutput(long outpoint, long output) { this.outpoint = outpoint; this.output = output; }
}
- public final static class DynamicOutputP2WSH extends LDKSpendableOutputDescriptor {
- public long outpoint;
- public byte[] per_commitment_point;
- public short to_self_delay;
- public long output;
- public long key_derivation_params;
- public byte[] revocation_pubkey;
- DynamicOutputP2WSH(long outpoint, byte[] per_commitment_point, short to_self_delay, long output, long key_derivation_params, byte[] revocation_pubkey) { this.outpoint = outpoint; this.per_commitment_point = per_commitment_point; this.to_self_delay = to_self_delay; this.output = output; this.key_derivation_params = key_derivation_params; this.revocation_pubkey = revocation_pubkey; }
+ public final static class DelayedPaymentOutput extends LDKSpendableOutputDescriptor {
+ DelayedPaymentOutput() { }
}
- public final static class StaticOutputCounterpartyPayment extends LDKSpendableOutputDescriptor {
- public long outpoint;
- public long output;
- public long key_derivation_params;
- StaticOutputCounterpartyPayment(long outpoint, long output, long key_derivation_params) { this.outpoint = outpoint; this.output = output; this.key_derivation_params = key_derivation_params; }
+ public final static class StaticPaymentOutput extends LDKSpendableOutputDescriptor {
+ StaticPaymentOutput() { }
}
static native void init();
}
public static native boolean LDKCResult_SignatureNoneZ_result_ok(long arg);
public static native byte[] LDKCResult_SignatureNoneZ_get_ok(long arg);
public static native void LDKCResult_SignatureNoneZ_get_err(long arg);
- public interface LDKChannelKeys {
+ public interface LDKSign {
byte[] get_per_commitment_point(long idx);
byte[] release_commitment_secret(long idx);
- long key_derivation_params();
+ byte[] channel_keys_id();
long sign_counterparty_commitment(long commitment_tx);
long sign_holder_commitment_and_htlcs(long commitment_tx);
long sign_justice_transaction(byte[] justice_tx, long input, long amount, byte[] per_commitment_key, long htlc);
void ready_channel(long channel_parameters);
byte[] write();
}
- public static native long LDKChannelKeys_new(LDKChannelKeys impl, long pubkeys);
- // LDKPublicKey ChannelKeys_get_per_commitment_point LDKChannelKeys* this_arg, uint64_t idx
- public static native byte[] ChannelKeys_get_per_commitment_point(long this_arg, long idx);
- // LDKThirtyTwoBytes ChannelKeys_release_commitment_secret LDKChannelKeys* this_arg, uint64_t idx
- public static native byte[] ChannelKeys_release_commitment_secret(long this_arg, long idx);
- // LDKC2Tuple_u64u64Z ChannelKeys_key_derivation_params LDKChannelKeys* this_arg
- public static native long ChannelKeys_key_derivation_params(long this_arg);
- // LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ChannelKeys_sign_counterparty_commitment LDKChannelKeys* this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx
- public static native long ChannelKeys_sign_counterparty_commitment(long this_arg, long commitment_tx);
- // LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ChannelKeys_sign_holder_commitment_and_htlcs LDKChannelKeys* this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx
- public static native long ChannelKeys_sign_holder_commitment_and_htlcs(long this_arg, long commitment_tx);
- // LDKCResult_SignatureNoneZ ChannelKeys_sign_justice_transaction LDKChannelKeys* this_arg, struct LDKTransaction justice_tx, uintptr_t input, uint64_t amount, const uint8_t (*per_commitment_key)[32], const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc
- public static native long ChannelKeys_sign_justice_transaction(long this_arg, byte[] justice_tx, long input, long amount, byte[] per_commitment_key, long htlc);
- // LDKCResult_SignatureNoneZ ChannelKeys_sign_counterparty_htlc_transaction LDKChannelKeys* this_arg, struct LDKTransaction htlc_tx, uintptr_t input, uint64_t amount, struct LDKPublicKey per_commitment_point, const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc
- public static native long ChannelKeys_sign_counterparty_htlc_transaction(long this_arg, byte[] htlc_tx, long input, long amount, byte[] per_commitment_point, long htlc);
- // LDKCResult_SignatureNoneZ ChannelKeys_sign_closing_transaction LDKChannelKeys* this_arg, struct LDKTransaction closing_tx
- public static native long ChannelKeys_sign_closing_transaction(long this_arg, byte[] closing_tx);
- // LDKCResult_SignatureNoneZ ChannelKeys_sign_channel_announcement LDKChannelKeys* this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg
- public static native long ChannelKeys_sign_channel_announcement(long this_arg, long msg);
- // void ChannelKeys_ready_channel LDKChannelKeys* this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters
- public static native void ChannelKeys_ready_channel(long this_arg, long channel_parameters);
- // LDKCVec_u8Z ChannelKeys_write LDKChannelKeys* this_arg
- public static native byte[] ChannelKeys_write(long this_arg);
- // LDKChannelPublicKeys ChannelKeys_get_pubkeys LDKChannelKeys* this_arg
- public static native long ChannelKeys_get_pubkeys(long this_arg);
+ public static native long LDKSign_new(LDKSign impl, long pubkeys);
+ // LDKPublicKey Sign_get_per_commitment_point LDKSign* this_arg, uint64_t idx
+ public static native byte[] Sign_get_per_commitment_point(long this_arg, long idx);
+ // LDKThirtyTwoBytes Sign_release_commitment_secret LDKSign* this_arg, uint64_t idx
+ public static native byte[] Sign_release_commitment_secret(long this_arg, long idx);
+ // LDKThirtyTwoBytes Sign_channel_keys_id LDKSign* this_arg
+ public static native byte[] Sign_channel_keys_id(long this_arg);
+ // LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ Sign_sign_counterparty_commitment LDKSign* this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx
+ public static native long Sign_sign_counterparty_commitment(long this_arg, long commitment_tx);
+ // LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ Sign_sign_holder_commitment_and_htlcs LDKSign* this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx
+ public static native long Sign_sign_holder_commitment_and_htlcs(long this_arg, long commitment_tx);
+ // LDKCResult_SignatureNoneZ Sign_sign_justice_transaction LDKSign* this_arg, struct LDKTransaction justice_tx, uintptr_t input, uint64_t amount, const uint8_t (*per_commitment_key)[32], const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc
+ public static native long Sign_sign_justice_transaction(long this_arg, byte[] justice_tx, long input, long amount, byte[] per_commitment_key, long htlc);
+ // LDKCResult_SignatureNoneZ Sign_sign_counterparty_htlc_transaction LDKSign* this_arg, struct LDKTransaction htlc_tx, uintptr_t input, uint64_t amount, struct LDKPublicKey per_commitment_point, const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc
+ public static native long Sign_sign_counterparty_htlc_transaction(long this_arg, byte[] htlc_tx, long input, long amount, byte[] per_commitment_point, long htlc);
+ // LDKCResult_SignatureNoneZ Sign_sign_closing_transaction LDKSign* this_arg, struct LDKTransaction closing_tx
+ public static native long Sign_sign_closing_transaction(long this_arg, byte[] closing_tx);
+ // LDKCResult_SignatureNoneZ Sign_sign_channel_announcement LDKSign* this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg
+ public static native long Sign_sign_channel_announcement(long this_arg, long msg);
+ // void Sign_ready_channel LDKSign* this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters
+ public static native void Sign_ready_channel(long this_arg, long channel_parameters);
+ // LDKCVec_u8Z Sign_write LDKSign* this_arg
+ public static native byte[] Sign_write(long this_arg);
+ // LDKChannelPublicKeys Sign_get_pubkeys LDKSign* this_arg
+ public static native long Sign_get_pubkeys(long this_arg);
public static native long LDKC2Tuple_BlockHashChannelMonitorZ_new(byte[] a, long b);
public static native byte[] LDKC2Tuple_BlockHashChannelMonitorZ_get_a(long ptr);
public static native long LDKC2Tuple_BlockHashChannelMonitorZ_get_b(long ptr);
public static native boolean LDKCResult_NoneAPIErrorZ_result_ok(long arg);
public static native void LDKCResult_NoneAPIErrorZ_get_ok(long arg);
public static native long LDKCResult_NoneAPIErrorZ_get_err(long arg);
+ public static native long LDKCVec_CResult_NoneAPIErrorZZ_new(long[] elems);
+ public static native long LDKCVec_APIErrorZ_new(long[] elems);
public static native long LDKCVec_ChannelDetailsZ_new(long[] elems);
+ public static class LDKPaymentSendFailure {
+ private LDKPaymentSendFailure() {}
+ public final static class ParameterError extends LDKPaymentSendFailure {
+ ParameterError() { }
+ }
+ public final static class PathParameterError extends LDKPaymentSendFailure {
+ PathParameterError() { }
+ }
+ public final static class AllFailedRetrySafe extends LDKPaymentSendFailure {
+ AllFailedRetrySafe() { }
+ }
+ public final static class PartialFailure extends LDKPaymentSendFailure {
+ PartialFailure() { }
+ }
+ static native void init();
+ }
+ static { LDKPaymentSendFailure.init(); }
+ public static native LDKPaymentSendFailure LDKPaymentSendFailure_ref_from_ptr(long ptr);
public static native boolean LDKCResult_NonePaymentSendFailureZ_result_ok(long arg);
public static native void LDKCResult_NonePaymentSendFailureZ_get_ok(long arg);
public static native long LDKCResult_NonePaymentSendFailureZ_get_err(long arg);
public static native long LDKBroadcasterInterface_new(LDKBroadcasterInterface impl);
// void BroadcasterInterface_broadcast_transaction LDKBroadcasterInterface* this_arg, struct LDKTransaction tx
public static native void BroadcasterInterface_broadcast_transaction(long this_arg, byte[] tx);
- public static native boolean LDKCResult_ChannelKeysDecodeErrorZ_result_ok(long arg);
- public static native long LDKCResult_ChannelKeysDecodeErrorZ_get_ok(long arg);
- public static native long LDKCResult_ChannelKeysDecodeErrorZ_get_err(long arg);
+ public static native boolean LDKCResult_SignDecodeErrorZ_result_ok(long arg);
+ public static native long LDKCResult_SignDecodeErrorZ_get_ok(long arg);
+ public static native long LDKCResult_SignDecodeErrorZ_get_err(long arg);
public interface LDKKeysInterface {
byte[] get_node_secret();
byte[] get_destination_script();
byte[] get_shutdown_pubkey();
- long get_channel_keys(boolean inbound, long channel_value_satoshis);
+ long get_channel_signer(boolean inbound, long channel_value_satoshis);
byte[] get_secure_random_bytes();
long read_chan_signer(byte[] reader);
}
public static native byte[] KeysInterface_get_destination_script(long this_arg);
// LDKPublicKey KeysInterface_get_shutdown_pubkey LDKKeysInterface* this_arg
public static native byte[] KeysInterface_get_shutdown_pubkey(long this_arg);
- // LDKChannelKeys KeysInterface_get_channel_keys LDKKeysInterface* this_arg, bool inbound, uint64_t channel_value_satoshis
- public static native long KeysInterface_get_channel_keys(long this_arg, boolean inbound, long channel_value_satoshis);
+ // LDKSign KeysInterface_get_channel_signer LDKKeysInterface* this_arg, bool inbound, uint64_t channel_value_satoshis
+ public static native long KeysInterface_get_channel_signer(long this_arg, boolean inbound, long channel_value_satoshis);
// LDKThirtyTwoBytes KeysInterface_get_secure_random_bytes LDKKeysInterface* this_arg
public static native byte[] KeysInterface_get_secure_random_bytes(long this_arg);
- // LDKCResult_ChannelKeysDecodeErrorZ KeysInterface_read_chan_signer LDKKeysInterface* this_arg, struct LDKu8slice reader
+ // LDKCResult_SignDecodeErrorZ KeysInterface_read_chan_signer LDKKeysInterface* this_arg, struct LDKu8slice reader
public static native long KeysInterface_read_chan_signer(long this_arg, byte[] reader);
public interface LDKFeeEstimator {
int get_est_sat_per_1000_weight(LDKConfirmationTarget confirmation_target);
public static native boolean LDKCResult_SpendableOutputDescriptorDecodeErrorZ_result_ok(long arg);
public static native long LDKCResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(long arg);
public static native long LDKCResult_SpendableOutputDescriptorDecodeErrorZ_get_err(long arg);
- public static native boolean LDKCResult_InMemoryChannelKeysDecodeErrorZ_result_ok(long arg);
- public static native long LDKCResult_InMemoryChannelKeysDecodeErrorZ_get_ok(long arg);
- public static native long LDKCResult_InMemoryChannelKeysDecodeErrorZ_get_err(long arg);
+ public static native boolean LDKCResult_CVec_CVec_u8ZZNoneZ_result_ok(long arg);
+ public static native byte[][] LDKCResult_CVec_CVec_u8ZZNoneZ_get_ok(long arg);
+ public static native void LDKCResult_CVec_CVec_u8ZZNoneZ_get_err(long arg);
+ public static native boolean LDKCResult_InMemorySignerDecodeErrorZ_result_ok(long arg);
+ public static native long LDKCResult_InMemorySignerDecodeErrorZ_get_ok(long arg);
+ public static native long LDKCResult_InMemorySignerDecodeErrorZ_get_err(long arg);
+ public static native long LDKCVec_TxOutZ_new(long[] elems);
+ public static native boolean LDKCResult_TransactionNoneZ_result_ok(long arg);
+ public static native byte[] LDKCResult_TransactionNoneZ_get_ok(long arg);
+ public static native void LDKCResult_TransactionNoneZ_get_err(long arg);
public static native long LDKCVec_RouteHopZ_new(long[] elems);
public static native boolean LDKCResult_RouteDecodeErrorZ_result_ok(long arg);
public static native long LDKCResult_RouteDecodeErrorZ_get_ok(long arg);
public static native long LDKAccess_new(LDKAccess impl);
// LDKCResult_TxOutAccessErrorZ Access_get_utxo LDKAccess* this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id
public static native long Access_get_utxo(long this_arg, byte[] genesis_hash, long short_channel_id);
+ public interface LDKListen {
+ void block_connected(byte[] block, int height);
+ void block_disconnected(byte[] header, int height);
+ }
+ public static native long LDKListen_new(LDKListen impl);
+ // void Listen_block_connected LDKListen* this_arg, struct LDKu8slice block, uint32_t height
+ public static native void Listen_block_connected(long this_arg, byte[] block, int height);
+ // void Listen_block_disconnected LDKListen* this_arg, const uint8_t (*header)[80], uint32_t height
+ public static native void Listen_block_disconnected(long this_arg, byte[] header, int height);
public interface LDKFilter {
void register_tx(byte[] txid, byte[] script_pubkey);
void register_output(long outpoint, byte[] script_pubkey);
void handle_funding_created(byte[] their_node_id, long msg);
void handle_funding_signed(byte[] their_node_id, long msg);
void handle_funding_locked(byte[] their_node_id, long msg);
- void handle_shutdown(byte[] their_node_id, long msg);
+ void handle_shutdown(byte[] their_node_id, long their_features, long msg);
void handle_closing_signed(byte[] their_node_id, long msg);
void handle_update_add_htlc(byte[] their_node_id, long msg);
void handle_update_fulfill_htlc(byte[] their_node_id, long msg);
public static native void ChannelMessageHandler_handle_funding_signed(long this_arg, byte[] their_node_id, long msg);
// void ChannelMessageHandler_handle_funding_locked LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingLocked *NONNULL_PTR msg
public static native void ChannelMessageHandler_handle_funding_locked(long this_arg, byte[] their_node_id, long msg);
- // void ChannelMessageHandler_handle_shutdown LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKShutdown *NONNULL_PTR msg
- public static native void ChannelMessageHandler_handle_shutdown(long this_arg, byte[] their_node_id, long msg);
+ // void ChannelMessageHandler_handle_shutdown LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKInitFeatures *NONNULL_PTR their_features, const struct LDKShutdown *NONNULL_PTR msg
+ public static native void ChannelMessageHandler_handle_shutdown(long this_arg, byte[] their_node_id, long their_features, long msg);
// void ChannelMessageHandler_handle_closing_signed LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg
public static native void ChannelMessageHandler_handle_closing_signed(long this_arg, byte[] their_node_id, long msg);
// void ChannelMessageHandler_handle_update_add_htlc LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg
public static native long CResult_ChannelInfoDecodeErrorZ_err(long e);
// void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res);
public static native void CResult_ChannelInfoDecodeErrorZ_free(long _res);
+ // struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR orig);
+ public static native long CResult_ChannelInfoDecodeErrorZ_clone(long orig);
// struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o);
public static native long CResult_RoutingFeesDecodeErrorZ_ok(long o);
// struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e);
public static native long CResult_NetworkGraphDecodeErrorZ_err(long e);
// void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res);
public static native void CResult_NetworkGraphDecodeErrorZ_free(long _res);
+ // struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_clone(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR orig);
+ public static native long CResult_NetworkGraphDecodeErrorZ_clone(long orig);
// struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b);
public static native long C2Tuple_usizeTransactionZ_new(long a, byte[] b);
// void C2Tuple_usizeTransactionZ_free(struct LDKC2Tuple_usizeTransactionZ _res);
public static native void CResult_NoneAPIErrorZ_free(long _res);
// struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig);
public static native long CResult_NoneAPIErrorZ_clone(long orig);
+ // void CVec_CResult_NoneAPIErrorZZ_free(struct LDKCVec_CResult_NoneAPIErrorZZ _res);
+ public static native void CVec_CResult_NoneAPIErrorZZ_free(long[] _res);
+ // void CVec_APIErrorZ_free(struct LDKCVec_APIErrorZ _res);
+ public static native void CVec_APIErrorZ_free(long[] _res);
// void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res);
public static native void CVec_ChannelDetailsZ_free(long[] _res);
// struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void);
public static native long CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(long e);
// void CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res);
public static native void CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(long _res);
- // struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_clone(const struct LDKC2Tuple_u64u64Z *NONNULL_PTR orig);
- public static native long C2Tuple_u64u64Z_clone(long orig);
- // struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_new(uint64_t a, uint64_t b);
- public static native long C2Tuple_u64u64Z_new(long a, long b);
- // void C2Tuple_u64u64Z_free(struct LDKC2Tuple_u64u64Z _res);
- public static native void C2Tuple_u64u64Z_free(long _res);
// struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o);
public static native long CResult_SpendableOutputDescriptorDecodeErrorZ_ok(long o);
// struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
public static native void CResult_SignatureNoneZ_free(long _res);
// struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_clone(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR orig);
public static native long CResult_SignatureNoneZ_clone(long orig);
- // struct LDKCResult_ChannelKeysDecodeErrorZ CResult_ChannelKeysDecodeErrorZ_ok(struct LDKChannelKeys o);
- public static native long CResult_ChannelKeysDecodeErrorZ_ok(long o);
- // struct LDKCResult_ChannelKeysDecodeErrorZ CResult_ChannelKeysDecodeErrorZ_err(struct LDKDecodeError e);
- public static native long CResult_ChannelKeysDecodeErrorZ_err(long e);
- // void CResult_ChannelKeysDecodeErrorZ_free(struct LDKCResult_ChannelKeysDecodeErrorZ _res);
- public static native void CResult_ChannelKeysDecodeErrorZ_free(long _res);
- // struct LDKCResult_ChannelKeysDecodeErrorZ CResult_ChannelKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelKeysDecodeErrorZ *NONNULL_PTR orig);
- public static native long CResult_ChannelKeysDecodeErrorZ_clone(long orig);
- // struct LDKCResult_InMemoryChannelKeysDecodeErrorZ CResult_InMemoryChannelKeysDecodeErrorZ_ok(struct LDKInMemoryChannelKeys o);
- public static native long CResult_InMemoryChannelKeysDecodeErrorZ_ok(long o);
- // struct LDKCResult_InMemoryChannelKeysDecodeErrorZ CResult_InMemoryChannelKeysDecodeErrorZ_err(struct LDKDecodeError e);
- public static native long CResult_InMemoryChannelKeysDecodeErrorZ_err(long e);
- // void CResult_InMemoryChannelKeysDecodeErrorZ_free(struct LDKCResult_InMemoryChannelKeysDecodeErrorZ _res);
- public static native void CResult_InMemoryChannelKeysDecodeErrorZ_free(long _res);
- // struct LDKCResult_InMemoryChannelKeysDecodeErrorZ CResult_InMemoryChannelKeysDecodeErrorZ_clone(const struct LDKCResult_InMemoryChannelKeysDecodeErrorZ *NONNULL_PTR orig);
- public static native long CResult_InMemoryChannelKeysDecodeErrorZ_clone(long orig);
+ // struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_ok(struct LDKSign o);
+ public static native long CResult_SignDecodeErrorZ_ok(long o);
+ // struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_err(struct LDKDecodeError e);
+ public static native long CResult_SignDecodeErrorZ_err(long e);
+ // void CResult_SignDecodeErrorZ_free(struct LDKCResult_SignDecodeErrorZ _res);
+ public static native void CResult_SignDecodeErrorZ_free(long _res);
+ // struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_clone(const struct LDKCResult_SignDecodeErrorZ *NONNULL_PTR orig);
+ public static native long CResult_SignDecodeErrorZ_clone(long orig);
+ // void CVec_CVec_u8ZZ_free(struct LDKCVec_CVec_u8ZZ _res);
+ public static native void CVec_CVec_u8ZZ_free(byte[][] _res);
+ // struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_ok(struct LDKCVec_CVec_u8ZZ o);
+ public static native long CResult_CVec_CVec_u8ZZNoneZ_ok(byte[][] o);
+ // struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_err(void);
+ public static native long CResult_CVec_CVec_u8ZZNoneZ_err();
+ // void CResult_CVec_CVec_u8ZZNoneZ_free(struct LDKCResult_CVec_CVec_u8ZZNoneZ _res);
+ public static native void CResult_CVec_CVec_u8ZZNoneZ_free(long _res);
+ // struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_clone(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR orig);
+ public static native long CResult_CVec_CVec_u8ZZNoneZ_clone(long orig);
+ // struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_ok(struct LDKInMemorySigner o);
+ public static native long CResult_InMemorySignerDecodeErrorZ_ok(long o);
+ // struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_err(struct LDKDecodeError e);
+ public static native long CResult_InMemorySignerDecodeErrorZ_err(long e);
+ // void CResult_InMemorySignerDecodeErrorZ_free(struct LDKCResult_InMemorySignerDecodeErrorZ _res);
+ public static native void CResult_InMemorySignerDecodeErrorZ_free(long _res);
+ // struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_clone(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR orig);
+ public static native long CResult_InMemorySignerDecodeErrorZ_clone(long orig);
+ // void CVec_TxOutZ_free(struct LDKCVec_TxOutZ _res);
+ public static native void CVec_TxOutZ_free(long[] _res);
+ // struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_ok(struct LDKTransaction o);
+ public static native long CResult_TransactionNoneZ_ok(byte[] o);
+ // struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_err(void);
+ public static native long CResult_TransactionNoneZ_err();
+ // void CResult_TransactionNoneZ_free(struct LDKCResult_TransactionNoneZ _res);
+ public static native void CResult_TransactionNoneZ_free(long _res);
// void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res);
public static native void CVec_RouteHopZ_free(long[] _res);
// void CVec_CVec_RouteHopZZ_free(struct LDKCVec_CVec_RouteHopZZ _res);
public static native LDKAccessError AccessError_clone(long orig);
// void Access_free(struct LDKAccess this_ptr);
public static native void Access_free(long this_ptr);
+ // void Listen_free(struct LDKListen this_ptr);
+ public static native void Listen_free(long this_ptr);
// void Watch_free(struct LDKWatch this_ptr);
public static native void Watch_free(long this_ptr);
// void Filter_free(struct LDKFilter this_ptr);
public static native byte[] OutPoint_write(long obj);
// struct LDKCResult_OutPointDecodeErrorZ OutPoint_read(struct LDKu8slice ser);
public static native long OutPoint_read(byte[] ser);
+ // void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_ptr);
+ public static native void DelayedPaymentOutputDescriptor_free(long this_ptr);
+ // struct LDKOutPoint DelayedPaymentOutputDescriptor_get_outpoint(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
+ public static native long DelayedPaymentOutputDescriptor_get_outpoint(long this_ptr);
+ // void DelayedPaymentOutputDescriptor_set_outpoint(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
+ public static native void DelayedPaymentOutputDescriptor_set_outpoint(long this_ptr, long val);
+ // struct LDKPublicKey DelayedPaymentOutputDescriptor_get_per_commitment_point(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
+ public static native byte[] DelayedPaymentOutputDescriptor_get_per_commitment_point(long this_ptr);
+ // void DelayedPaymentOutputDescriptor_set_per_commitment_point(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+ public static native void DelayedPaymentOutputDescriptor_set_per_commitment_point(long this_ptr, byte[] val);
+ // uint16_t DelayedPaymentOutputDescriptor_get_to_self_delay(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
+ public static native short DelayedPaymentOutputDescriptor_get_to_self_delay(long this_ptr);
+ // void DelayedPaymentOutputDescriptor_set_to_self_delay(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint16_t val);
+ public static native void DelayedPaymentOutputDescriptor_set_to_self_delay(long this_ptr, short val);
+ // void DelayedPaymentOutputDescriptor_set_output(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
+ public static native void DelayedPaymentOutputDescriptor_set_output(long this_ptr, long val);
+ // struct LDKPublicKey DelayedPaymentOutputDescriptor_get_revocation_pubkey(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
+ public static native byte[] DelayedPaymentOutputDescriptor_get_revocation_pubkey(long this_ptr);
+ // void DelayedPaymentOutputDescriptor_set_revocation_pubkey(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+ public static native void DelayedPaymentOutputDescriptor_set_revocation_pubkey(long this_ptr, byte[] val);
+ // const uint8_t (*DelayedPaymentOutputDescriptor_get_channel_keys_id(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
+ public static native byte[] DelayedPaymentOutputDescriptor_get_channel_keys_id(long this_ptr);
+ // void DelayedPaymentOutputDescriptor_set_channel_keys_id(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+ public static native void DelayedPaymentOutputDescriptor_set_channel_keys_id(long this_ptr, byte[] val);
+ // uint64_t DelayedPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
+ public static native long DelayedPaymentOutputDescriptor_get_channel_value_satoshis(long this_ptr);
+ // void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
+ public static native void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(long this_ptr, long val);
+ // MUST_USE_RES struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_new(struct LDKOutPoint outpoint_arg, struct LDKPublicKey per_commitment_point_arg, uint16_t to_self_delay_arg, struct LDKTxOut output_arg, struct LDKPublicKey revocation_pubkey_arg, struct LDKThirtyTwoBytes channel_keys_id_arg, uint64_t channel_value_satoshis_arg);
+ public static native long DelayedPaymentOutputDescriptor_new(long outpoint_arg, byte[] per_commitment_point_arg, short to_self_delay_arg, long output_arg, byte[] revocation_pubkey_arg, byte[] channel_keys_id_arg, long channel_value_satoshis_arg);
+ // struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig);
+ public static native long DelayedPaymentOutputDescriptor_clone(long orig);
+ // void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_ptr);
+ public static native void StaticPaymentOutputDescriptor_free(long this_ptr);
+ // struct LDKOutPoint StaticPaymentOutputDescriptor_get_outpoint(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
+ public static native long StaticPaymentOutputDescriptor_get_outpoint(long this_ptr);
+ // void StaticPaymentOutputDescriptor_set_outpoint(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
+ public static native void StaticPaymentOutputDescriptor_set_outpoint(long this_ptr, long val);
+ // void StaticPaymentOutputDescriptor_set_output(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
+ public static native void StaticPaymentOutputDescriptor_set_output(long this_ptr, long val);
+ // const uint8_t (*StaticPaymentOutputDescriptor_get_channel_keys_id(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
+ public static native byte[] StaticPaymentOutputDescriptor_get_channel_keys_id(long this_ptr);
+ // void StaticPaymentOutputDescriptor_set_channel_keys_id(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+ public static native void StaticPaymentOutputDescriptor_set_channel_keys_id(long this_ptr, byte[] val);
+ // uint64_t StaticPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
+ public static native long StaticPaymentOutputDescriptor_get_channel_value_satoshis(long this_ptr);
+ // void StaticPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
+ public static native void StaticPaymentOutputDescriptor_set_channel_value_satoshis(long this_ptr, long val);
+ // MUST_USE_RES struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_new(struct LDKOutPoint outpoint_arg, struct LDKTxOut output_arg, struct LDKThirtyTwoBytes channel_keys_id_arg, uint64_t channel_value_satoshis_arg);
+ public static native long StaticPaymentOutputDescriptor_new(long outpoint_arg, long output_arg, byte[] channel_keys_id_arg, long channel_value_satoshis_arg);
+ // struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig);
+ public static native long StaticPaymentOutputDescriptor_clone(long orig);
// void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr);
public static native void SpendableOutputDescriptor_free(long this_ptr);
// struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig);
public static native byte[] SpendableOutputDescriptor_write(long obj);
// struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser);
public static native long SpendableOutputDescriptor_read(byte[] ser);
- // struct LDKChannelKeys ChannelKeys_clone(const struct LDKChannelKeys *NONNULL_PTR orig);
- public static native long ChannelKeys_clone(long orig);
- // void ChannelKeys_free(struct LDKChannelKeys this_ptr);
- public static native void ChannelKeys_free(long this_ptr);
+ // struct LDKSign Sign_clone(const struct LDKSign *NONNULL_PTR orig);
+ public static native long Sign_clone(long orig);
+ // void Sign_free(struct LDKSign this_ptr);
+ public static native void Sign_free(long this_ptr);
// void KeysInterface_free(struct LDKKeysInterface this_ptr);
public static native void KeysInterface_free(long this_ptr);
- // void InMemoryChannelKeys_free(struct LDKInMemoryChannelKeys this_ptr);
- public static native void InMemoryChannelKeys_free(long this_ptr);
- // const uint8_t (*InMemoryChannelKeys_get_funding_key(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr))[32];
- public static native byte[] InMemoryChannelKeys_get_funding_key(long this_ptr);
- // void InMemoryChannelKeys_set_funding_key(struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr, struct LDKSecretKey val);
- public static native void InMemoryChannelKeys_set_funding_key(long this_ptr, byte[] val);
- // const uint8_t (*InMemoryChannelKeys_get_revocation_base_key(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr))[32];
- public static native byte[] InMemoryChannelKeys_get_revocation_base_key(long this_ptr);
- // void InMemoryChannelKeys_set_revocation_base_key(struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr, struct LDKSecretKey val);
- public static native void InMemoryChannelKeys_set_revocation_base_key(long this_ptr, byte[] val);
- // const uint8_t (*InMemoryChannelKeys_get_payment_key(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr))[32];
- public static native byte[] InMemoryChannelKeys_get_payment_key(long this_ptr);
- // void InMemoryChannelKeys_set_payment_key(struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr, struct LDKSecretKey val);
- public static native void InMemoryChannelKeys_set_payment_key(long this_ptr, byte[] val);
- // const uint8_t (*InMemoryChannelKeys_get_delayed_payment_base_key(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr))[32];
- public static native byte[] InMemoryChannelKeys_get_delayed_payment_base_key(long this_ptr);
- // void InMemoryChannelKeys_set_delayed_payment_base_key(struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr, struct LDKSecretKey val);
- public static native void InMemoryChannelKeys_set_delayed_payment_base_key(long this_ptr, byte[] val);
- // const uint8_t (*InMemoryChannelKeys_get_htlc_base_key(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr))[32];
- public static native byte[] InMemoryChannelKeys_get_htlc_base_key(long this_ptr);
- // void InMemoryChannelKeys_set_htlc_base_key(struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr, struct LDKSecretKey val);
- public static native void InMemoryChannelKeys_set_htlc_base_key(long this_ptr, byte[] val);
- // const uint8_t (*InMemoryChannelKeys_get_commitment_seed(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr))[32];
- public static native byte[] InMemoryChannelKeys_get_commitment_seed(long this_ptr);
- // void InMemoryChannelKeys_set_commitment_seed(struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
- public static native void InMemoryChannelKeys_set_commitment_seed(long this_ptr, byte[] val);
- // struct LDKInMemoryChannelKeys InMemoryChannelKeys_clone(const struct LDKInMemoryChannelKeys *NONNULL_PTR orig);
- public static native long InMemoryChannelKeys_clone(long orig);
- // MUST_USE_RES struct LDKInMemoryChannelKeys InMemoryChannelKeys_new(struct LDKSecretKey funding_key, struct LDKSecretKey revocation_base_key, struct LDKSecretKey payment_key, struct LDKSecretKey delayed_payment_base_key, struct LDKSecretKey htlc_base_key, struct LDKThirtyTwoBytes commitment_seed, uint64_t channel_value_satoshis, struct LDKC2Tuple_u64u64Z key_derivation_params);
- public static native long InMemoryChannelKeys_new(byte[] funding_key, byte[] revocation_base_key, byte[] payment_key, byte[] delayed_payment_base_key, byte[] htlc_base_key, byte[] commitment_seed, long channel_value_satoshis, long key_derivation_params);
- // MUST_USE_RES struct LDKChannelPublicKeys InMemoryChannelKeys_counterparty_pubkeys(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_arg);
- public static native long InMemoryChannelKeys_counterparty_pubkeys(long this_arg);
- // MUST_USE_RES uint16_t InMemoryChannelKeys_counterparty_selected_contest_delay(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_arg);
- public static native short InMemoryChannelKeys_counterparty_selected_contest_delay(long this_arg);
- // MUST_USE_RES uint16_t InMemoryChannelKeys_holder_selected_contest_delay(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_arg);
- public static native short InMemoryChannelKeys_holder_selected_contest_delay(long this_arg);
- // MUST_USE_RES bool InMemoryChannelKeys_is_outbound(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_arg);
- public static native boolean InMemoryChannelKeys_is_outbound(long this_arg);
- // MUST_USE_RES struct LDKOutPoint InMemoryChannelKeys_funding_outpoint(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_arg);
- public static native long InMemoryChannelKeys_funding_outpoint(long this_arg);
- // MUST_USE_RES struct LDKChannelTransactionParameters InMemoryChannelKeys_get_channel_parameters(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_arg);
- public static native long InMemoryChannelKeys_get_channel_parameters(long this_arg);
- // struct LDKChannelKeys InMemoryChannelKeys_as_ChannelKeys(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_arg);
- public static native long InMemoryChannelKeys_as_ChannelKeys(long this_arg);
- // struct LDKCVec_u8Z InMemoryChannelKeys_write(const struct LDKInMemoryChannelKeys *NONNULL_PTR obj);
- public static native byte[] InMemoryChannelKeys_write(long obj);
- // struct LDKCResult_InMemoryChannelKeysDecodeErrorZ InMemoryChannelKeys_read(struct LDKu8slice ser);
- public static native long InMemoryChannelKeys_read(byte[] ser);
+ // void InMemorySigner_free(struct LDKInMemorySigner this_ptr);
+ public static native void InMemorySigner_free(long this_ptr);
+ // const uint8_t (*InMemorySigner_get_funding_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
+ public static native byte[] InMemorySigner_get_funding_key(long this_ptr);
+ // void InMemorySigner_set_funding_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
+ public static native void InMemorySigner_set_funding_key(long this_ptr, byte[] val);
+ // const uint8_t (*InMemorySigner_get_revocation_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
+ public static native byte[] InMemorySigner_get_revocation_base_key(long this_ptr);
+ // void InMemorySigner_set_revocation_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
+ public static native void InMemorySigner_set_revocation_base_key(long this_ptr, byte[] val);
+ // const uint8_t (*InMemorySigner_get_payment_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
+ public static native byte[] InMemorySigner_get_payment_key(long this_ptr);
+ // void InMemorySigner_set_payment_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
+ public static native void InMemorySigner_set_payment_key(long this_ptr, byte[] val);
+ // const uint8_t (*InMemorySigner_get_delayed_payment_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
+ public static native byte[] InMemorySigner_get_delayed_payment_base_key(long this_ptr);
+ // void InMemorySigner_set_delayed_payment_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
+ public static native void InMemorySigner_set_delayed_payment_base_key(long this_ptr, byte[] val);
+ // const uint8_t (*InMemorySigner_get_htlc_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
+ public static native byte[] InMemorySigner_get_htlc_base_key(long this_ptr);
+ // void InMemorySigner_set_htlc_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
+ public static native void InMemorySigner_set_htlc_base_key(long this_ptr, byte[] val);
+ // const uint8_t (*InMemorySigner_get_commitment_seed(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
+ public static native byte[] InMemorySigner_get_commitment_seed(long this_ptr);
+ // void InMemorySigner_set_commitment_seed(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+ public static native void InMemorySigner_set_commitment_seed(long this_ptr, byte[] val);
+ // struct LDKInMemorySigner InMemorySigner_clone(const struct LDKInMemorySigner *NONNULL_PTR orig);
+ public static native long InMemorySigner_clone(long orig);
+ // MUST_USE_RES struct LDKInMemorySigner InMemorySigner_new(struct LDKSecretKey funding_key, struct LDKSecretKey revocation_base_key, struct LDKSecretKey payment_key, struct LDKSecretKey delayed_payment_base_key, struct LDKSecretKey htlc_base_key, struct LDKThirtyTwoBytes commitment_seed, uint64_t channel_value_satoshis, struct LDKThirtyTwoBytes channel_keys_id);
+ public static native long InMemorySigner_new(byte[] funding_key, byte[] revocation_base_key, byte[] payment_key, byte[] delayed_payment_base_key, byte[] htlc_base_key, byte[] commitment_seed, long channel_value_satoshis, byte[] channel_keys_id);
+ // MUST_USE_RES struct LDKChannelPublicKeys InMemorySigner_counterparty_pubkeys(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
+ public static native long InMemorySigner_counterparty_pubkeys(long this_arg);
+ // MUST_USE_RES uint16_t InMemorySigner_counterparty_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
+ public static native short InMemorySigner_counterparty_selected_contest_delay(long this_arg);
+ // MUST_USE_RES uint16_t InMemorySigner_holder_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
+ public static native short InMemorySigner_holder_selected_contest_delay(long this_arg);
+ // MUST_USE_RES bool InMemorySigner_is_outbound(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
+ public static native boolean InMemorySigner_is_outbound(long this_arg);
+ // MUST_USE_RES struct LDKOutPoint InMemorySigner_funding_outpoint(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
+ public static native long InMemorySigner_funding_outpoint(long this_arg);
+ // MUST_USE_RES struct LDKChannelTransactionParameters InMemorySigner_get_channel_parameters(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
+ public static native long InMemorySigner_get_channel_parameters(long this_arg);
+ // MUST_USE_RES struct LDKCResult_CVec_CVec_u8ZZNoneZ InMemorySigner_sign_counterparty_payment_input(const struct LDKInMemorySigner *NONNULL_PTR this_arg, struct LDKTransaction spend_tx, uintptr_t input_idx, const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR descriptor);
+ public static native long InMemorySigner_sign_counterparty_payment_input(long this_arg, byte[] spend_tx, long input_idx, long descriptor);
+ // MUST_USE_RES struct LDKCResult_CVec_CVec_u8ZZNoneZ InMemorySigner_sign_dynamic_p2wsh_input(const struct LDKInMemorySigner *NONNULL_PTR this_arg, struct LDKTransaction spend_tx, uintptr_t input_idx, const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR descriptor);
+ public static native long InMemorySigner_sign_dynamic_p2wsh_input(long this_arg, byte[] spend_tx, long input_idx, long descriptor);
+ // struct LDKSign InMemorySigner_as_Sign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
+ public static native long InMemorySigner_as_Sign(long this_arg);
+ // struct LDKCVec_u8Z InMemorySigner_write(const struct LDKInMemorySigner *NONNULL_PTR obj);
+ public static native byte[] InMemorySigner_write(long obj);
+ // struct LDKCResult_InMemorySignerDecodeErrorZ InMemorySigner_read(struct LDKu8slice ser);
+ public static native long InMemorySigner_read(byte[] ser);
// void KeysManager_free(struct LDKKeysManager this_ptr);
public static native void KeysManager_free(long this_ptr);
- // MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], enum LDKNetwork network, uint64_t starting_time_secs, uint32_t starting_time_nanos);
- public static native long KeysManager_new(byte[] seed, LDKNetwork network, long starting_time_secs, int starting_time_nanos);
- // MUST_USE_RES struct LDKInMemoryChannelKeys KeysManager_derive_channel_keys(const struct LDKKeysManager *NONNULL_PTR this_arg, uint64_t channel_value_satoshis, uint64_t params_1, uint64_t params_2);
- public static native long KeysManager_derive_channel_keys(long this_arg, long channel_value_satoshis, long params_1, long params_2);
+ // MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos);
+ public static native long KeysManager_new(byte[] seed, long starting_time_secs, int starting_time_nanos);
+ // MUST_USE_RES struct LDKInMemorySigner KeysManager_derive_channel_keys(const struct LDKKeysManager *NONNULL_PTR this_arg, uint64_t channel_value_satoshis, const uint8_t (*params)[32]);
+ public static native long KeysManager_derive_channel_keys(long this_arg, long channel_value_satoshis, byte[] params);
+ // MUST_USE_RES struct LDKCResult_TransactionNoneZ KeysManager_spend_spendable_outputs(const struct LDKKeysManager *NONNULL_PTR this_arg, struct LDKCVec_SpendableOutputDescriptorZ descriptors, struct LDKCVec_TxOutZ outputs, struct LDKCVec_u8Z change_destination_script, uint32_t feerate_sat_per_1000_weight);
+ public static native long KeysManager_spend_spendable_outputs(long this_arg, long[] descriptors, long[] outputs, byte[] change_destination_script, int feerate_sat_per_1000_weight);
// struct LDKKeysInterface KeysManager_as_KeysInterface(const struct LDKKeysManager *NONNULL_PTR this_arg);
public static native long KeysManager_as_KeysInterface(long this_arg);
// void ChannelManager_free(struct LDKChannelManager this_ptr);
public static native long ChannelManager_as_MessageSendEventsProvider(long this_arg);
// struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
public static native long ChannelManager_as_EventsProvider(long this_arg);
+ // struct LDKListen ChannelManager_as_Listen(const struct LDKChannelManager *NONNULL_PTR this_arg);
+ public static native long ChannelManager_as_Listen(long this_arg);
// void ChannelManager_block_connected(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
public static native void ChannelManager_block_connected(long this_arg, byte[] header, long[] txdata, int height);
// void ChannelManager_block_disconnected(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*header)[80]);
public static native void ChannelManager_block_disconnected(long this_arg, byte[] header);
+ // void ChannelManager_await_persistable_update(const struct LDKChannelManager *NONNULL_PTR this_arg);
+ public static native void ChannelManager_await_persistable_update(long this_arg);
// struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
public static native long ChannelManager_as_ChannelMessageHandler(long this_arg);
// struct LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj);
public static native long DecodeError_clone(long orig);
// void Init_free(struct LDKInit this_ptr);
public static native void Init_free(long this_ptr);
+ // struct LDKInitFeatures Init_get_features(const struct LDKInit *NONNULL_PTR this_ptr);
+ public static native long Init_get_features(long this_ptr);
+ // void Init_set_features(struct LDKInit *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
+ public static native void Init_set_features(long this_ptr, long val);
+ // MUST_USE_RES struct LDKInit Init_new(struct LDKInitFeatures features_arg);
+ public static native long Init_new(long features_arg);
// struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig);
public static native long Init_clone(long orig);
// void ErrorMessage_free(struct LDKErrorMessage this_ptr);
public static native long get_route(byte[] our_node_id, long network, byte[] target, long[] first_hops, long[] last_hops, long final_value_msat, int final_cltv, long logger);
// void NetworkGraph_free(struct LDKNetworkGraph this_ptr);
public static native void NetworkGraph_free(long this_ptr);
+ // struct LDKNetworkGraph NetworkGraph_clone(const struct LDKNetworkGraph *NONNULL_PTR orig);
+ public static native long NetworkGraph_clone(long orig);
// void LockedNetworkGraph_free(struct LDKLockedNetworkGraph this_ptr);
public static native void LockedNetworkGraph_free(long this_ptr);
// void NetGraphMsgHandler_free(struct LDKNetGraphMsgHandler this_ptr);
public static native long ChannelInfo_get_announcement_message(long this_ptr);
// void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val);
public static native void ChannelInfo_set_announcement_message(long this_ptr, long val);
+ // struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig);
+ public static native long ChannelInfo_clone(long orig);
// struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj);
public static native byte[] ChannelInfo_write(long obj);
// struct LDKCResult_ChannelInfoDecodeErrorZ ChannelInfo_read(struct LDKu8slice ser);
}
public void block_connected(byte[] header, TwoTuple<Long, byte[]>[] txdata, int height) {
- bindings.ChainMonitor_block_connected(this.ptr, header, Arrays.stream(txdata).mapToLong(arr_conv_24 -> bindings.C2Tuple_usizeTransactionZ_new(arr_conv_24.a, arr_conv_24.b)).toArray(), 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);
/* TODO 2 TwoTuple<Long, byte[]> */;
}
this.ptrs_to.add(val);
}
+ public ChannelInfo clone() {
+ long ret = bindings.ChannelInfo_clone(this.ptr);
+ ChannelInfo ret_hu_conv = new ChannelInfo(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
public byte[] write() {
byte[] ret = bindings.ChannelInfo_write(this.ptr);
return ret;
+++ /dev/null
-package org.ldk.structs;
-
-import org.ldk.impl.bindings;
-import org.ldk.enums.*;
-import org.ldk.util.*;
-import java.util.Arrays;
-
-@SuppressWarnings("unchecked") // We correctly assign various generic arrays
-public class ChannelKeys extends CommonBase {
- final bindings.LDKChannelKeys bindings_instance;
- ChannelKeys(Object _dummy, long ptr) { super(ptr); bindings_instance = null; }
- private ChannelKeys(bindings.LDKChannelKeys arg, ChannelPublicKeys pubkeys) {
- super(bindings.LDKChannelKeys_new(arg, pubkeys == null ? 0 : pubkeys.ptr & ~1));
- this.ptrs_to.add(arg);
- this.ptrs_to.add(pubkeys);
- this.bindings_instance = arg;
- }
- @Override @SuppressWarnings("deprecation")
- protected void finalize() throws Throwable {
- if (ptr != 0) { bindings.ChannelKeys_free(ptr); } super.finalize();
- }
-
- public static interface ChannelKeysInterface {
- byte[] get_per_commitment_point(long idx);
- byte[] release_commitment_secret(long idx);
- TwoTuple<Long, Long> key_derivation_params();
- Result_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment(CommitmentTransaction commitment_tx);
- Result_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htlcs(HolderCommitmentTransaction commitment_tx);
- Result_SignatureNoneZ sign_justice_transaction(byte[] justice_tx, long input, long amount, byte[] per_commitment_key, HTLCOutputInCommitment htlc);
- Result_SignatureNoneZ sign_counterparty_htlc_transaction(byte[] htlc_tx, long input, long amount, byte[] per_commitment_point, HTLCOutputInCommitment htlc);
- Result_SignatureNoneZ sign_closing_transaction(byte[] closing_tx);
- Result_SignatureNoneZ sign_channel_announcement(UnsignedChannelAnnouncement msg);
- void ready_channel(ChannelTransactionParameters channel_parameters);
- byte[] write();
- }
- private static class LDKChannelKeysHolder { ChannelKeys held; }
- public static ChannelKeys new_impl(ChannelKeysInterface arg, ChannelPublicKeys pubkeys) {
- final LDKChannelKeysHolder impl_holder = new LDKChannelKeysHolder();
- impl_holder.held = new ChannelKeys(new bindings.LDKChannelKeys() {
- @Override public byte[] get_per_commitment_point(long idx) {
- byte[] ret = arg.get_per_commitment_point(idx);
- return ret;
- }
- @Override public byte[] release_commitment_secret(long idx) {
- byte[] ret = arg.release_commitment_secret(idx);
- return ret;
- }
- @Override public long key_derivation_params() {
- TwoTuple<Long, Long> ret = arg.key_derivation_params();
- long result = bindings.C2Tuple_u64u64Z_new(ret.a, ret.b);
- return result;
- }
- @Override public long sign_counterparty_commitment(long commitment_tx) {
- CommitmentTransaction commitment_tx_hu_conv = new CommitmentTransaction(null, commitment_tx);
- Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret = arg.sign_counterparty_commitment(commitment_tx_hu_conv);
- long result = ret != null ? ret.ptr : 0;
- return result;
- }
- @Override public long sign_holder_commitment_and_htlcs(long commitment_tx) {
- HolderCommitmentTransaction commitment_tx_hu_conv = new HolderCommitmentTransaction(null, commitment_tx);
- Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret = arg.sign_holder_commitment_and_htlcs(commitment_tx_hu_conv);
- long result = ret != null ? ret.ptr : 0;
- return result;
- }
- @Override public long sign_justice_transaction(byte[] justice_tx, long input, long amount, byte[] per_commitment_key, long htlc) {
- HTLCOutputInCommitment htlc_hu_conv = new HTLCOutputInCommitment(null, htlc);
- Result_SignatureNoneZ ret = arg.sign_justice_transaction(justice_tx, input, amount, per_commitment_key, htlc_hu_conv);
- long result = ret != null ? ret.ptr : 0;
- return result;
- }
- @Override public long sign_counterparty_htlc_transaction(byte[] htlc_tx, long input, long amount, byte[] per_commitment_point, long htlc) {
- HTLCOutputInCommitment htlc_hu_conv = new HTLCOutputInCommitment(null, htlc);
- Result_SignatureNoneZ ret = arg.sign_counterparty_htlc_transaction(htlc_tx, input, amount, per_commitment_point, htlc_hu_conv);
- long result = ret != null ? ret.ptr : 0;
- return result;
- }
- @Override public long sign_closing_transaction(byte[] closing_tx) {
- Result_SignatureNoneZ ret = arg.sign_closing_transaction(closing_tx);
- long result = ret != null ? ret.ptr : 0;
- return result;
- }
- @Override public long sign_channel_announcement(long msg) {
- UnsignedChannelAnnouncement msg_hu_conv = new UnsignedChannelAnnouncement(null, msg);
- Result_SignatureNoneZ ret = arg.sign_channel_announcement(msg_hu_conv);
- long result = ret != null ? ret.ptr : 0;
- return result;
- }
- @Override public void ready_channel(long channel_parameters) {
- ChannelTransactionParameters channel_parameters_hu_conv = new ChannelTransactionParameters(null, channel_parameters);
- arg.ready_channel(channel_parameters_hu_conv);
- }
- @Override public byte[] write() {
- byte[] ret = arg.write();
- return ret;
- }
- }, pubkeys);
- return impl_holder.held;
- }
- public byte[] get_per_commitment_point(long idx) {
- byte[] ret = bindings.ChannelKeys_get_per_commitment_point(this.ptr, idx);
- return ret;
- }
-
- public byte[] release_commitment_secret(long idx) {
- byte[] ret = bindings.ChannelKeys_release_commitment_secret(this.ptr, idx);
- return ret;
- }
-
- public TwoTuple<Long, Long> key_derivation_params() {
- long ret = bindings.ChannelKeys_key_derivation_params(this.ptr);
- long ret_a = bindings.LDKC2Tuple_u64u64Z_get_a(ret);
- long ret_b = bindings.LDKC2Tuple_u64u64Z_get_b(ret);
- TwoTuple<Long, Long> ret_conv = new TwoTuple<Long, Long>(ret_a, ret_b, () -> {
- bindings.C2Tuple_u64u64Z_free(ret);
- });
- return ret_conv;
- }
-
- public Result_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment(CommitmentTransaction commitment_tx) {
- long ret = bindings.ChannelKeys_sign_counterparty_commitment(this.ptr, commitment_tx == null ? 0 : commitment_tx.ptr & ~1);
- Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_hu_conv = Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.constr_from_ptr(ret);
- this.ptrs_to.add(commitment_tx);
- return ret_hu_conv;
- }
-
- public Result_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htlcs(HolderCommitmentTransaction commitment_tx) {
- long ret = bindings.ChannelKeys_sign_holder_commitment_and_htlcs(this.ptr, commitment_tx == null ? 0 : commitment_tx.ptr & ~1);
- Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_hu_conv = Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.constr_from_ptr(ret);
- this.ptrs_to.add(commitment_tx);
- return ret_hu_conv;
- }
-
- public Result_SignatureNoneZ sign_justice_transaction(byte[] justice_tx, long input, long amount, byte[] per_commitment_key, HTLCOutputInCommitment htlc) {
- long ret = bindings.ChannelKeys_sign_justice_transaction(this.ptr, justice_tx, input, amount, per_commitment_key, htlc == null ? 0 : htlc.ptr & ~1);
- Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret);
- this.ptrs_to.add(htlc);
- return ret_hu_conv;
- }
-
- public Result_SignatureNoneZ sign_counterparty_htlc_transaction(byte[] htlc_tx, long input, long amount, byte[] per_commitment_point, HTLCOutputInCommitment htlc) {
- long ret = bindings.ChannelKeys_sign_counterparty_htlc_transaction(this.ptr, htlc_tx, input, amount, per_commitment_point, htlc == null ? 0 : htlc.ptr & ~1);
- Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret);
- this.ptrs_to.add(htlc);
- return ret_hu_conv;
- }
-
- public Result_SignatureNoneZ sign_closing_transaction(byte[] closing_tx) {
- long ret = bindings.ChannelKeys_sign_closing_transaction(this.ptr, closing_tx);
- Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret);
- return ret_hu_conv;
- }
-
- public Result_SignatureNoneZ sign_channel_announcement(UnsignedChannelAnnouncement msg) {
- long ret = bindings.ChannelKeys_sign_channel_announcement(this.ptr, msg == null ? 0 : msg.ptr & ~1);
- Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret);
- this.ptrs_to.add(msg);
- return ret_hu_conv;
- }
-
- public void ready_channel(ChannelTransactionParameters channel_parameters) {
- bindings.ChannelKeys_ready_channel(this.ptr, channel_parameters == null ? 0 : channel_parameters.ptr & ~1);
- this.ptrs_to.add(channel_parameters);
- }
-
- public byte[] write() {
- byte[] ret = bindings.ChannelKeys_write(this.ptr);
- return ret;
- }
-
- public ChannelPublicKeys get_pubkeys() {
- long ret = bindings.ChannelKeys_get_pubkeys(this.ptr);
- ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret);
- ret_hu_conv.ptrs_to.add(this);
- return ret_hu_conv;
- }
-
- public ChannelKeys clone() {
- long ret = bindings.ChannelKeys_clone(this.ptr);
- ChannelKeys ret_hu_conv = new ChannelKeys(null, ret);
- ret_hu_conv.ptrs_to.add(this);
- return ret_hu_conv;
- }
-
-}
public ChannelDetails[] list_channels() {
long[] ret = bindings.ChannelManager_list_channels(this.ptr);
- ChannelDetails[] arr_conv_16_arr = new ChannelDetails[ret.length];
+ ChannelDetails[] ret_conv_16_arr = new ChannelDetails[ret.length];
for (int q = 0; q < ret.length; q++) {
- long arr_conv_16 = ret[q];
- ChannelDetails arr_conv_16_hu_conv = new ChannelDetails(null, arr_conv_16);
- arr_conv_16_hu_conv.ptrs_to.add(this);
- arr_conv_16_arr[q] = arr_conv_16_hu_conv;
+ long ret_conv_16 = ret[q];
+ ChannelDetails ret_conv_16_hu_conv = new ChannelDetails(null, ret_conv_16);
+ ret_conv_16_hu_conv.ptrs_to.add(this);
+ ret_conv_16_arr[q] = ret_conv_16_hu_conv;
}
- return arr_conv_16_arr;
+ return ret_conv_16_arr;
}
public ChannelDetails[] list_usable_channels() {
long[] ret = bindings.ChannelManager_list_usable_channels(this.ptr);
- ChannelDetails[] arr_conv_16_arr = new ChannelDetails[ret.length];
+ ChannelDetails[] ret_conv_16_arr = new ChannelDetails[ret.length];
for (int q = 0; q < ret.length; q++) {
- long arr_conv_16 = ret[q];
- ChannelDetails arr_conv_16_hu_conv = new ChannelDetails(null, arr_conv_16);
- arr_conv_16_hu_conv.ptrs_to.add(this);
- arr_conv_16_arr[q] = arr_conv_16_hu_conv;
+ long ret_conv_16 = ret[q];
+ ChannelDetails ret_conv_16_hu_conv = new ChannelDetails(null, ret_conv_16);
+ ret_conv_16_hu_conv.ptrs_to.add(this);
+ ret_conv_16_arr[q] = ret_conv_16_hu_conv;
}
- return arr_conv_16_arr;
+ return ret_conv_16_arr;
}
public Result_NoneAPIErrorZ close_channel(byte[] channel_id) {
}
public void broadcast_node_announcement(byte[] rgb, byte[] alias, NetAddress[] addresses) {
- bindings.ChannelManager_broadcast_node_announcement(this.ptr, rgb, alias, Arrays.stream(addresses).mapToLong(arr_conv_12 -> arr_conv_12.ptr).toArray());
+ bindings.ChannelManager_broadcast_node_announcement(this.ptr, rgb, alias, Arrays.stream(addresses).mapToLong(addresses_conv_12 -> addresses_conv_12.ptr).toArray());
/* TODO 2 NetAddress */;
}
return ret_hu_conv;
}
+ public Listen as_Listen() {
+ long ret = bindings.ChannelManager_as_Listen(this.ptr);
+ Listen ret_hu_conv = new Listen(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
public void block_connected(byte[] header, TwoTuple<Long, byte[]>[] txdata, int height) {
- bindings.ChannelManager_block_connected(this.ptr, header, Arrays.stream(txdata).mapToLong(arr_conv_24 -> bindings.C2Tuple_usizeTransactionZ_new(arr_conv_24.a, arr_conv_24.b)).toArray(), height);
+ bindings.ChannelManager_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);
/* TODO 2 TwoTuple<Long, byte[]> */;
}
bindings.ChannelManager_block_disconnected(this.ptr, header);
}
+ public void await_persistable_update() {
+ bindings.ChannelManager_await_persistable_update(this.ptr);
+ }
+
public ChannelMessageHandler as_ChannelMessageHandler() {
long ret = bindings.ChannelManager_as_ChannelMessageHandler(this.ptr);
ChannelMessageHandler ret_hu_conv = new ChannelMessageHandler(null, ret);
}
public static ChannelManagerReadArgs constructor_new(KeysInterface keys_manager, FeeEstimator fee_estimator, Watch chain_monitor, BroadcasterInterface tx_broadcaster, Logger logger, UserConfig default_config, ChannelMonitor[] channel_monitors) {
- long ret = bindings.ChannelManagerReadArgs_new(keys_manager == null ? 0 : keys_manager.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, chain_monitor == null ? 0 : chain_monitor.ptr, tx_broadcaster == null ? 0 : tx_broadcaster.ptr, logger == null ? 0 : logger.ptr, default_config == null ? 0 : default_config.ptr & ~1, Arrays.stream(channel_monitors).mapToLong(arr_conv_16 -> arr_conv_16 == null ? 0 : arr_conv_16.ptr & ~1).toArray());
+ long ret = bindings.ChannelManagerReadArgs_new(keys_manager == null ? 0 : keys_manager.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, chain_monitor == null ? 0 : chain_monitor.ptr, tx_broadcaster == null ? 0 : tx_broadcaster.ptr, logger == null ? 0 : logger.ptr, default_config == null ? 0 : default_config.ptr & ~1, Arrays.stream(channel_monitors).mapToLong(channel_monitors_conv_16 -> channel_monitors_conv_16 == null ? 0 : channel_monitors_conv_16.ptr & ~1).toArray());
ChannelManagerReadArgs ret_hu_conv = new ChannelManagerReadArgs(null, ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
ret_hu_conv.ptrs_to.add(keys_manager);
void handle_funding_created(byte[] their_node_id, FundingCreated msg);
void handle_funding_signed(byte[] their_node_id, FundingSigned msg);
void handle_funding_locked(byte[] their_node_id, FundingLocked msg);
- void handle_shutdown(byte[] their_node_id, Shutdown msg);
+ void handle_shutdown(byte[] their_node_id, InitFeatures their_features, Shutdown msg);
void handle_closing_signed(byte[] their_node_id, ClosingSigned msg);
void handle_update_add_htlc(byte[] their_node_id, UpdateAddHTLC msg);
void handle_update_fulfill_htlc(byte[] their_node_id, UpdateFulfillHTLC msg);
FundingLocked msg_hu_conv = new FundingLocked(null, msg);
arg.handle_funding_locked(their_node_id, msg_hu_conv);
}
- @Override public void handle_shutdown(byte[] their_node_id, long msg) {
+ @Override public void handle_shutdown(byte[] their_node_id, long their_features, long msg) {
+ InitFeatures their_features_hu_conv = new InitFeatures(null, their_features);
Shutdown msg_hu_conv = new Shutdown(null, msg);
- arg.handle_shutdown(their_node_id, msg_hu_conv);
+ arg.handle_shutdown(their_node_id, their_features_hu_conv, msg_hu_conv);
}
@Override public void handle_closing_signed(byte[] their_node_id, long msg) {
ClosingSigned msg_hu_conv = new ClosingSigned(null, msg);
this.ptrs_to.add(msg);
}
- public void handle_shutdown(byte[] their_node_id, Shutdown msg) {
- bindings.ChannelMessageHandler_handle_shutdown(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1);
+ public void handle_shutdown(byte[] their_node_id, InitFeatures their_features, Shutdown msg) {
+ bindings.ChannelMessageHandler_handle_shutdown(this.ptr, their_node_id, their_features == null ? 0 : their_features.ptr & ~1, msg == null ? 0 : msg.ptr & ~1);
+ this.ptrs_to.add(their_features);
this.ptrs_to.add(msg);
}
public MonitorEvent[] get_and_clear_pending_monitor_events() {
long[] ret = bindings.ChannelMonitor_get_and_clear_pending_monitor_events(this.ptr);
- MonitorEvent[] arr_conv_14_arr = new MonitorEvent[ret.length];
+ MonitorEvent[] ret_conv_14_arr = new MonitorEvent[ret.length];
for (int o = 0; o < ret.length; o++) {
- long arr_conv_14 = ret[o];
- MonitorEvent arr_conv_14_hu_conv = new MonitorEvent(null, arr_conv_14);
- arr_conv_14_hu_conv.ptrs_to.add(this);
- arr_conv_14_arr[o] = arr_conv_14_hu_conv;
+ long ret_conv_14 = ret[o];
+ MonitorEvent ret_conv_14_hu_conv = MonitorEvent.constr_from_ptr(ret_conv_14);
+ ret_conv_14_hu_conv.ptrs_to.add(this);
+ ret_conv_14_arr[o] = ret_conv_14_hu_conv;
}
- return arr_conv_14_arr;
+ return ret_conv_14_arr;
}
public Event[] get_and_clear_pending_events() {
long[] ret = bindings.ChannelMonitor_get_and_clear_pending_events(this.ptr);
- Event[] arr_conv_7_arr = new Event[ret.length];
+ Event[] ret_conv_7_arr = new Event[ret.length];
for (int h = 0; h < ret.length; h++) {
- long arr_conv_7 = ret[h];
- Event arr_conv_7_hu_conv = Event.constr_from_ptr(arr_conv_7);
- arr_conv_7_hu_conv.ptrs_to.add(this);
- arr_conv_7_arr[h] = arr_conv_7_hu_conv;
+ long ret_conv_7 = ret[h];
+ Event ret_conv_7_hu_conv = Event.constr_from_ptr(ret_conv_7);
+ ret_conv_7_hu_conv.ptrs_to.add(this);
+ ret_conv_7_arr[h] = ret_conv_7_hu_conv;
}
- return arr_conv_7_arr;
+ return ret_conv_7_arr;
}
public byte[][] get_latest_holder_commitment_txn(Logger logger) {
}
public TwoTuple<byte[], TwoTuple<Integer, TxOut>[]>[] block_connected(byte[] header, TwoTuple<Long, byte[]>[] txdata, int height, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) {
- long[] ret = bindings.ChannelMonitor_block_connected(this.ptr, header, Arrays.stream(txdata).mapToLong(arr_conv_24 -> bindings.C2Tuple_usizeTransactionZ_new(arr_conv_24.a, arr_conv_24.b)).toArray(), height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr);
- TwoTuple<byte[], TwoTuple<Integer, TxOut>[]>[] arr_conv_46_arr = new TwoTuple[ret.length];
+ long[] ret = bindings.ChannelMonitor_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, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr);
+ TwoTuple<byte[], TwoTuple<Integer, TxOut>[]>[] ret_conv_46_arr = new TwoTuple[ret.length];
for (int u = 0; u < ret.length; u++) {
- long arr_conv_46 = ret[u];
- byte[] arr_conv_46_a = bindings.LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(arr_conv_46);
- long[] arr_conv_46_b = bindings.LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(arr_conv_46);
- TwoTuple<Integer, TxOut>[] arr_conv_26_arr = new TwoTuple[arr_conv_46_b.length];
- for (int a = 0; a < arr_conv_46_b.length; a++) {
- long arr_conv_26 = arr_conv_46_b[a];
- int arr_conv_26_a = bindings.LDKC2Tuple_u32TxOutZ_get_a(arr_conv_26);
- long arr_conv_26_b = bindings.TxOut_clone(bindings.LDKC2Tuple_u32TxOutZ_get_b(arr_conv_26));
- TxOut arr_conv_26_b_conv = new TxOut(null, arr_conv_26_b);;
- TwoTuple<Integer, TxOut> arr_conv_26_conv = new TwoTuple<Integer, TxOut>(arr_conv_26_a, arr_conv_26_b_conv, () -> {
- bindings.C2Tuple_u32TxOutZ_free(arr_conv_26);
+ long ret_conv_46 = ret[u];
+ byte[] ret_conv_46_a = bindings.LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(ret_conv_46);
+ long[] ret_conv_46_b = bindings.LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(ret_conv_46);
+ TwoTuple<Integer, TxOut>[] ret_conv_46_b_conv_26_arr = new TwoTuple[ret_conv_46_b.length];
+ for (int a = 0; a < ret_conv_46_b.length; a++) {
+ long ret_conv_46_b_conv_26 = ret_conv_46_b[a];
+ int ret_conv_46_b_conv_26_a = bindings.LDKC2Tuple_u32TxOutZ_get_a(ret_conv_46_b_conv_26);
+ long ret_conv_46_b_conv_26_b = bindings.TxOut_clone(bindings.LDKC2Tuple_u32TxOutZ_get_b(ret_conv_46_b_conv_26));
+ TxOut ret_conv_46_b_conv_26_b_conv = new TxOut(null, ret_conv_46_b_conv_26_b);;
+ TwoTuple<Integer, TxOut> ret_conv_46_b_conv_26_conv = new TwoTuple<Integer, TxOut>(ret_conv_46_b_conv_26_a, ret_conv_46_b_conv_26_b_conv, () -> {
+ bindings.C2Tuple_u32TxOutZ_free(ret_conv_46_b_conv_26);
});
- arr_conv_26_b_conv.ptrs_to.add(arr_conv_26_conv);
- arr_conv_26_arr[a] = arr_conv_26_conv;
+ ret_conv_46_b_conv_26_b_conv.ptrs_to.add(ret_conv_46_b_conv_26_conv);
+ ret_conv_46_b_conv_26_arr[a] = ret_conv_46_b_conv_26_conv;
};
- TwoTuple<byte[], TwoTuple<Integer, TxOut>[]> arr_conv_46_conv = new TwoTuple<byte[], TwoTuple<Integer, TxOut>[]>(arr_conv_46_a, arr_conv_26_arr);
+ TwoTuple<byte[], TwoTuple<Integer, TxOut>[]> ret_conv_46_conv = new TwoTuple<byte[], TwoTuple<Integer, TxOut>[]>(ret_conv_46_a, ret_conv_46_b_conv_26_arr);
// Warning: We may not free the C tuple object!
- arr_conv_46_arr[u] = arr_conv_46_conv;
+ ret_conv_46_arr[u] = ret_conv_46_conv;
}
/* TODO 2 TwoTuple<Long, byte[]> */;
this.ptrs_to.add(broadcaster);
this.ptrs_to.add(fee_estimator);
this.ptrs_to.add(logger);
- return arr_conv_46_arr;
+ return ret_conv_46_arr;
}
public void block_disconnected(byte[] header, int height, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) {
}
public void set_update_add_htlcs(UpdateAddHTLC[] val) {
- bindings.CommitmentUpdate_set_update_add_htlcs(this.ptr, Arrays.stream(val).mapToLong(arr_conv_15 -> arr_conv_15 == null ? 0 : arr_conv_15.ptr & ~1).toArray());
+ bindings.CommitmentUpdate_set_update_add_htlcs(this.ptr, Arrays.stream(val).mapToLong(val_conv_15 -> val_conv_15 == null ? 0 : val_conv_15.ptr & ~1).toArray());
/* TODO 2 UpdateAddHTLC */;
}
public void set_update_fulfill_htlcs(UpdateFulfillHTLC[] val) {
- bindings.CommitmentUpdate_set_update_fulfill_htlcs(this.ptr, Arrays.stream(val).mapToLong(arr_conv_19 -> arr_conv_19 == null ? 0 : arr_conv_19.ptr & ~1).toArray());
+ bindings.CommitmentUpdate_set_update_fulfill_htlcs(this.ptr, Arrays.stream(val).mapToLong(val_conv_19 -> val_conv_19 == null ? 0 : val_conv_19.ptr & ~1).toArray());
/* TODO 2 UpdateFulfillHTLC */;
}
public void set_update_fail_htlcs(UpdateFailHTLC[] val) {
- bindings.CommitmentUpdate_set_update_fail_htlcs(this.ptr, Arrays.stream(val).mapToLong(arr_conv_16 -> arr_conv_16 == null ? 0 : arr_conv_16.ptr & ~1).toArray());
+ bindings.CommitmentUpdate_set_update_fail_htlcs(this.ptr, Arrays.stream(val).mapToLong(val_conv_16 -> val_conv_16 == null ? 0 : val_conv_16.ptr & ~1).toArray());
/* TODO 2 UpdateFailHTLC */;
}
public void set_update_fail_malformed_htlcs(UpdateFailMalformedHTLC[] val) {
- bindings.CommitmentUpdate_set_update_fail_malformed_htlcs(this.ptr, Arrays.stream(val).mapToLong(arr_conv_25 -> arr_conv_25 == null ? 0 : arr_conv_25.ptr & ~1).toArray());
+ bindings.CommitmentUpdate_set_update_fail_malformed_htlcs(this.ptr, Arrays.stream(val).mapToLong(val_conv_25 -> val_conv_25 == null ? 0 : val_conv_25.ptr & ~1).toArray());
/* TODO 2 UpdateFailMalformedHTLC */;
}
}
public static CommitmentUpdate constructor_new(UpdateAddHTLC[] update_add_htlcs_arg, UpdateFulfillHTLC[] update_fulfill_htlcs_arg, UpdateFailHTLC[] update_fail_htlcs_arg, UpdateFailMalformedHTLC[] update_fail_malformed_htlcs_arg, UpdateFee update_fee_arg, CommitmentSigned commitment_signed_arg) {
- long ret = bindings.CommitmentUpdate_new(Arrays.stream(update_add_htlcs_arg).mapToLong(arr_conv_15 -> arr_conv_15 == null ? 0 : arr_conv_15.ptr & ~1).toArray(), Arrays.stream(update_fulfill_htlcs_arg).mapToLong(arr_conv_19 -> arr_conv_19 == null ? 0 : arr_conv_19.ptr & ~1).toArray(), Arrays.stream(update_fail_htlcs_arg).mapToLong(arr_conv_16 -> arr_conv_16 == null ? 0 : arr_conv_16.ptr & ~1).toArray(), Arrays.stream(update_fail_malformed_htlcs_arg).mapToLong(arr_conv_25 -> arr_conv_25 == null ? 0 : arr_conv_25.ptr & ~1).toArray(), update_fee_arg == null ? 0 : update_fee_arg.ptr & ~1, commitment_signed_arg == null ? 0 : commitment_signed_arg.ptr & ~1);
+ long ret = bindings.CommitmentUpdate_new(Arrays.stream(update_add_htlcs_arg).mapToLong(update_add_htlcs_arg_conv_15 -> update_add_htlcs_arg_conv_15 == null ? 0 : update_add_htlcs_arg_conv_15.ptr & ~1).toArray(), Arrays.stream(update_fulfill_htlcs_arg).mapToLong(update_fulfill_htlcs_arg_conv_19 -> update_fulfill_htlcs_arg_conv_19 == null ? 0 : update_fulfill_htlcs_arg_conv_19.ptr & ~1).toArray(), Arrays.stream(update_fail_htlcs_arg).mapToLong(update_fail_htlcs_arg_conv_16 -> update_fail_htlcs_arg_conv_16 == null ? 0 : update_fail_htlcs_arg_conv_16.ptr & ~1).toArray(), Arrays.stream(update_fail_malformed_htlcs_arg).mapToLong(update_fail_malformed_htlcs_arg_conv_25 -> update_fail_malformed_htlcs_arg_conv_25 == null ? 0 : update_fail_malformed_htlcs_arg_conv_25.ptr & ~1).toArray(), update_fee_arg == null ? 0 : update_fee_arg.ptr & ~1, commitment_signed_arg == null ? 0 : commitment_signed_arg.ptr & ~1);
CommitmentUpdate ret_hu_conv = new CommitmentUpdate(null, ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
/* TODO 2 UpdateAddHTLC */;
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class DelayedPaymentOutputDescriptor extends CommonBase {
+ DelayedPaymentOutputDescriptor(Object _dummy, long ptr) { super(ptr); }
+ @Override @SuppressWarnings("deprecation")
+ protected void finalize() throws Throwable {
+ super.finalize();
+ if (ptr != 0) { bindings.DelayedPaymentOutputDescriptor_free(ptr); }
+ }
+
+ public OutPoint get_outpoint() {
+ long ret = bindings.DelayedPaymentOutputDescriptor_get_outpoint(this.ptr);
+ OutPoint ret_hu_conv = new OutPoint(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
+ public void set_outpoint(OutPoint val) {
+ bindings.DelayedPaymentOutputDescriptor_set_outpoint(this.ptr, val == null ? 0 : val.ptr & ~1);
+ this.ptrs_to.add(val);
+ }
+
+ public byte[] get_per_commitment_point() {
+ byte[] ret = bindings.DelayedPaymentOutputDescriptor_get_per_commitment_point(this.ptr);
+ return ret;
+ }
+
+ public void set_per_commitment_point(byte[] val) {
+ bindings.DelayedPaymentOutputDescriptor_set_per_commitment_point(this.ptr, val);
+ }
+
+ public short get_to_self_delay() {
+ short ret = bindings.DelayedPaymentOutputDescriptor_get_to_self_delay(this.ptr);
+ return ret;
+ }
+
+ public void set_to_self_delay(short val) {
+ bindings.DelayedPaymentOutputDescriptor_set_to_self_delay(this.ptr, val);
+ }
+
+ public void set_output(TxOut val) {
+ bindings.DelayedPaymentOutputDescriptor_set_output(this.ptr, val.ptr);
+ }
+
+ public byte[] get_revocation_pubkey() {
+ byte[] ret = bindings.DelayedPaymentOutputDescriptor_get_revocation_pubkey(this.ptr);
+ return ret;
+ }
+
+ public void set_revocation_pubkey(byte[] val) {
+ bindings.DelayedPaymentOutputDescriptor_set_revocation_pubkey(this.ptr, val);
+ }
+
+ public byte[] get_channel_keys_id() {
+ byte[] ret = bindings.DelayedPaymentOutputDescriptor_get_channel_keys_id(this.ptr);
+ return ret;
+ }
+
+ public void set_channel_keys_id(byte[] val) {
+ bindings.DelayedPaymentOutputDescriptor_set_channel_keys_id(this.ptr, val);
+ }
+
+ public long get_channel_value_satoshis() {
+ long ret = bindings.DelayedPaymentOutputDescriptor_get_channel_value_satoshis(this.ptr);
+ return ret;
+ }
+
+ public void set_channel_value_satoshis(long val) {
+ bindings.DelayedPaymentOutputDescriptor_set_channel_value_satoshis(this.ptr, val);
+ }
+
+ public static DelayedPaymentOutputDescriptor constructor_new(OutPoint outpoint_arg, byte[] per_commitment_point_arg, short to_self_delay_arg, TxOut output_arg, byte[] revocation_pubkey_arg, byte[] channel_keys_id_arg, long channel_value_satoshis_arg) {
+ long ret = bindings.DelayedPaymentOutputDescriptor_new(outpoint_arg == null ? 0 : outpoint_arg.ptr & ~1, per_commitment_point_arg, to_self_delay_arg, output_arg.ptr, revocation_pubkey_arg, channel_keys_id_arg, channel_value_satoshis_arg);
+ DelayedPaymentOutputDescriptor ret_hu_conv = new DelayedPaymentOutputDescriptor(null, ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ ret_hu_conv.ptrs_to.add(outpoint_arg);
+ return ret_hu_conv;
+ }
+
+ public DelayedPaymentOutputDescriptor clone() {
+ long ret = bindings.DelayedPaymentOutputDescriptor_clone(this.ptr);
+ DelayedPaymentOutputDescriptor ret_hu_conv = new DelayedPaymentOutputDescriptor(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
+}
private SpendableOutputs(long ptr, bindings.LDKEvent.SpendableOutputs obj) {
super(null, ptr);
long[] outputs = obj.outputs;
- SpendableOutputDescriptor[] arr_conv_27_arr = new SpendableOutputDescriptor[outputs.length];
+ SpendableOutputDescriptor[] outputs_conv_27_arr = new SpendableOutputDescriptor[outputs.length];
for (int b = 0; b < outputs.length; b++) {
- long arr_conv_27 = outputs[b];
- SpendableOutputDescriptor arr_conv_27_hu_conv = SpendableOutputDescriptor.constr_from_ptr(arr_conv_27);
- arr_conv_27_hu_conv.ptrs_to.add(this);
- arr_conv_27_arr[b] = arr_conv_27_hu_conv;
+ long outputs_conv_27 = outputs[b];
+ SpendableOutputDescriptor outputs_conv_27_hu_conv = SpendableOutputDescriptor.constr_from_ptr(outputs_conv_27);
+ outputs_conv_27_hu_conv.ptrs_to.add(this);
+ outputs_conv_27_arr[b] = outputs_conv_27_hu_conv;
}
- this.outputs = arr_conv_27_arr;
+ this.outputs = outputs_conv_27_arr;
}
}
}
impl_holder.held = new EventsProvider(new bindings.LDKEventsProvider() {
@Override public long[] get_and_clear_pending_events() {
Event[] ret = arg.get_and_clear_pending_events();
- long[] result = Arrays.stream(ret).mapToLong(arr_conv_7 -> arr_conv_7.ptr).toArray();
+ long[] result = Arrays.stream(ret).mapToLong(ret_conv_7 -> ret_conv_7.ptr).toArray();
/* TODO 2 Event */;
return result;
}
}
public Event[] get_and_clear_pending_events() {
long[] ret = bindings.EventsProvider_get_and_clear_pending_events(this.ptr);
- Event[] arr_conv_7_arr = new Event[ret.length];
+ Event[] ret_conv_7_arr = new Event[ret.length];
for (int h = 0; h < ret.length; h++) {
- long arr_conv_7 = ret[h];
- Event arr_conv_7_hu_conv = Event.constr_from_ptr(arr_conv_7);
- arr_conv_7_hu_conv.ptrs_to.add(this);
- arr_conv_7_arr[h] = arr_conv_7_hu_conv;
+ long ret_conv_7 = ret[h];
+ Event ret_conv_7_hu_conv = Event.constr_from_ptr(ret_conv_7);
+ ret_conv_7_hu_conv.ptrs_to.add(this);
+ ret_conv_7_arr[h] = ret_conv_7_hu_conv;
}
- return arr_conv_7_arr;
+ return ret_conv_7_arr;
}
}
+++ /dev/null
-package org.ldk.structs;
-
-import org.ldk.impl.bindings;
-import org.ldk.enums.*;
-import org.ldk.util.*;
-import java.util.Arrays;
-
-@SuppressWarnings("unchecked") // We correctly assign various generic arrays
-public class InMemoryChannelKeys extends CommonBase {
- InMemoryChannelKeys(Object _dummy, long ptr) { super(ptr); }
- @Override @SuppressWarnings("deprecation")
- protected void finalize() throws Throwable {
- super.finalize();
- if (ptr != 0) { bindings.InMemoryChannelKeys_free(ptr); }
- }
-
- public byte[] get_funding_key() {
- byte[] ret = bindings.InMemoryChannelKeys_get_funding_key(this.ptr);
- return ret;
- }
-
- public void set_funding_key(byte[] val) {
- bindings.InMemoryChannelKeys_set_funding_key(this.ptr, val);
- }
-
- public byte[] get_revocation_base_key() {
- byte[] ret = bindings.InMemoryChannelKeys_get_revocation_base_key(this.ptr);
- return ret;
- }
-
- public void set_revocation_base_key(byte[] val) {
- bindings.InMemoryChannelKeys_set_revocation_base_key(this.ptr, val);
- }
-
- public byte[] get_payment_key() {
- byte[] ret = bindings.InMemoryChannelKeys_get_payment_key(this.ptr);
- return ret;
- }
-
- public void set_payment_key(byte[] val) {
- bindings.InMemoryChannelKeys_set_payment_key(this.ptr, val);
- }
-
- public byte[] get_delayed_payment_base_key() {
- byte[] ret = bindings.InMemoryChannelKeys_get_delayed_payment_base_key(this.ptr);
- return ret;
- }
-
- public void set_delayed_payment_base_key(byte[] val) {
- bindings.InMemoryChannelKeys_set_delayed_payment_base_key(this.ptr, val);
- }
-
- public byte[] get_htlc_base_key() {
- byte[] ret = bindings.InMemoryChannelKeys_get_htlc_base_key(this.ptr);
- return ret;
- }
-
- public void set_htlc_base_key(byte[] val) {
- bindings.InMemoryChannelKeys_set_htlc_base_key(this.ptr, val);
- }
-
- public byte[] get_commitment_seed() {
- byte[] ret = bindings.InMemoryChannelKeys_get_commitment_seed(this.ptr);
- return ret;
- }
-
- public void set_commitment_seed(byte[] val) {
- bindings.InMemoryChannelKeys_set_commitment_seed(this.ptr, val);
- }
-
- public InMemoryChannelKeys clone() {
- long ret = bindings.InMemoryChannelKeys_clone(this.ptr);
- InMemoryChannelKeys ret_hu_conv = new InMemoryChannelKeys(null, ret);
- ret_hu_conv.ptrs_to.add(this);
- return ret_hu_conv;
- }
-
- public static InMemoryChannelKeys constructor_new(byte[] funding_key, byte[] revocation_base_key, byte[] payment_key, byte[] delayed_payment_base_key, byte[] htlc_base_key, byte[] commitment_seed, long channel_value_satoshis, TwoTuple<Long, Long> key_derivation_params) {
- long ret = bindings.InMemoryChannelKeys_new(funding_key, revocation_base_key, payment_key, delayed_payment_base_key, htlc_base_key, commitment_seed, channel_value_satoshis, bindings.C2Tuple_u64u64Z_new(key_derivation_params.a, key_derivation_params.b));
- InMemoryChannelKeys ret_hu_conv = new InMemoryChannelKeys(null, ret);
- ret_hu_conv.ptrs_to.add(ret_hu_conv);
- return ret_hu_conv;
- }
-
- public ChannelPublicKeys counterparty_pubkeys() {
- long ret = bindings.InMemoryChannelKeys_counterparty_pubkeys(this.ptr);
- ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret);
- ret_hu_conv.ptrs_to.add(this);
- return ret_hu_conv;
- }
-
- public short counterparty_selected_contest_delay() {
- short ret = bindings.InMemoryChannelKeys_counterparty_selected_contest_delay(this.ptr);
- return ret;
- }
-
- public short holder_selected_contest_delay() {
- short ret = bindings.InMemoryChannelKeys_holder_selected_contest_delay(this.ptr);
- return ret;
- }
-
- public boolean is_outbound() {
- boolean ret = bindings.InMemoryChannelKeys_is_outbound(this.ptr);
- return ret;
- }
-
- public OutPoint funding_outpoint() {
- long ret = bindings.InMemoryChannelKeys_funding_outpoint(this.ptr);
- OutPoint ret_hu_conv = new OutPoint(null, ret);
- ret_hu_conv.ptrs_to.add(this);
- return ret_hu_conv;
- }
-
- public ChannelTransactionParameters get_channel_parameters() {
- long ret = bindings.InMemoryChannelKeys_get_channel_parameters(this.ptr);
- ChannelTransactionParameters ret_hu_conv = new ChannelTransactionParameters(null, ret);
- ret_hu_conv.ptrs_to.add(this);
- return ret_hu_conv;
- }
-
- public ChannelKeys as_ChannelKeys() {
- long ret = bindings.InMemoryChannelKeys_as_ChannelKeys(this.ptr);
- ChannelKeys ret_hu_conv = new ChannelKeys(null, ret);
- ret_hu_conv.ptrs_to.add(this);
- return ret_hu_conv;
- }
-
- public byte[] write() {
- byte[] ret = bindings.InMemoryChannelKeys_write(this.ptr);
- return ret;
- }
-
- public static Result_InMemoryChannelKeysDecodeErrorZ constructor_read(byte[] ser) {
- long ret = bindings.InMemoryChannelKeys_read(ser);
- Result_InMemoryChannelKeysDecodeErrorZ ret_hu_conv = Result_InMemoryChannelKeysDecodeErrorZ.constr_from_ptr(ret);
- return ret_hu_conv;
- }
-
-}
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class InMemorySigner extends CommonBase {
+ InMemorySigner(Object _dummy, long ptr) { super(ptr); }
+ @Override @SuppressWarnings("deprecation")
+ protected void finalize() throws Throwable {
+ super.finalize();
+ if (ptr != 0) { bindings.InMemorySigner_free(ptr); }
+ }
+
+ public byte[] get_funding_key() {
+ byte[] ret = bindings.InMemorySigner_get_funding_key(this.ptr);
+ return ret;
+ }
+
+ public void set_funding_key(byte[] val) {
+ bindings.InMemorySigner_set_funding_key(this.ptr, val);
+ }
+
+ public byte[] get_revocation_base_key() {
+ byte[] ret = bindings.InMemorySigner_get_revocation_base_key(this.ptr);
+ return ret;
+ }
+
+ public void set_revocation_base_key(byte[] val) {
+ bindings.InMemorySigner_set_revocation_base_key(this.ptr, val);
+ }
+
+ public byte[] get_payment_key() {
+ byte[] ret = bindings.InMemorySigner_get_payment_key(this.ptr);
+ return ret;
+ }
+
+ public void set_payment_key(byte[] val) {
+ bindings.InMemorySigner_set_payment_key(this.ptr, val);
+ }
+
+ public byte[] get_delayed_payment_base_key() {
+ byte[] ret = bindings.InMemorySigner_get_delayed_payment_base_key(this.ptr);
+ return ret;
+ }
+
+ public void set_delayed_payment_base_key(byte[] val) {
+ bindings.InMemorySigner_set_delayed_payment_base_key(this.ptr, val);
+ }
+
+ public byte[] get_htlc_base_key() {
+ byte[] ret = bindings.InMemorySigner_get_htlc_base_key(this.ptr);
+ return ret;
+ }
+
+ public void set_htlc_base_key(byte[] val) {
+ bindings.InMemorySigner_set_htlc_base_key(this.ptr, val);
+ }
+
+ public byte[] get_commitment_seed() {
+ byte[] ret = bindings.InMemorySigner_get_commitment_seed(this.ptr);
+ return ret;
+ }
+
+ public void set_commitment_seed(byte[] val) {
+ bindings.InMemorySigner_set_commitment_seed(this.ptr, val);
+ }
+
+ public InMemorySigner clone() {
+ long ret = bindings.InMemorySigner_clone(this.ptr);
+ InMemorySigner ret_hu_conv = new InMemorySigner(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
+ public static InMemorySigner constructor_new(byte[] funding_key, byte[] revocation_base_key, byte[] payment_key, byte[] delayed_payment_base_key, byte[] htlc_base_key, byte[] commitment_seed, long channel_value_satoshis, byte[] channel_keys_id) {
+ long ret = bindings.InMemorySigner_new(funding_key, revocation_base_key, payment_key, delayed_payment_base_key, htlc_base_key, commitment_seed, channel_value_satoshis, channel_keys_id);
+ InMemorySigner ret_hu_conv = new InMemorySigner(null, ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ return ret_hu_conv;
+ }
+
+ public ChannelPublicKeys counterparty_pubkeys() {
+ long ret = bindings.InMemorySigner_counterparty_pubkeys(this.ptr);
+ ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
+ public short counterparty_selected_contest_delay() {
+ short ret = bindings.InMemorySigner_counterparty_selected_contest_delay(this.ptr);
+ return ret;
+ }
+
+ public short holder_selected_contest_delay() {
+ short ret = bindings.InMemorySigner_holder_selected_contest_delay(this.ptr);
+ return ret;
+ }
+
+ public boolean is_outbound() {
+ boolean ret = bindings.InMemorySigner_is_outbound(this.ptr);
+ return ret;
+ }
+
+ public OutPoint funding_outpoint() {
+ long ret = bindings.InMemorySigner_funding_outpoint(this.ptr);
+ OutPoint ret_hu_conv = new OutPoint(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
+ public ChannelTransactionParameters get_channel_parameters() {
+ long ret = bindings.InMemorySigner_get_channel_parameters(this.ptr);
+ ChannelTransactionParameters ret_hu_conv = new ChannelTransactionParameters(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
+ public Result_CVec_CVec_u8ZZNoneZ sign_counterparty_payment_input(byte[] spend_tx, long input_idx, StaticPaymentOutputDescriptor descriptor) {
+ long ret = bindings.InMemorySigner_sign_counterparty_payment_input(this.ptr, spend_tx, input_idx, descriptor == null ? 0 : descriptor.ptr & ~1);
+ Result_CVec_CVec_u8ZZNoneZ ret_hu_conv = Result_CVec_CVec_u8ZZNoneZ.constr_from_ptr(ret);
+ this.ptrs_to.add(descriptor);
+ return ret_hu_conv;
+ }
+
+ public Result_CVec_CVec_u8ZZNoneZ sign_dynamic_p2wsh_input(byte[] spend_tx, long input_idx, DelayedPaymentOutputDescriptor descriptor) {
+ long ret = bindings.InMemorySigner_sign_dynamic_p2wsh_input(this.ptr, spend_tx, input_idx, descriptor == null ? 0 : descriptor.ptr & ~1);
+ Result_CVec_CVec_u8ZZNoneZ ret_hu_conv = Result_CVec_CVec_u8ZZNoneZ.constr_from_ptr(ret);
+ this.ptrs_to.add(descriptor);
+ return ret_hu_conv;
+ }
+
+ public Sign as_Sign() {
+ long ret = bindings.InMemorySigner_as_Sign(this.ptr);
+ Sign ret_hu_conv = new Sign(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
+ public byte[] write() {
+ byte[] ret = bindings.InMemorySigner_write(this.ptr);
+ return ret;
+ }
+
+ public static Result_InMemorySignerDecodeErrorZ constructor_read(byte[] ser) {
+ long ret = bindings.InMemorySigner_read(ser);
+ Result_InMemorySignerDecodeErrorZ ret_hu_conv = Result_InMemorySignerDecodeErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+}
if (ptr != 0) { bindings.Init_free(ptr); }
}
+ public InitFeatures get_features() {
+ long ret = bindings.Init_get_features(this.ptr);
+ InitFeatures ret_hu_conv = new InitFeatures(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
+ public void set_features(InitFeatures val) {
+ bindings.Init_set_features(this.ptr, val == null ? 0 : val.ptr & ~1);
+ this.ptrs_to.add(val);
+ }
+
+ public static Init constructor_new(InitFeatures features_arg) {
+ long ret = bindings.Init_new(features_arg == null ? 0 : features_arg.ptr & ~1);
+ Init ret_hu_conv = new Init(null, ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ ret_hu_conv.ptrs_to.add(features_arg);
+ return ret_hu_conv;
+ }
+
public Init clone() {
long ret = bindings.Init_clone(this.ptr);
Init ret_hu_conv = new Init(null, ret);
byte[] get_node_secret();
byte[] get_destination_script();
byte[] get_shutdown_pubkey();
- ChannelKeys get_channel_keys(boolean inbound, long channel_value_satoshis);
+ Sign get_channel_signer(boolean inbound, long channel_value_satoshis);
byte[] get_secure_random_bytes();
- Result_ChannelKeysDecodeErrorZ read_chan_signer(byte[] reader);
+ Result_SignDecodeErrorZ read_chan_signer(byte[] reader);
}
private static class LDKKeysInterfaceHolder { KeysInterface held; }
public static KeysInterface new_impl(KeysInterfaceInterface arg) {
byte[] ret = arg.get_shutdown_pubkey();
return ret;
}
- @Override public long get_channel_keys(boolean inbound, long channel_value_satoshis) {
- ChannelKeys ret = arg.get_channel_keys(inbound, channel_value_satoshis);
+ @Override public long get_channel_signer(boolean inbound, long channel_value_satoshis) {
+ Sign ret = arg.get_channel_signer(inbound, channel_value_satoshis);
long result = ret == null ? 0 : ret.ptr;
impl_holder.held.ptrs_to.add(ret);
return result;
return ret;
}
@Override public long read_chan_signer(byte[] reader) {
- Result_ChannelKeysDecodeErrorZ ret = arg.read_chan_signer(reader);
+ Result_SignDecodeErrorZ ret = arg.read_chan_signer(reader);
long result = ret != null ? ret.ptr : 0;
return result;
}
return ret;
}
- public ChannelKeys get_channel_keys(boolean inbound, long channel_value_satoshis) {
- long ret = bindings.KeysInterface_get_channel_keys(this.ptr, inbound, channel_value_satoshis);
- ChannelKeys ret_hu_conv = new ChannelKeys(null, ret);
+ public Sign get_channel_signer(boolean inbound, long channel_value_satoshis) {
+ long ret = bindings.KeysInterface_get_channel_signer(this.ptr, inbound, channel_value_satoshis);
+ Sign ret_hu_conv = new Sign(null, ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
}
return ret;
}
- public Result_ChannelKeysDecodeErrorZ read_chan_signer(byte[] reader) {
+ public Result_SignDecodeErrorZ read_chan_signer(byte[] reader) {
long ret = bindings.KeysInterface_read_chan_signer(this.ptr, reader);
- Result_ChannelKeysDecodeErrorZ ret_hu_conv = Result_ChannelKeysDecodeErrorZ.constr_from_ptr(ret);
+ Result_SignDecodeErrorZ ret_hu_conv = Result_SignDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
if (ptr != 0) { bindings.KeysManager_free(ptr); }
}
- public static KeysManager constructor_new(byte[] seed, LDKNetwork network, long starting_time_secs, int starting_time_nanos) {
- long ret = bindings.KeysManager_new(seed, network, starting_time_secs, starting_time_nanos);
+ public static KeysManager constructor_new(byte[] seed, long starting_time_secs, int starting_time_nanos) {
+ long ret = bindings.KeysManager_new(seed, starting_time_secs, starting_time_nanos);
KeysManager ret_hu_conv = new KeysManager(null, ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
return ret_hu_conv;
}
- public InMemoryChannelKeys derive_channel_keys(long channel_value_satoshis, long params_1, long params_2) {
- long ret = bindings.KeysManager_derive_channel_keys(this.ptr, channel_value_satoshis, params_1, params_2);
- InMemoryChannelKeys ret_hu_conv = new InMemoryChannelKeys(null, ret);
+ public InMemorySigner derive_channel_keys(long channel_value_satoshis, byte[] params) {
+ long ret = bindings.KeysManager_derive_channel_keys(this.ptr, channel_value_satoshis, params);
+ InMemorySigner ret_hu_conv = new InMemorySigner(null, ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
}
+ public Result_TransactionNoneZ spend_spendable_outputs(SpendableOutputDescriptor[] descriptors, TxOut[] outputs, byte[] change_destination_script, int feerate_sat_per_1000_weight) {
+ long ret = bindings.KeysManager_spend_spendable_outputs(this.ptr, Arrays.stream(descriptors).mapToLong(descriptors_conv_27 -> descriptors_conv_27.ptr).toArray(), Arrays.stream(outputs).mapToLong(outputs_conv_7 -> outputs_conv_7.ptr).toArray(), change_destination_script, feerate_sat_per_1000_weight);
+ Result_TransactionNoneZ ret_hu_conv = Result_TransactionNoneZ.constr_from_ptr(ret);
+ /* TODO 2 SpendableOutputDescriptor */;
+ /* TODO 2 TxOut */;
+ return ret_hu_conv;
+ }
+
public KeysInterface as_KeysInterface() {
long ret = bindings.KeysManager_as_KeysInterface(this.ptr);
KeysInterface ret_hu_conv = new KeysInterface(null, ret);
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class Listen extends CommonBase {
+ final bindings.LDKListen bindings_instance;
+ Listen(Object _dummy, long ptr) { super(ptr); bindings_instance = null; }
+ private Listen(bindings.LDKListen arg) {
+ super(bindings.LDKListen_new(arg));
+ this.ptrs_to.add(arg);
+ this.bindings_instance = arg;
+ }
+ @Override @SuppressWarnings("deprecation")
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.Listen_free(ptr); } super.finalize();
+ }
+
+ public static interface ListenInterface {
+ void block_connected(byte[] block, int height);
+ void block_disconnected(byte[] header, int height);
+ }
+ private static class LDKListenHolder { Listen held; }
+ public static Listen new_impl(ListenInterface arg) {
+ final LDKListenHolder impl_holder = new LDKListenHolder();
+ impl_holder.held = new Listen(new bindings.LDKListen() {
+ @Override public void block_connected(byte[] block, int height) {
+ arg.block_connected(block, height);
+ }
+ @Override public void block_disconnected(byte[] header, int height) {
+ arg.block_disconnected(header, height);
+ }
+ });
+ return impl_holder.held;
+ }
+ public void block_connected(byte[] block, int height) {
+ bindings.Listen_block_connected(this.ptr, block, height);
+ }
+
+ public void block_disconnected(byte[] header, int height) {
+ bindings.Listen_block_disconnected(this.ptr, header, height);
+ }
+
+}
impl_holder.held = new MessageSendEventsProvider(new bindings.LDKMessageSendEventsProvider() {
@Override public long[] get_and_clear_pending_msg_events() {
MessageSendEvent[] ret = arg.get_and_clear_pending_msg_events();
- long[] result = Arrays.stream(ret).mapToLong(arr_conv_18 -> arr_conv_18.ptr).toArray();
+ long[] result = Arrays.stream(ret).mapToLong(ret_conv_18 -> ret_conv_18.ptr).toArray();
/* TODO 2 MessageSendEvent */;
return result;
}
}
public MessageSendEvent[] get_and_clear_pending_msg_events() {
long[] ret = bindings.MessageSendEventsProvider_get_and_clear_pending_msg_events(this.ptr);
- MessageSendEvent[] arr_conv_18_arr = new MessageSendEvent[ret.length];
+ MessageSendEvent[] ret_conv_18_arr = new MessageSendEvent[ret.length];
for (int s = 0; s < ret.length; s++) {
- long arr_conv_18 = ret[s];
- MessageSendEvent arr_conv_18_hu_conv = MessageSendEvent.constr_from_ptr(arr_conv_18);
- arr_conv_18_hu_conv.ptrs_to.add(this);
- arr_conv_18_arr[s] = arr_conv_18_hu_conv;
+ long ret_conv_18 = ret[s];
+ MessageSendEvent ret_conv_18_hu_conv = MessageSendEvent.constr_from_ptr(ret_conv_18);
+ ret_conv_18_hu_conv.ptrs_to.add(this);
+ ret_conv_18_arr[s] = ret_conv_18_hu_conv;
}
- return arr_conv_18_arr;
+ return ret_conv_18_arr;
}
}
@SuppressWarnings("unchecked") // We correctly assign various generic arrays
public class MonitorEvent extends CommonBase {
- MonitorEvent(Object _dummy, long ptr) { super(ptr); }
+ private MonitorEvent(Object _dummy, long ptr) { super(ptr); }
@Override @SuppressWarnings("deprecation")
protected void finalize() throws Throwable {
super.finalize();
if (ptr != 0) { bindings.MonitorEvent_free(ptr); }
}
-
- public MonitorEvent clone() {
- long ret = bindings.MonitorEvent_clone(this.ptr);
- MonitorEvent ret_hu_conv = new MonitorEvent(null, ret);
- ret_hu_conv.ptrs_to.add(this);
- return ret_hu_conv;
+ static MonitorEvent constr_from_ptr(long ptr) {
+ bindings.LDKMonitorEvent raw_val = bindings.LDKMonitorEvent_ref_from_ptr(ptr);
+ if (raw_val.getClass() == bindings.LDKMonitorEvent.HTLCEvent.class) {
+ return new HTLCEvent(ptr, (bindings.LDKMonitorEvent.HTLCEvent)raw_val);
+ }
+ if (raw_val.getClass() == bindings.LDKMonitorEvent.CommitmentTxBroadcasted.class) {
+ return new CommitmentTxBroadcasted(ptr, (bindings.LDKMonitorEvent.CommitmentTxBroadcasted)raw_val);
+ }
+ assert false; return null; // Unreachable without extending the (internal) bindings interface
}
+ public final static class HTLCEvent extends MonitorEvent {
+ private HTLCEvent(long ptr, bindings.LDKMonitorEvent.HTLCEvent obj) {
+ super(null, ptr);
+ }
+ }
+ public final static class CommitmentTxBroadcasted extends MonitorEvent {
+ private CommitmentTxBroadcasted(long ptr, bindings.LDKMonitorEvent.CommitmentTxBroadcasted obj) {
+ super(null, ptr);
+ }
+ }
}
return ret_hu_conv;
}
- public static NetGraphMsgHandler constructor_from_net_graph(Access chain_access, Logger logger, byte[] network_graph_genesis_hash) {
- long ret = bindings.NetGraphMsgHandler_from_net_graph(chain_access == null ? 0 : chain_access.ptr, logger == null ? 0 : logger.ptr, bindings.NetworkGraph_new(network_graph_genesis_hash));
+ public static NetGraphMsgHandler constructor_from_net_graph(Access chain_access, Logger logger, NetworkGraph network_graph) {
+ long ret = bindings.NetGraphMsgHandler_from_net_graph(chain_access == null ? 0 : chain_access.ptr, logger == null ? 0 : logger.ptr, network_graph == null ? 0 : network_graph.ptr & ~1);
NetGraphMsgHandler ret_hu_conv = new NetGraphMsgHandler(null, ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
ret_hu_conv.ptrs_to.add(chain_access);
ret_hu_conv.ptrs_to.add(logger);
+ ret_hu_conv.ptrs_to.add(network_graph);
return ret_hu_conv;
}
if (ptr != 0) { bindings.NetworkGraph_free(ptr); }
}
+ public NetworkGraph clone() {
+ long ret = bindings.NetworkGraph_clone(this.ptr);
+ NetworkGraph ret_hu_conv = new NetworkGraph(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
public byte[] write() {
byte[] ret = bindings.NetworkGraph_write(this.ptr);
return ret;
}
public void set_addresses(NetAddress[] val) {
- bindings.NodeAnnouncementInfo_set_addresses(this.ptr, Arrays.stream(val).mapToLong(arr_conv_12 -> arr_conv_12.ptr).toArray());
+ bindings.NodeAnnouncementInfo_set_addresses(this.ptr, Arrays.stream(val).mapToLong(val_conv_12 -> val_conv_12.ptr).toArray());
/* TODO 2 NetAddress */;
}
}
public static NodeAnnouncementInfo constructor_new(NodeFeatures features_arg, int last_update_arg, byte[] rgb_arg, byte[] alias_arg, NetAddress[] addresses_arg, NodeAnnouncement announcement_message_arg) {
- long ret = bindings.NodeAnnouncementInfo_new(features_arg == null ? 0 : features_arg.ptr & ~1, last_update_arg, rgb_arg, alias_arg, Arrays.stream(addresses_arg).mapToLong(arr_conv_12 -> arr_conv_12.ptr).toArray(), announcement_message_arg == null ? 0 : announcement_message_arg.ptr & ~1);
+ long ret = bindings.NodeAnnouncementInfo_new(features_arg == null ? 0 : features_arg.ptr & ~1, last_update_arg, rgb_arg, alias_arg, Arrays.stream(addresses_arg).mapToLong(addresses_arg_conv_12 -> addresses_arg_conv_12.ptr).toArray(), announcement_message_arg == null ? 0 : announcement_message_arg.ptr & ~1);
NodeAnnouncementInfo ret_hu_conv = new NodeAnnouncementInfo(null, ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
ret_hu_conv.ptrs_to.add(features_arg);
@SuppressWarnings("unchecked") // We correctly assign various generic arrays
public class PaymentSendFailure extends CommonBase {
- PaymentSendFailure(Object _dummy, long ptr) { super(ptr); }
+ private PaymentSendFailure(Object _dummy, long ptr) { super(ptr); }
@Override @SuppressWarnings("deprecation")
protected void finalize() throws Throwable {
super.finalize();
if (ptr != 0) { bindings.PaymentSendFailure_free(ptr); }
}
-
- public PaymentSendFailure clone() {
- long ret = bindings.PaymentSendFailure_clone(this.ptr);
- PaymentSendFailure ret_hu_conv = new PaymentSendFailure(null, ret);
- ret_hu_conv.ptrs_to.add(this);
- return ret_hu_conv;
+ static PaymentSendFailure constr_from_ptr(long ptr) {
+ bindings.LDKPaymentSendFailure raw_val = bindings.LDKPaymentSendFailure_ref_from_ptr(ptr);
+ if (raw_val.getClass() == bindings.LDKPaymentSendFailure.ParameterError.class) {
+ return new ParameterError(ptr, (bindings.LDKPaymentSendFailure.ParameterError)raw_val);
+ }
+ if (raw_val.getClass() == bindings.LDKPaymentSendFailure.PathParameterError.class) {
+ return new PathParameterError(ptr, (bindings.LDKPaymentSendFailure.PathParameterError)raw_val);
+ }
+ if (raw_val.getClass() == bindings.LDKPaymentSendFailure.AllFailedRetrySafe.class) {
+ return new AllFailedRetrySafe(ptr, (bindings.LDKPaymentSendFailure.AllFailedRetrySafe)raw_val);
+ }
+ if (raw_val.getClass() == bindings.LDKPaymentSendFailure.PartialFailure.class) {
+ return new PartialFailure(ptr, (bindings.LDKPaymentSendFailure.PartialFailure)raw_val);
+ }
+ assert false; return null; // Unreachable without extending the (internal) bindings interface
}
+ public final static class ParameterError extends PaymentSendFailure {
+ private ParameterError(long ptr, bindings.LDKPaymentSendFailure.ParameterError obj) {
+ super(null, ptr);
+ }
+ }
+ public final static class PathParameterError extends PaymentSendFailure {
+ private PathParameterError(long ptr, bindings.LDKPaymentSendFailure.PathParameterError obj) {
+ super(null, ptr);
+ }
+ }
+ public final static class AllFailedRetrySafe extends PaymentSendFailure {
+ private AllFailedRetrySafe(long ptr, bindings.LDKPaymentSendFailure.AllFailedRetrySafe obj) {
+ super(null, ptr);
+ }
+ }
+ public final static class PartialFailure extends PaymentSendFailure {
+ private PartialFailure(long ptr, bindings.LDKPaymentSendFailure.PartialFailure obj) {
+ super(null, ptr);
+ }
+ }
}
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class Result_AcceptChannelDecodeErrorZ extends CommonBase {
+ private Result_AcceptChannelDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_AcceptChannelDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_AcceptChannelDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_AcceptChannelDecodeErrorZ_result_ok(ptr)) {
+ return new Result_AcceptChannelDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_AcceptChannelDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_AcceptChannelDecodeErrorZ_OK extends Result_AcceptChannelDecodeErrorZ {
+ public final AcceptChannel res;
+ private Result_AcceptChannelDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long res = bindings.LDKCResult_AcceptChannelDecodeErrorZ_get_ok(ptr);
+ AcceptChannel res_hu_conv = new AcceptChannel(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_AcceptChannelDecodeErrorZ_OK(AcceptChannel res) {
+ this(null, bindings.CResult_AcceptChannelDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_AcceptChannelDecodeErrorZ_Err extends Result_AcceptChannelDecodeErrorZ {
+ public final DecodeError err;
+ private Result_AcceptChannelDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long err = bindings.LDKCResult_AcceptChannelDecodeErrorZ_get_err(ptr);
+ DecodeError err_hu_conv = new DecodeError(null, err);
+ err_hu_conv.ptrs_to.add(this);
+ this.err = err_hu_conv;
+ }
+ public Result_AcceptChannelDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_AcceptChannelDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class Result_AnnouncementSignaturesDecodeErrorZ extends CommonBase {
+ private Result_AnnouncementSignaturesDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_AnnouncementSignaturesDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_AnnouncementSignaturesDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_AnnouncementSignaturesDecodeErrorZ_result_ok(ptr)) {
+ return new Result_AnnouncementSignaturesDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_AnnouncementSignaturesDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_AnnouncementSignaturesDecodeErrorZ_OK extends Result_AnnouncementSignaturesDecodeErrorZ {
+ public final AnnouncementSignatures res;
+ private Result_AnnouncementSignaturesDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long res = bindings.LDKCResult_AnnouncementSignaturesDecodeErrorZ_get_ok(ptr);
+ AnnouncementSignatures res_hu_conv = new AnnouncementSignatures(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_AnnouncementSignaturesDecodeErrorZ_OK(AnnouncementSignatures res) {
+ this(null, bindings.CResult_AnnouncementSignaturesDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_AnnouncementSignaturesDecodeErrorZ_Err extends Result_AnnouncementSignaturesDecodeErrorZ {
+ public final DecodeError err;
+ private Result_AnnouncementSignaturesDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long err = bindings.LDKCResult_AnnouncementSignaturesDecodeErrorZ_get_err(ptr);
+ DecodeError err_hu_conv = new DecodeError(null, err);
+ err_hu_conv.ptrs_to.add(this);
+ this.err = err_hu_conv;
+ }
+ public Result_AnnouncementSignaturesDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_AnnouncementSignaturesDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class Result_BuiltCommitmentTransactionDecodeErrorZ extends CommonBase {
+ private Result_BuiltCommitmentTransactionDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_BuiltCommitmentTransactionDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_BuiltCommitmentTransactionDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_BuiltCommitmentTransactionDecodeErrorZ_result_ok(ptr)) {
+ return new Result_BuiltCommitmentTransactionDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_BuiltCommitmentTransactionDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_BuiltCommitmentTransactionDecodeErrorZ_OK extends Result_BuiltCommitmentTransactionDecodeErrorZ {
+ public final BuiltCommitmentTransaction res;
+ private Result_BuiltCommitmentTransactionDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long res = bindings.LDKCResult_BuiltCommitmentTransactionDecodeErrorZ_get_ok(ptr);
+ BuiltCommitmentTransaction res_hu_conv = new BuiltCommitmentTransaction(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_BuiltCommitmentTransactionDecodeErrorZ_OK(BuiltCommitmentTransaction res) {
+ this(null, bindings.CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_BuiltCommitmentTransactionDecodeErrorZ_Err extends Result_BuiltCommitmentTransactionDecodeErrorZ {
+ public final DecodeError err;
+ private Result_BuiltCommitmentTransactionDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long err = bindings.LDKCResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(ptr);
+ DecodeError err_hu_conv = new DecodeError(null, err);
+ err_hu_conv.ptrs_to.add(this);
+ this.err = err_hu_conv;
+ }
+ public Result_BuiltCommitmentTransactionDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_BuiltCommitmentTransactionDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class Result_CVec_CVec_u8ZZNoneZ extends CommonBase {
+ private Result_CVec_CVec_u8ZZNoneZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_CVec_CVec_u8ZZNoneZ_free(ptr); } super.finalize();
+ }
+
+ static Result_CVec_CVec_u8ZZNoneZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_CVec_CVec_u8ZZNoneZ_result_ok(ptr)) {
+ return new Result_CVec_CVec_u8ZZNoneZ_OK(null, ptr);
+ } else {
+ return new Result_CVec_CVec_u8ZZNoneZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_CVec_CVec_u8ZZNoneZ_OK extends Result_CVec_CVec_u8ZZNoneZ {
+ public final byte[][] res;
+ private Result_CVec_CVec_u8ZZNoneZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ this.res = bindings.LDKCResult_CVec_CVec_u8ZZNoneZ_get_ok(ptr);
+ }
+ public Result_CVec_CVec_u8ZZNoneZ_OK(byte[][] res) {
+ this(null, bindings.CResult_CVec_CVec_u8ZZNoneZ_ok(res));
+ }
+ }
+
+ public static final class Result_CVec_CVec_u8ZZNoneZ_Err extends Result_CVec_CVec_u8ZZNoneZ {
+ private Result_CVec_CVec_u8ZZNoneZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ }
+ public Result_CVec_CVec_u8ZZNoneZ_Err() {
+ this(null, bindings.CResult_CVec_CVec_u8ZZNoneZ_err());
+ }
+ }
+}
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class Result_ChannelAnnouncementDecodeErrorZ extends CommonBase {
+ private Result_ChannelAnnouncementDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_ChannelAnnouncementDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_ChannelAnnouncementDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_ChannelAnnouncementDecodeErrorZ_result_ok(ptr)) {
+ return new Result_ChannelAnnouncementDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_ChannelAnnouncementDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_ChannelAnnouncementDecodeErrorZ_OK extends Result_ChannelAnnouncementDecodeErrorZ {
+ public final ChannelAnnouncement res;
+ private Result_ChannelAnnouncementDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long res = bindings.LDKCResult_ChannelAnnouncementDecodeErrorZ_get_ok(ptr);
+ ChannelAnnouncement res_hu_conv = new ChannelAnnouncement(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_ChannelAnnouncementDecodeErrorZ_OK(ChannelAnnouncement res) {
+ this(null, bindings.CResult_ChannelAnnouncementDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_ChannelAnnouncementDecodeErrorZ_Err extends Result_ChannelAnnouncementDecodeErrorZ {
+ public final DecodeError err;
+ private Result_ChannelAnnouncementDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long err = bindings.LDKCResult_ChannelAnnouncementDecodeErrorZ_get_err(ptr);
+ DecodeError err_hu_conv = new DecodeError(null, err);
+ err_hu_conv.ptrs_to.add(this);
+ this.err = err_hu_conv;
+ }
+ public Result_ChannelAnnouncementDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_ChannelAnnouncementDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class Result_ChannelConfigDecodeErrorZ extends CommonBase {
+ private Result_ChannelConfigDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_ChannelConfigDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_ChannelConfigDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_ChannelConfigDecodeErrorZ_result_ok(ptr)) {
+ return new Result_ChannelConfigDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_ChannelConfigDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_ChannelConfigDecodeErrorZ_OK extends Result_ChannelConfigDecodeErrorZ {
+ public final ChannelConfig res;
+ private Result_ChannelConfigDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long res = bindings.LDKCResult_ChannelConfigDecodeErrorZ_get_ok(ptr);
+ ChannelConfig res_hu_conv = new ChannelConfig(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_ChannelConfigDecodeErrorZ_OK(ChannelConfig res) {
+ this(null, bindings.CResult_ChannelConfigDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_ChannelConfigDecodeErrorZ_Err extends Result_ChannelConfigDecodeErrorZ {
+ public final DecodeError err;
+ private Result_ChannelConfigDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long err = bindings.LDKCResult_ChannelConfigDecodeErrorZ_get_err(ptr);
+ DecodeError err_hu_conv = new DecodeError(null, err);
+ err_hu_conv.ptrs_to.add(this);
+ this.err = err_hu_conv;
+ }
+ public Result_ChannelConfigDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_ChannelConfigDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class Result_ChannelFeaturesDecodeErrorZ extends CommonBase {
+ private Result_ChannelFeaturesDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_ChannelFeaturesDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_ChannelFeaturesDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_ChannelFeaturesDecodeErrorZ_result_ok(ptr)) {
+ return new Result_ChannelFeaturesDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_ChannelFeaturesDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_ChannelFeaturesDecodeErrorZ_OK extends Result_ChannelFeaturesDecodeErrorZ {
+ public final ChannelFeatures res;
+ private Result_ChannelFeaturesDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long res = bindings.LDKCResult_ChannelFeaturesDecodeErrorZ_get_ok(ptr);
+ ChannelFeatures res_hu_conv = new ChannelFeatures(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_ChannelFeaturesDecodeErrorZ_OK(ChannelFeatures res) {
+ this(null, bindings.CResult_ChannelFeaturesDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_ChannelFeaturesDecodeErrorZ_Err extends Result_ChannelFeaturesDecodeErrorZ {
+ public final DecodeError err;
+ private Result_ChannelFeaturesDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long err = bindings.LDKCResult_ChannelFeaturesDecodeErrorZ_get_err(ptr);
+ DecodeError err_hu_conv = new DecodeError(null, err);
+ err_hu_conv.ptrs_to.add(this);
+ this.err = err_hu_conv;
+ }
+ public Result_ChannelFeaturesDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_ChannelFeaturesDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class Result_ChannelInfoDecodeErrorZ extends CommonBase {
+ private Result_ChannelInfoDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_ChannelInfoDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_ChannelInfoDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_ChannelInfoDecodeErrorZ_result_ok(ptr)) {
+ return new Result_ChannelInfoDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_ChannelInfoDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_ChannelInfoDecodeErrorZ_OK extends Result_ChannelInfoDecodeErrorZ {
+ public final ChannelInfo res;
+ private Result_ChannelInfoDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long res = bindings.LDKCResult_ChannelInfoDecodeErrorZ_get_ok(ptr);
+ ChannelInfo res_hu_conv = new ChannelInfo(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_ChannelInfoDecodeErrorZ_OK(ChannelInfo res) {
+ this(null, bindings.CResult_ChannelInfoDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_ChannelInfoDecodeErrorZ_Err extends Result_ChannelInfoDecodeErrorZ {
+ public final DecodeError err;
+ private Result_ChannelInfoDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long err = bindings.LDKCResult_ChannelInfoDecodeErrorZ_get_err(ptr);
+ DecodeError err_hu_conv = new DecodeError(null, err);
+ err_hu_conv.ptrs_to.add(this);
+ this.err = err_hu_conv;
+ }
+ public Result_ChannelInfoDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_ChannelInfoDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class Result_ChannelPublicKeysDecodeErrorZ extends CommonBase {
+ private Result_ChannelPublicKeysDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_ChannelPublicKeysDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_ChannelPublicKeysDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_ChannelPublicKeysDecodeErrorZ_result_ok(ptr)) {
+ return new Result_ChannelPublicKeysDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_ChannelPublicKeysDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_ChannelPublicKeysDecodeErrorZ_OK extends Result_ChannelPublicKeysDecodeErrorZ {
+ public final ChannelPublicKeys res;
+ private Result_ChannelPublicKeysDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long res = bindings.LDKCResult_ChannelPublicKeysDecodeErrorZ_get_ok(ptr);
+ ChannelPublicKeys res_hu_conv = new ChannelPublicKeys(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_ChannelPublicKeysDecodeErrorZ_OK(ChannelPublicKeys res) {
+ this(null, bindings.CResult_ChannelPublicKeysDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_ChannelPublicKeysDecodeErrorZ_Err extends Result_ChannelPublicKeysDecodeErrorZ {
+ public final DecodeError err;
+ private Result_ChannelPublicKeysDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long err = bindings.LDKCResult_ChannelPublicKeysDecodeErrorZ_get_err(ptr);
+ DecodeError err_hu_conv = new DecodeError(null, err);
+ err_hu_conv.ptrs_to.add(this);
+ this.err = err_hu_conv;
+ }
+ public Result_ChannelPublicKeysDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_ChannelPublicKeysDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class Result_ChannelTransactionParametersDecodeErrorZ extends CommonBase {
+ private Result_ChannelTransactionParametersDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_ChannelTransactionParametersDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_ChannelTransactionParametersDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_ChannelTransactionParametersDecodeErrorZ_result_ok(ptr)) {
+ return new Result_ChannelTransactionParametersDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_ChannelTransactionParametersDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_ChannelTransactionParametersDecodeErrorZ_OK extends Result_ChannelTransactionParametersDecodeErrorZ {
+ public final ChannelTransactionParameters res;
+ private Result_ChannelTransactionParametersDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long res = bindings.LDKCResult_ChannelTransactionParametersDecodeErrorZ_get_ok(ptr);
+ ChannelTransactionParameters res_hu_conv = new ChannelTransactionParameters(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_ChannelTransactionParametersDecodeErrorZ_OK(ChannelTransactionParameters res) {
+ this(null, bindings.CResult_ChannelTransactionParametersDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_ChannelTransactionParametersDecodeErrorZ_Err extends Result_ChannelTransactionParametersDecodeErrorZ {
+ public final DecodeError err;
+ private Result_ChannelTransactionParametersDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long err = bindings.LDKCResult_ChannelTransactionParametersDecodeErrorZ_get_err(ptr);
+ DecodeError err_hu_conv = new DecodeError(null, err);
+ err_hu_conv.ptrs_to.add(this);
+ this.err = err_hu_conv;
+ }
+ public Result_ChannelTransactionParametersDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_ChannelTransactionParametersDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class Result_ChannelUpdateDecodeErrorZ extends CommonBase {
+ private Result_ChannelUpdateDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_ChannelUpdateDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_ChannelUpdateDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_ChannelUpdateDecodeErrorZ_result_ok(ptr)) {
+ return new Result_ChannelUpdateDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_ChannelUpdateDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_ChannelUpdateDecodeErrorZ_OK extends Result_ChannelUpdateDecodeErrorZ {
+ public final ChannelUpdate res;
+ private Result_ChannelUpdateDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long res = bindings.LDKCResult_ChannelUpdateDecodeErrorZ_get_ok(ptr);
+ ChannelUpdate res_hu_conv = new ChannelUpdate(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_ChannelUpdateDecodeErrorZ_OK(ChannelUpdate res) {
+ this(null, bindings.CResult_ChannelUpdateDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_ChannelUpdateDecodeErrorZ_Err extends Result_ChannelUpdateDecodeErrorZ {
+ public final DecodeError err;
+ private Result_ChannelUpdateDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long err = bindings.LDKCResult_ChannelUpdateDecodeErrorZ_get_err(ptr);
+ DecodeError err_hu_conv = new DecodeError(null, err);
+ err_hu_conv.ptrs_to.add(this);
+ this.err = err_hu_conv;
+ }
+ public Result_ChannelUpdateDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_ChannelUpdateDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class Result_ClosingSignedDecodeErrorZ extends CommonBase {
+ private Result_ClosingSignedDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_ClosingSignedDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_ClosingSignedDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_ClosingSignedDecodeErrorZ_result_ok(ptr)) {
+ return new Result_ClosingSignedDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_ClosingSignedDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_ClosingSignedDecodeErrorZ_OK extends Result_ClosingSignedDecodeErrorZ {
+ public final ClosingSigned res;
+ private Result_ClosingSignedDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long res = bindings.LDKCResult_ClosingSignedDecodeErrorZ_get_ok(ptr);
+ ClosingSigned res_hu_conv = new ClosingSigned(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_ClosingSignedDecodeErrorZ_OK(ClosingSigned res) {
+ this(null, bindings.CResult_ClosingSignedDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_ClosingSignedDecodeErrorZ_Err extends Result_ClosingSignedDecodeErrorZ {
+ public final DecodeError err;
+ private Result_ClosingSignedDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long err = bindings.LDKCResult_ClosingSignedDecodeErrorZ_get_err(ptr);
+ DecodeError err_hu_conv = new DecodeError(null, err);
+ err_hu_conv.ptrs_to.add(this);
+ this.err = err_hu_conv;
+ }
+ public Result_ClosingSignedDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_ClosingSignedDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class Result_CommitmentSignedDecodeErrorZ extends CommonBase {
+ private Result_CommitmentSignedDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_CommitmentSignedDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_CommitmentSignedDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_CommitmentSignedDecodeErrorZ_result_ok(ptr)) {
+ return new Result_CommitmentSignedDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_CommitmentSignedDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_CommitmentSignedDecodeErrorZ_OK extends Result_CommitmentSignedDecodeErrorZ {
+ public final CommitmentSigned res;
+ private Result_CommitmentSignedDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long res = bindings.LDKCResult_CommitmentSignedDecodeErrorZ_get_ok(ptr);
+ CommitmentSigned res_hu_conv = new CommitmentSigned(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_CommitmentSignedDecodeErrorZ_OK(CommitmentSigned res) {
+ this(null, bindings.CResult_CommitmentSignedDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_CommitmentSignedDecodeErrorZ_Err extends Result_CommitmentSignedDecodeErrorZ {
+ public final DecodeError err;
+ private Result_CommitmentSignedDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long err = bindings.LDKCResult_CommitmentSignedDecodeErrorZ_get_err(ptr);
+ DecodeError err_hu_conv = new DecodeError(null, err);
+ err_hu_conv.ptrs_to.add(this);
+ this.err = err_hu_conv;
+ }
+ public Result_CommitmentSignedDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_CommitmentSignedDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class Result_CommitmentTransactionDecodeErrorZ extends CommonBase {
+ private Result_CommitmentTransactionDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_CommitmentTransactionDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_CommitmentTransactionDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_CommitmentTransactionDecodeErrorZ_result_ok(ptr)) {
+ return new Result_CommitmentTransactionDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_CommitmentTransactionDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_CommitmentTransactionDecodeErrorZ_OK extends Result_CommitmentTransactionDecodeErrorZ {
+ public final CommitmentTransaction res;
+ private Result_CommitmentTransactionDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long res = bindings.LDKCResult_CommitmentTransactionDecodeErrorZ_get_ok(ptr);
+ CommitmentTransaction res_hu_conv = new CommitmentTransaction(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_CommitmentTransactionDecodeErrorZ_OK(CommitmentTransaction res) {
+ this(null, bindings.CResult_CommitmentTransactionDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_CommitmentTransactionDecodeErrorZ_Err extends Result_CommitmentTransactionDecodeErrorZ {
+ public final DecodeError err;
+ private Result_CommitmentTransactionDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long err = bindings.LDKCResult_CommitmentTransactionDecodeErrorZ_get_err(ptr);
+ DecodeError err_hu_conv = new DecodeError(null, err);
+ err_hu_conv.ptrs_to.add(this);
+ this.err = err_hu_conv;
+ }
+ public Result_CommitmentTransactionDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_CommitmentTransactionDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class Result_CounterpartyChannelTransactionParametersDecodeErrorZ extends CommonBase {
+ private Result_CounterpartyChannelTransactionParametersDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_CounterpartyChannelTransactionParametersDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ_result_ok(ptr)) {
+ return new Result_CounterpartyChannelTransactionParametersDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_CounterpartyChannelTransactionParametersDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_CounterpartyChannelTransactionParametersDecodeErrorZ_OK extends Result_CounterpartyChannelTransactionParametersDecodeErrorZ {
+ public final CounterpartyChannelTransactionParameters res;
+ private Result_CounterpartyChannelTransactionParametersDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long res = bindings.LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_ok(ptr);
+ CounterpartyChannelTransactionParameters res_hu_conv = new CounterpartyChannelTransactionParameters(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_CounterpartyChannelTransactionParametersDecodeErrorZ_OK(CounterpartyChannelTransactionParameters res) {
+ this(null, bindings.CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_CounterpartyChannelTransactionParametersDecodeErrorZ_Err extends Result_CounterpartyChannelTransactionParametersDecodeErrorZ {
+ public final DecodeError err;
+ private Result_CounterpartyChannelTransactionParametersDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long err = bindings.LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(ptr);
+ DecodeError err_hu_conv = new DecodeError(null, err);
+ err_hu_conv.ptrs_to.add(this);
+ this.err = err_hu_conv;
+ }
+ public Result_CounterpartyChannelTransactionParametersDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class Result_DirectionalChannelInfoDecodeErrorZ extends CommonBase {
+ private Result_DirectionalChannelInfoDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_DirectionalChannelInfoDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_DirectionalChannelInfoDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_DirectionalChannelInfoDecodeErrorZ_result_ok(ptr)) {
+ return new Result_DirectionalChannelInfoDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_DirectionalChannelInfoDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_DirectionalChannelInfoDecodeErrorZ_OK extends Result_DirectionalChannelInfoDecodeErrorZ {
+ public final DirectionalChannelInfo res;
+ private Result_DirectionalChannelInfoDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long res = bindings.LDKCResult_DirectionalChannelInfoDecodeErrorZ_get_ok(ptr);
+ DirectionalChannelInfo res_hu_conv = new DirectionalChannelInfo(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_DirectionalChannelInfoDecodeErrorZ_OK(DirectionalChannelInfo res) {
+ this(null, bindings.CResult_DirectionalChannelInfoDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_DirectionalChannelInfoDecodeErrorZ_Err extends Result_DirectionalChannelInfoDecodeErrorZ {
+ public final DecodeError err;
+ private Result_DirectionalChannelInfoDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long err = bindings.LDKCResult_DirectionalChannelInfoDecodeErrorZ_get_err(ptr);
+ DecodeError err_hu_conv = new DecodeError(null, err);
+ err_hu_conv.ptrs_to.add(this);
+ this.err = err_hu_conv;
+ }
+ public Result_DirectionalChannelInfoDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_DirectionalChannelInfoDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class Result_FundingCreatedDecodeErrorZ extends CommonBase {
+ private Result_FundingCreatedDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_FundingCreatedDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_FundingCreatedDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_FundingCreatedDecodeErrorZ_result_ok(ptr)) {
+ return new Result_FundingCreatedDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_FundingCreatedDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_FundingCreatedDecodeErrorZ_OK extends Result_FundingCreatedDecodeErrorZ {
+ public final FundingCreated res;
+ private Result_FundingCreatedDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long res = bindings.LDKCResult_FundingCreatedDecodeErrorZ_get_ok(ptr);
+ FundingCreated res_hu_conv = new FundingCreated(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_FundingCreatedDecodeErrorZ_OK(FundingCreated res) {
+ this(null, bindings.CResult_FundingCreatedDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_FundingCreatedDecodeErrorZ_Err extends Result_FundingCreatedDecodeErrorZ {
+ public final DecodeError err;
+ private Result_FundingCreatedDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long err = bindings.LDKCResult_FundingCreatedDecodeErrorZ_get_err(ptr);
+ DecodeError err_hu_conv = new DecodeError(null, err);
+ err_hu_conv.ptrs_to.add(this);
+ this.err = err_hu_conv;
+ }
+ public Result_FundingCreatedDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_FundingCreatedDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class Result_FundingLockedDecodeErrorZ extends CommonBase {
+ private Result_FundingLockedDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_FundingLockedDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_FundingLockedDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_FundingLockedDecodeErrorZ_result_ok(ptr)) {
+ return new Result_FundingLockedDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_FundingLockedDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_FundingLockedDecodeErrorZ_OK extends Result_FundingLockedDecodeErrorZ {
+ public final FundingLocked res;
+ private Result_FundingLockedDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long res = bindings.LDKCResult_FundingLockedDecodeErrorZ_get_ok(ptr);
+ FundingLocked res_hu_conv = new FundingLocked(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_FundingLockedDecodeErrorZ_OK(FundingLocked res) {
+ this(null, bindings.CResult_FundingLockedDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_FundingLockedDecodeErrorZ_Err extends Result_FundingLockedDecodeErrorZ {
+ public final DecodeError err;
+ private Result_FundingLockedDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long err = bindings.LDKCResult_FundingLockedDecodeErrorZ_get_err(ptr);
+ DecodeError err_hu_conv = new DecodeError(null, err);
+ err_hu_conv.ptrs_to.add(this);
+ this.err = err_hu_conv;
+ }
+ public Result_FundingLockedDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_FundingLockedDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class Result_FundingSignedDecodeErrorZ extends CommonBase {
+ private Result_FundingSignedDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_FundingSignedDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_FundingSignedDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_FundingSignedDecodeErrorZ_result_ok(ptr)) {
+ return new Result_FundingSignedDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_FundingSignedDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_FundingSignedDecodeErrorZ_OK extends Result_FundingSignedDecodeErrorZ {
+ public final FundingSigned res;
+ private Result_FundingSignedDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long res = bindings.LDKCResult_FundingSignedDecodeErrorZ_get_ok(ptr);
+ FundingSigned res_hu_conv = new FundingSigned(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_FundingSignedDecodeErrorZ_OK(FundingSigned res) {
+ this(null, bindings.CResult_FundingSignedDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_FundingSignedDecodeErrorZ_Err extends Result_FundingSignedDecodeErrorZ {
+ public final DecodeError err;
+ private Result_FundingSignedDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long err = bindings.LDKCResult_FundingSignedDecodeErrorZ_get_err(ptr);
+ DecodeError err_hu_conv = new DecodeError(null, err);
+ err_hu_conv.ptrs_to.add(this);
+ this.err = err_hu_conv;
+ }
+ public Result_FundingSignedDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_FundingSignedDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class Result_HTLCOutputInCommitmentDecodeErrorZ extends CommonBase {
+ private Result_HTLCOutputInCommitmentDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_HTLCOutputInCommitmentDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_HTLCOutputInCommitmentDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_HTLCOutputInCommitmentDecodeErrorZ_result_ok(ptr)) {
+ return new Result_HTLCOutputInCommitmentDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_HTLCOutputInCommitmentDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_HTLCOutputInCommitmentDecodeErrorZ_OK extends Result_HTLCOutputInCommitmentDecodeErrorZ {
+ public final HTLCOutputInCommitment res;
+ private Result_HTLCOutputInCommitmentDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long res = bindings.LDKCResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok(ptr);
+ HTLCOutputInCommitment res_hu_conv = new HTLCOutputInCommitment(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_HTLCOutputInCommitmentDecodeErrorZ_OK(HTLCOutputInCommitment res) {
+ this(null, bindings.CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_HTLCOutputInCommitmentDecodeErrorZ_Err extends Result_HTLCOutputInCommitmentDecodeErrorZ {
+ public final DecodeError err;
+ private Result_HTLCOutputInCommitmentDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long err = bindings.LDKCResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(ptr);
+ DecodeError err_hu_conv = new DecodeError(null, err);
+ err_hu_conv.ptrs_to.add(this);
+ this.err = err_hu_conv;
+ }
+ public Result_HTLCOutputInCommitmentDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_HTLCOutputInCommitmentDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class Result_HTLCUpdateDecodeErrorZ extends CommonBase {
+ private Result_HTLCUpdateDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_HTLCUpdateDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_HTLCUpdateDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_HTLCUpdateDecodeErrorZ_result_ok(ptr)) {
+ return new Result_HTLCUpdateDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_HTLCUpdateDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_HTLCUpdateDecodeErrorZ_OK extends Result_HTLCUpdateDecodeErrorZ {
+ public final HTLCUpdate res;
+ private Result_HTLCUpdateDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long res = bindings.LDKCResult_HTLCUpdateDecodeErrorZ_get_ok(ptr);
+ HTLCUpdate res_hu_conv = new HTLCUpdate(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_HTLCUpdateDecodeErrorZ_OK(HTLCUpdate res) {
+ this(null, bindings.CResult_HTLCUpdateDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_HTLCUpdateDecodeErrorZ_Err extends Result_HTLCUpdateDecodeErrorZ {
+ public final DecodeError err;
+ private Result_HTLCUpdateDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long err = bindings.LDKCResult_HTLCUpdateDecodeErrorZ_get_err(ptr);
+ DecodeError err_hu_conv = new DecodeError(null, err);
+ err_hu_conv.ptrs_to.add(this);
+ this.err = err_hu_conv;
+ }
+ public Result_HTLCUpdateDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_HTLCUpdateDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class Result_HolderCommitmentTransactionDecodeErrorZ extends CommonBase {
+ private Result_HolderCommitmentTransactionDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_HolderCommitmentTransactionDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_HolderCommitmentTransactionDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_HolderCommitmentTransactionDecodeErrorZ_result_ok(ptr)) {
+ return new Result_HolderCommitmentTransactionDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_HolderCommitmentTransactionDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_HolderCommitmentTransactionDecodeErrorZ_OK extends Result_HolderCommitmentTransactionDecodeErrorZ {
+ public final HolderCommitmentTransaction res;
+ private Result_HolderCommitmentTransactionDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long res = bindings.LDKCResult_HolderCommitmentTransactionDecodeErrorZ_get_ok(ptr);
+ HolderCommitmentTransaction res_hu_conv = new HolderCommitmentTransaction(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_HolderCommitmentTransactionDecodeErrorZ_OK(HolderCommitmentTransaction res) {
+ this(null, bindings.CResult_HolderCommitmentTransactionDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_HolderCommitmentTransactionDecodeErrorZ_Err extends Result_HolderCommitmentTransactionDecodeErrorZ {
+ public final DecodeError err;
+ private Result_HolderCommitmentTransactionDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long err = bindings.LDKCResult_HolderCommitmentTransactionDecodeErrorZ_get_err(ptr);
+ DecodeError err_hu_conv = new DecodeError(null, err);
+ err_hu_conv.ptrs_to.add(this);
+ this.err = err_hu_conv;
+ }
+ public Result_HolderCommitmentTransactionDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_HolderCommitmentTransactionDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
+++ /dev/null
-package org.ldk.structs;
-
-import org.ldk.impl.bindings;
-import org.ldk.enums.*;
-import org.ldk.util.*;
-import java.util.Arrays;
-
-@SuppressWarnings("unchecked") // We correctly assign various generic arrays
-public class Result_InMemoryChannelKeysDecodeErrorZ extends CommonBase {
- private Result_InMemoryChannelKeysDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
- protected void finalize() throws Throwable {
- if (ptr != 0) { bindings.CResult_InMemoryChannelKeysDecodeErrorZ_free(ptr); } super.finalize();
- }
-
- static Result_InMemoryChannelKeysDecodeErrorZ constr_from_ptr(long ptr) {
- if (bindings.LDKCResult_InMemoryChannelKeysDecodeErrorZ_result_ok(ptr)) {
- return new Result_InMemoryChannelKeysDecodeErrorZ_OK(null, ptr);
- } else {
- return new Result_InMemoryChannelKeysDecodeErrorZ_Err(null, ptr);
- }
- }
- public static final class Result_InMemoryChannelKeysDecodeErrorZ_OK extends Result_InMemoryChannelKeysDecodeErrorZ {
- public final InMemoryChannelKeys res;
- private Result_InMemoryChannelKeysDecodeErrorZ_OK(Object _dummy, long ptr) {
- super(_dummy, ptr);
- long res = bindings.LDKCResult_InMemoryChannelKeysDecodeErrorZ_get_ok(ptr);
- InMemoryChannelKeys res_hu_conv = new InMemoryChannelKeys(null, res);
- res_hu_conv.ptrs_to.add(this);
- this.res = res_hu_conv;
- }
- public Result_InMemoryChannelKeysDecodeErrorZ_OK(InMemoryChannelKeys res) {
- this(null, bindings.CResult_InMemoryChannelKeysDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
- this.ptrs_to.add(res);
- }
- }
-
- public static final class Result_InMemoryChannelKeysDecodeErrorZ_Err extends Result_InMemoryChannelKeysDecodeErrorZ {
- public final DecodeError err;
- private Result_InMemoryChannelKeysDecodeErrorZ_Err(Object _dummy, long ptr) {
- super(_dummy, ptr);
- long err = bindings.LDKCResult_InMemoryChannelKeysDecodeErrorZ_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_InMemoryChannelKeysDecodeErrorZ_Err(DecodeError err) {
- this(null, bindings.CResult_InMemoryChannelKeysDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
- this.ptrs_to.add(err);
- }
- }
-}
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class Result_InMemorySignerDecodeErrorZ extends CommonBase {
+ private Result_InMemorySignerDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_InMemorySignerDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_InMemorySignerDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_InMemorySignerDecodeErrorZ_result_ok(ptr)) {
+ return new Result_InMemorySignerDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_InMemorySignerDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_InMemorySignerDecodeErrorZ_OK extends Result_InMemorySignerDecodeErrorZ {
+ public final InMemorySigner res;
+ private Result_InMemorySignerDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long res = bindings.LDKCResult_InMemorySignerDecodeErrorZ_get_ok(ptr);
+ InMemorySigner res_hu_conv = new InMemorySigner(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_InMemorySignerDecodeErrorZ_OK(InMemorySigner res) {
+ this(null, bindings.CResult_InMemorySignerDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_InMemorySignerDecodeErrorZ_Err extends Result_InMemorySignerDecodeErrorZ {
+ public final DecodeError err;
+ private Result_InMemorySignerDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long err = bindings.LDKCResult_InMemorySignerDecodeErrorZ_get_err(ptr);
+ DecodeError err_hu_conv = new DecodeError(null, err);
+ err_hu_conv.ptrs_to.add(this);
+ this.err = err_hu_conv;
+ }
+ public Result_InMemorySignerDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_InMemorySignerDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class Result_InitFeaturesDecodeErrorZ extends CommonBase {
+ private Result_InitFeaturesDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_InitFeaturesDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_InitFeaturesDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_InitFeaturesDecodeErrorZ_result_ok(ptr)) {
+ return new Result_InitFeaturesDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_InitFeaturesDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_InitFeaturesDecodeErrorZ_OK extends Result_InitFeaturesDecodeErrorZ {
+ public final InitFeatures res;
+ private Result_InitFeaturesDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long res = bindings.LDKCResult_InitFeaturesDecodeErrorZ_get_ok(ptr);
+ InitFeatures res_hu_conv = new InitFeatures(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_InitFeaturesDecodeErrorZ_OK(InitFeatures res) {
+ this(null, bindings.CResult_InitFeaturesDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_InitFeaturesDecodeErrorZ_Err extends Result_InitFeaturesDecodeErrorZ {
+ public final DecodeError err;
+ private Result_InitFeaturesDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long err = bindings.LDKCResult_InitFeaturesDecodeErrorZ_get_err(ptr);
+ DecodeError err_hu_conv = new DecodeError(null, err);
+ err_hu_conv.ptrs_to.add(this);
+ this.err = err_hu_conv;
+ }
+ public Result_InitFeaturesDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_InitFeaturesDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
public Result_NetworkGraphDecodeErrorZ_OK(NetworkGraph res) {
this(null, bindings.CResult_NetworkGraphDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
this.ptrs_to.add(res);
- // Due to rust's strict-ownership memory model, in some cases we need to "move"
- // an object to pass exclusive ownership to the function being called.
- // In most cases, we avoid this being visible in GC'd languages by cloning the object
- // at the FFI layer, creating a new object which Rust can claim ownership of
- // However, in some cases (eg here), there is no way to clone an object, and thus
- // we actually have to pass full ownership to Rust.
- // Thus, after this call, res is reset to null and is now a dummy object.
- res.ptr = 0;
}
}
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class Result_NodeAnnouncementDecodeErrorZ extends CommonBase {
+ private Result_NodeAnnouncementDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_NodeAnnouncementDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_NodeAnnouncementDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_NodeAnnouncementDecodeErrorZ_result_ok(ptr)) {
+ return new Result_NodeAnnouncementDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_NodeAnnouncementDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_NodeAnnouncementDecodeErrorZ_OK extends Result_NodeAnnouncementDecodeErrorZ {
+ public final NodeAnnouncement res;
+ private Result_NodeAnnouncementDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long res = bindings.LDKCResult_NodeAnnouncementDecodeErrorZ_get_ok(ptr);
+ NodeAnnouncement res_hu_conv = new NodeAnnouncement(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_NodeAnnouncementDecodeErrorZ_OK(NodeAnnouncement res) {
+ this(null, bindings.CResult_NodeAnnouncementDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_NodeAnnouncementDecodeErrorZ_Err extends Result_NodeAnnouncementDecodeErrorZ {
+ public final DecodeError err;
+ private Result_NodeAnnouncementDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long err = bindings.LDKCResult_NodeAnnouncementDecodeErrorZ_get_err(ptr);
+ DecodeError err_hu_conv = new DecodeError(null, err);
+ err_hu_conv.ptrs_to.add(this);
+ this.err = err_hu_conv;
+ }
+ public Result_NodeAnnouncementDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_NodeAnnouncementDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class Result_NodeFeaturesDecodeErrorZ extends CommonBase {
+ private Result_NodeFeaturesDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_NodeFeaturesDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_NodeFeaturesDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_NodeFeaturesDecodeErrorZ_result_ok(ptr)) {
+ return new Result_NodeFeaturesDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_NodeFeaturesDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_NodeFeaturesDecodeErrorZ_OK extends Result_NodeFeaturesDecodeErrorZ {
+ public final NodeFeatures res;
+ private Result_NodeFeaturesDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long res = bindings.LDKCResult_NodeFeaturesDecodeErrorZ_get_ok(ptr);
+ NodeFeatures res_hu_conv = new NodeFeatures(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_NodeFeaturesDecodeErrorZ_OK(NodeFeatures res) {
+ this(null, bindings.CResult_NodeFeaturesDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_NodeFeaturesDecodeErrorZ_Err extends Result_NodeFeaturesDecodeErrorZ {
+ public final DecodeError err;
+ private Result_NodeFeaturesDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long err = bindings.LDKCResult_NodeFeaturesDecodeErrorZ_get_err(ptr);
+ DecodeError err_hu_conv = new DecodeError(null, err);
+ err_hu_conv.ptrs_to.add(this);
+ this.err = err_hu_conv;
+ }
+ public Result_NodeFeaturesDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_NodeFeaturesDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
private Result_NonePaymentSendFailureZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.LDKCResult_NonePaymentSendFailureZ_get_err(ptr);
- PaymentSendFailure err_hu_conv = new PaymentSendFailure(null, err);
+ PaymentSendFailure err_hu_conv = PaymentSendFailure.constr_from_ptr(err);
err_hu_conv.ptrs_to.add(this);
this.err = err_hu_conv;
}
public Result_NonePaymentSendFailureZ_Err(PaymentSendFailure err) {
- this(null, bindings.CResult_NonePaymentSendFailureZ_err(err == null ? 0 : err.ptr & ~1));
- this.ptrs_to.add(err);
+ this(null, bindings.CResult_NonePaymentSendFailureZ_err(err.ptr));
}
}
}
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class Result_OpenChannelDecodeErrorZ extends CommonBase {
+ private Result_OpenChannelDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_OpenChannelDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_OpenChannelDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_OpenChannelDecodeErrorZ_result_ok(ptr)) {
+ return new Result_OpenChannelDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_OpenChannelDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_OpenChannelDecodeErrorZ_OK extends Result_OpenChannelDecodeErrorZ {
+ public final OpenChannel res;
+ private Result_OpenChannelDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long res = bindings.LDKCResult_OpenChannelDecodeErrorZ_get_ok(ptr);
+ OpenChannel res_hu_conv = new OpenChannel(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_OpenChannelDecodeErrorZ_OK(OpenChannel res) {
+ this(null, bindings.CResult_OpenChannelDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_OpenChannelDecodeErrorZ_Err extends Result_OpenChannelDecodeErrorZ {
+ public final DecodeError err;
+ private Result_OpenChannelDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long err = bindings.LDKCResult_OpenChannelDecodeErrorZ_get_err(ptr);
+ DecodeError err_hu_conv = new DecodeError(null, err);
+ err_hu_conv.ptrs_to.add(this);
+ this.err = err_hu_conv;
+ }
+ public Result_OpenChannelDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_OpenChannelDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class Result_OutPointDecodeErrorZ extends CommonBase {
+ private Result_OutPointDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_OutPointDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_OutPointDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_OutPointDecodeErrorZ_result_ok(ptr)) {
+ return new Result_OutPointDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_OutPointDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_OutPointDecodeErrorZ_OK extends Result_OutPointDecodeErrorZ {
+ public final OutPoint res;
+ private Result_OutPointDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long res = bindings.LDKCResult_OutPointDecodeErrorZ_get_ok(ptr);
+ OutPoint res_hu_conv = new OutPoint(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_OutPointDecodeErrorZ_OK(OutPoint res) {
+ this(null, bindings.CResult_OutPointDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_OutPointDecodeErrorZ_Err extends Result_OutPointDecodeErrorZ {
+ public final DecodeError err;
+ private Result_OutPointDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long err = bindings.LDKCResult_OutPointDecodeErrorZ_get_err(ptr);
+ DecodeError err_hu_conv = new DecodeError(null, err);
+ err_hu_conv.ptrs_to.add(this);
+ this.err = err_hu_conv;
+ }
+ public Result_OutPointDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_OutPointDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class Result_PublicKeyErrorZ extends CommonBase {
+ private Result_PublicKeyErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_PublicKeyErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_PublicKeyErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_PublicKeyErrorZ_result_ok(ptr)) {
+ return new Result_PublicKeyErrorZ_OK(null, ptr);
+ } else {
+ return new Result_PublicKeyErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_PublicKeyErrorZ_OK extends Result_PublicKeyErrorZ {
+ public final byte[] res;
+ private Result_PublicKeyErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ this.res = bindings.LDKCResult_PublicKeyErrorZ_get_ok(ptr);
+ }
+ public Result_PublicKeyErrorZ_OK(byte[] res) {
+ this(null, bindings.CResult_PublicKeyErrorZ_ok(res));
+ }
+ }
+
+ public static final class Result_PublicKeyErrorZ_Err extends Result_PublicKeyErrorZ {
+ public final LDKSecp256k1Error err;
+ private Result_PublicKeyErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ this.err = bindings.LDKCResult_PublicKeyErrorZ_get_err(ptr);
+ }
+ public Result_PublicKeyErrorZ_Err(LDKSecp256k1Error err) {
+ this(null, bindings.CResult_PublicKeyErrorZ_err(err));
+ }
+ }
+}
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class Result_RevokeAndACKDecodeErrorZ extends CommonBase {
+ private Result_RevokeAndACKDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_RevokeAndACKDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_RevokeAndACKDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_RevokeAndACKDecodeErrorZ_result_ok(ptr)) {
+ return new Result_RevokeAndACKDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_RevokeAndACKDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_RevokeAndACKDecodeErrorZ_OK extends Result_RevokeAndACKDecodeErrorZ {
+ public final RevokeAndACK res;
+ private Result_RevokeAndACKDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long res = bindings.LDKCResult_RevokeAndACKDecodeErrorZ_get_ok(ptr);
+ RevokeAndACK res_hu_conv = new RevokeAndACK(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_RevokeAndACKDecodeErrorZ_OK(RevokeAndACK res) {
+ this(null, bindings.CResult_RevokeAndACKDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_RevokeAndACKDecodeErrorZ_Err extends Result_RevokeAndACKDecodeErrorZ {
+ public final DecodeError err;
+ private Result_RevokeAndACKDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long err = bindings.LDKCResult_RevokeAndACKDecodeErrorZ_get_err(ptr);
+ DecodeError err_hu_conv = new DecodeError(null, err);
+ err_hu_conv.ptrs_to.add(this);
+ this.err = err_hu_conv;
+ }
+ public Result_RevokeAndACKDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_RevokeAndACKDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class Result_SecretKeyErrorZ extends CommonBase {
+ private Result_SecretKeyErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_SecretKeyErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_SecretKeyErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_SecretKeyErrorZ_result_ok(ptr)) {
+ return new Result_SecretKeyErrorZ_OK(null, ptr);
+ } else {
+ return new Result_SecretKeyErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_SecretKeyErrorZ_OK extends Result_SecretKeyErrorZ {
+ public final byte[] res;
+ private Result_SecretKeyErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ this.res = bindings.LDKCResult_SecretKeyErrorZ_get_ok(ptr);
+ }
+ public Result_SecretKeyErrorZ_OK(byte[] res) {
+ this(null, bindings.CResult_SecretKeyErrorZ_ok(res));
+ }
+ }
+
+ public static final class Result_SecretKeyErrorZ_Err extends Result_SecretKeyErrorZ {
+ public final LDKSecp256k1Error err;
+ private Result_SecretKeyErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ this.err = bindings.LDKCResult_SecretKeyErrorZ_get_err(ptr);
+ }
+ public Result_SecretKeyErrorZ_Err(LDKSecp256k1Error err) {
+ this(null, bindings.CResult_SecretKeyErrorZ_err(err));
+ }
+ }
+}
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class Result_ShutdownDecodeErrorZ extends CommonBase {
+ private Result_ShutdownDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_ShutdownDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_ShutdownDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_ShutdownDecodeErrorZ_result_ok(ptr)) {
+ return new Result_ShutdownDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_ShutdownDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_ShutdownDecodeErrorZ_OK extends Result_ShutdownDecodeErrorZ {
+ public final Shutdown res;
+ private Result_ShutdownDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long res = bindings.LDKCResult_ShutdownDecodeErrorZ_get_ok(ptr);
+ Shutdown res_hu_conv = new Shutdown(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_ShutdownDecodeErrorZ_OK(Shutdown res) {
+ this(null, bindings.CResult_ShutdownDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_ShutdownDecodeErrorZ_Err extends Result_ShutdownDecodeErrorZ {
+ public final DecodeError err;
+ private Result_ShutdownDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long err = bindings.LDKCResult_ShutdownDecodeErrorZ_get_err(ptr);
+ DecodeError err_hu_conv = new DecodeError(null, err);
+ err_hu_conv.ptrs_to.add(this);
+ this.err = err_hu_conv;
+ }
+ public Result_ShutdownDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_ShutdownDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class Result_SignDecodeErrorZ extends CommonBase {
+ private Result_SignDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_SignDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_SignDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_SignDecodeErrorZ_result_ok(ptr)) {
+ return new Result_SignDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_SignDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_SignDecodeErrorZ_OK extends Result_SignDecodeErrorZ {
+ public final Sign res;
+ private Result_SignDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long res = bindings.LDKCResult_SignDecodeErrorZ_get_ok(ptr);
+ Sign ret_hu_conv = new Sign(null, res);
+ ret_hu_conv.ptrs_to.add(this);
+ this.res = ret_hu_conv;
+ }
+ public Result_SignDecodeErrorZ_OK(Sign res) {
+ this(null, bindings.CResult_SignDecodeErrorZ_ok(res == null ? 0 : res.ptr));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_SignDecodeErrorZ_Err extends Result_SignDecodeErrorZ {
+ public final DecodeError err;
+ private Result_SignDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long err = bindings.LDKCResult_SignDecodeErrorZ_get_err(ptr);
+ DecodeError err_hu_conv = new DecodeError(null, err);
+ err_hu_conv.ptrs_to.add(this);
+ this.err = err_hu_conv;
+ }
+ public Result_SignDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_SignDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class Result_TransactionNoneZ extends CommonBase {
+ private Result_TransactionNoneZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_TransactionNoneZ_free(ptr); } super.finalize();
+ }
+
+ static Result_TransactionNoneZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_TransactionNoneZ_result_ok(ptr)) {
+ return new Result_TransactionNoneZ_OK(null, ptr);
+ } else {
+ return new Result_TransactionNoneZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_TransactionNoneZ_OK extends Result_TransactionNoneZ {
+ public final byte[] res;
+ private Result_TransactionNoneZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ this.res = bindings.LDKCResult_TransactionNoneZ_get_ok(ptr);
+ }
+ public Result_TransactionNoneZ_OK(byte[] res) {
+ this(null, bindings.CResult_TransactionNoneZ_ok(res));
+ }
+ }
+
+ public static final class Result_TransactionNoneZ_Err extends Result_TransactionNoneZ {
+ private Result_TransactionNoneZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ }
+ public Result_TransactionNoneZ_Err() {
+ this(null, bindings.CResult_TransactionNoneZ_err());
+ }
+ }
+}
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class Result_TxCreationKeysDecodeErrorZ extends CommonBase {
+ private Result_TxCreationKeysDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_TxCreationKeysDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_TxCreationKeysDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_TxCreationKeysDecodeErrorZ_result_ok(ptr)) {
+ return new Result_TxCreationKeysDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_TxCreationKeysDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_TxCreationKeysDecodeErrorZ_OK extends Result_TxCreationKeysDecodeErrorZ {
+ public final TxCreationKeys res;
+ private Result_TxCreationKeysDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long res = bindings.LDKCResult_TxCreationKeysDecodeErrorZ_get_ok(ptr);
+ TxCreationKeys res_hu_conv = new TxCreationKeys(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_TxCreationKeysDecodeErrorZ_OK(TxCreationKeys res) {
+ this(null, bindings.CResult_TxCreationKeysDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_TxCreationKeysDecodeErrorZ_Err extends Result_TxCreationKeysDecodeErrorZ {
+ public final DecodeError err;
+ private Result_TxCreationKeysDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long err = bindings.LDKCResult_TxCreationKeysDecodeErrorZ_get_err(ptr);
+ DecodeError err_hu_conv = new DecodeError(null, err);
+ err_hu_conv.ptrs_to.add(this);
+ this.err = err_hu_conv;
+ }
+ public Result_TxCreationKeysDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_TxCreationKeysDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class Result_TxCreationKeysErrorZ extends CommonBase {
+ private Result_TxCreationKeysErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_TxCreationKeysErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_TxCreationKeysErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_TxCreationKeysErrorZ_result_ok(ptr)) {
+ return new Result_TxCreationKeysErrorZ_OK(null, ptr);
+ } else {
+ return new Result_TxCreationKeysErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_TxCreationKeysErrorZ_OK extends Result_TxCreationKeysErrorZ {
+ public final TxCreationKeys res;
+ private Result_TxCreationKeysErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long res = bindings.LDKCResult_TxCreationKeysErrorZ_get_ok(ptr);
+ TxCreationKeys res_hu_conv = new TxCreationKeys(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_TxCreationKeysErrorZ_OK(TxCreationKeys res) {
+ this(null, bindings.CResult_TxCreationKeysErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_TxCreationKeysErrorZ_Err extends Result_TxCreationKeysErrorZ {
+ public final LDKSecp256k1Error err;
+ private Result_TxCreationKeysErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ this.err = bindings.LDKCResult_TxCreationKeysErrorZ_get_err(ptr);
+ }
+ public Result_TxCreationKeysErrorZ_Err(LDKSecp256k1Error err) {
+ this(null, bindings.CResult_TxCreationKeysErrorZ_err(err));
+ }
+ }
+}
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class Result_UpdateAddHTLCDecodeErrorZ extends CommonBase {
+ private Result_UpdateAddHTLCDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_UpdateAddHTLCDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_UpdateAddHTLCDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_UpdateAddHTLCDecodeErrorZ_result_ok(ptr)) {
+ return new Result_UpdateAddHTLCDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_UpdateAddHTLCDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_UpdateAddHTLCDecodeErrorZ_OK extends Result_UpdateAddHTLCDecodeErrorZ {
+ public final UpdateAddHTLC res;
+ private Result_UpdateAddHTLCDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long res = bindings.LDKCResult_UpdateAddHTLCDecodeErrorZ_get_ok(ptr);
+ UpdateAddHTLC res_hu_conv = new UpdateAddHTLC(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_UpdateAddHTLCDecodeErrorZ_OK(UpdateAddHTLC res) {
+ this(null, bindings.CResult_UpdateAddHTLCDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_UpdateAddHTLCDecodeErrorZ_Err extends Result_UpdateAddHTLCDecodeErrorZ {
+ public final DecodeError err;
+ private Result_UpdateAddHTLCDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long err = bindings.LDKCResult_UpdateAddHTLCDecodeErrorZ_get_err(ptr);
+ DecodeError err_hu_conv = new DecodeError(null, err);
+ err_hu_conv.ptrs_to.add(this);
+ this.err = err_hu_conv;
+ }
+ public Result_UpdateAddHTLCDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_UpdateAddHTLCDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class Result_UpdateFailHTLCDecodeErrorZ extends CommonBase {
+ private Result_UpdateFailHTLCDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_UpdateFailHTLCDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_UpdateFailHTLCDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_UpdateFailHTLCDecodeErrorZ_result_ok(ptr)) {
+ return new Result_UpdateFailHTLCDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_UpdateFailHTLCDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_UpdateFailHTLCDecodeErrorZ_OK extends Result_UpdateFailHTLCDecodeErrorZ {
+ public final UpdateFailHTLC res;
+ private Result_UpdateFailHTLCDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long res = bindings.LDKCResult_UpdateFailHTLCDecodeErrorZ_get_ok(ptr);
+ UpdateFailHTLC res_hu_conv = new UpdateFailHTLC(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_UpdateFailHTLCDecodeErrorZ_OK(UpdateFailHTLC res) {
+ this(null, bindings.CResult_UpdateFailHTLCDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_UpdateFailHTLCDecodeErrorZ_Err extends Result_UpdateFailHTLCDecodeErrorZ {
+ public final DecodeError err;
+ private Result_UpdateFailHTLCDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long err = bindings.LDKCResult_UpdateFailHTLCDecodeErrorZ_get_err(ptr);
+ DecodeError err_hu_conv = new DecodeError(null, err);
+ err_hu_conv.ptrs_to.add(this);
+ this.err = err_hu_conv;
+ }
+ public Result_UpdateFailHTLCDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_UpdateFailHTLCDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class Result_UpdateFailMalformedHTLCDecodeErrorZ extends CommonBase {
+ private Result_UpdateFailMalformedHTLCDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_UpdateFailMalformedHTLCDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ_result_ok(ptr)) {
+ return new Result_UpdateFailMalformedHTLCDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_UpdateFailMalformedHTLCDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_UpdateFailMalformedHTLCDecodeErrorZ_OK extends Result_UpdateFailMalformedHTLCDecodeErrorZ {
+ public final UpdateFailMalformedHTLC res;
+ private Result_UpdateFailMalformedHTLCDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long res = bindings.LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ_get_ok(ptr);
+ UpdateFailMalformedHTLC res_hu_conv = new UpdateFailMalformedHTLC(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_UpdateFailMalformedHTLCDecodeErrorZ_OK(UpdateFailMalformedHTLC res) {
+ this(null, bindings.CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_UpdateFailMalformedHTLCDecodeErrorZ_Err extends Result_UpdateFailMalformedHTLCDecodeErrorZ {
+ public final DecodeError err;
+ private Result_UpdateFailMalformedHTLCDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long err = bindings.LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err(ptr);
+ DecodeError err_hu_conv = new DecodeError(null, err);
+ err_hu_conv.ptrs_to.add(this);
+ this.err = err_hu_conv;
+ }
+ public Result_UpdateFailMalformedHTLCDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class Result_UpdateFeeDecodeErrorZ extends CommonBase {
+ private Result_UpdateFeeDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_UpdateFeeDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_UpdateFeeDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_UpdateFeeDecodeErrorZ_result_ok(ptr)) {
+ return new Result_UpdateFeeDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_UpdateFeeDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_UpdateFeeDecodeErrorZ_OK extends Result_UpdateFeeDecodeErrorZ {
+ public final UpdateFee res;
+ private Result_UpdateFeeDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long res = bindings.LDKCResult_UpdateFeeDecodeErrorZ_get_ok(ptr);
+ UpdateFee res_hu_conv = new UpdateFee(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_UpdateFeeDecodeErrorZ_OK(UpdateFee res) {
+ this(null, bindings.CResult_UpdateFeeDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_UpdateFeeDecodeErrorZ_Err extends Result_UpdateFeeDecodeErrorZ {
+ public final DecodeError err;
+ private Result_UpdateFeeDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long err = bindings.LDKCResult_UpdateFeeDecodeErrorZ_get_err(ptr);
+ DecodeError err_hu_conv = new DecodeError(null, err);
+ err_hu_conv.ptrs_to.add(this);
+ this.err = err_hu_conv;
+ }
+ public Result_UpdateFeeDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_UpdateFeeDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class Result_UpdateFulfillHTLCDecodeErrorZ extends CommonBase {
+ private Result_UpdateFulfillHTLCDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_UpdateFulfillHTLCDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_UpdateFulfillHTLCDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_UpdateFulfillHTLCDecodeErrorZ_result_ok(ptr)) {
+ return new Result_UpdateFulfillHTLCDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_UpdateFulfillHTLCDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_UpdateFulfillHTLCDecodeErrorZ_OK extends Result_UpdateFulfillHTLCDecodeErrorZ {
+ public final UpdateFulfillHTLC res;
+ private Result_UpdateFulfillHTLCDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long res = bindings.LDKCResult_UpdateFulfillHTLCDecodeErrorZ_get_ok(ptr);
+ UpdateFulfillHTLC res_hu_conv = new UpdateFulfillHTLC(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_UpdateFulfillHTLCDecodeErrorZ_OK(UpdateFulfillHTLC res) {
+ this(null, bindings.CResult_UpdateFulfillHTLCDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_UpdateFulfillHTLCDecodeErrorZ_Err extends Result_UpdateFulfillHTLCDecodeErrorZ {
+ public final DecodeError err;
+ private Result_UpdateFulfillHTLCDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long err = bindings.LDKCResult_UpdateFulfillHTLCDecodeErrorZ_get_err(ptr);
+ DecodeError err_hu_conv = new DecodeError(null, err);
+ err_hu_conv.ptrs_to.add(this);
+ this.err = err_hu_conv;
+ }
+ public Result_UpdateFulfillHTLCDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_UpdateFulfillHTLCDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
}
public void set_paths(RouteHop[][] val) {
- bindings.Route_set_paths(this.ptr, Arrays.stream(val).map(arr_conv_12 -> Arrays.stream(arr_conv_12).mapToLong(arr_conv_10 -> arr_conv_10 == null ? 0 : arr_conv_10.ptr & ~1).toArray()).toArray(long[][]::new));
+ bindings.Route_set_paths(this.ptr, Arrays.stream(val).map(val_conv_12 -> Arrays.stream(val_conv_12).mapToLong(val_conv_12_conv_10 -> val_conv_12_conv_10 == null ? 0 : val_conv_12_conv_10.ptr & ~1).toArray()).toArray(long[][]::new));
/* TODO 2 RouteHop[] */;
}
public static Route constructor_new(RouteHop[][] paths_arg) {
- long ret = bindings.Route_new(Arrays.stream(paths_arg).map(arr_conv_12 -> Arrays.stream(arr_conv_12).mapToLong(arr_conv_10 -> arr_conv_10 == null ? 0 : arr_conv_10.ptr & ~1).toArray()).toArray(long[][]::new));
+ long ret = bindings.Route_new(Arrays.stream(paths_arg).map(paths_arg_conv_12 -> Arrays.stream(paths_arg_conv_12).mapToLong(paths_arg_conv_12_conv_10 -> paths_arg_conv_12_conv_10 == null ? 0 : paths_arg_conv_12_conv_10.ptr & ~1).toArray()).toArray(long[][]::new));
Route ret_hu_conv = new Route(null, ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
/* TODO 2 RouteHop[] */;
}
@Override public long[] get_next_channel_announcements(long starting_point, byte batch_amount) {
ThreeTuple<ChannelAnnouncement, ChannelUpdate, ChannelUpdate>[] ret = arg.get_next_channel_announcements(starting_point, batch_amount);
- long[] result = Arrays.stream(ret).mapToLong(arr_conv_63 -> bindings.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(arr_conv_63.a == null ? 0 : arr_conv_63.a.ptr & ~1, arr_conv_63.b == null ? 0 : arr_conv_63.b.ptr & ~1, arr_conv_63.c == null ? 0 : arr_conv_63.c.ptr & ~1)).toArray();
+ long[] result = Arrays.stream(ret).mapToLong(ret_conv_63 -> bindings.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(ret_conv_63.a == null ? 0 : ret_conv_63.a.ptr & ~1, ret_conv_63.b == null ? 0 : ret_conv_63.b.ptr & ~1, ret_conv_63.c == null ? 0 : ret_conv_63.c.ptr & ~1)).toArray();
/* TODO 2 ThreeTuple<ChannelAnnouncement, ChannelUpdate, ChannelUpdate> */;
return result;
}
@Override public long[] get_next_node_announcements(byte[] starting_point, byte batch_amount) {
NodeAnnouncement[] ret = arg.get_next_node_announcements(starting_point, batch_amount);
- long[] result = Arrays.stream(ret).mapToLong(arr_conv_18 -> arr_conv_18 == null ? 0 : arr_conv_18.ptr & ~1).toArray();
+ long[] result = Arrays.stream(ret).mapToLong(ret_conv_18 -> ret_conv_18 == null ? 0 : ret_conv_18.ptr & ~1).toArray();
/* TODO 2 NodeAnnouncement */;
return result;
}
public ThreeTuple<ChannelAnnouncement, ChannelUpdate, ChannelUpdate>[] get_next_channel_announcements(long starting_point, byte batch_amount) {
long[] ret = bindings.RoutingMessageHandler_get_next_channel_announcements(this.ptr, starting_point, batch_amount);
- ThreeTuple<ChannelAnnouncement, ChannelUpdate, ChannelUpdate>[] arr_conv_63_arr = new ThreeTuple[ret.length];
+ ThreeTuple<ChannelAnnouncement, ChannelUpdate, ChannelUpdate>[] ret_conv_63_arr = new ThreeTuple[ret.length];
for (int l = 0; l < ret.length; l++) {
- long arr_conv_63 = ret[l];
- long arr_conv_63_a = bindings.LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(arr_conv_63);
- ChannelAnnouncement arr_conv_63_a_hu_conv = new ChannelAnnouncement(null, arr_conv_63_a);
- arr_conv_63_a_hu_conv.ptrs_to.add(this);;
- long arr_conv_63_b = bindings.LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(arr_conv_63);
- ChannelUpdate arr_conv_63_b_hu_conv = new ChannelUpdate(null, arr_conv_63_b);
- arr_conv_63_b_hu_conv.ptrs_to.add(this);;
- long arr_conv_63_c = bindings.LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(arr_conv_63);
- ChannelUpdate arr_conv_63_c_hu_conv = new ChannelUpdate(null, arr_conv_63_c);
- arr_conv_63_c_hu_conv.ptrs_to.add(this);;
- ThreeTuple<ChannelAnnouncement, ChannelUpdate, ChannelUpdate> arr_conv_63_conv = new ThreeTuple<ChannelAnnouncement, ChannelUpdate, ChannelUpdate>(arr_conv_63_a_hu_conv, arr_conv_63_b_hu_conv, arr_conv_63_c_hu_conv, () -> {
- bindings.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(arr_conv_63);
+ long ret_conv_63 = ret[l];
+ long ret_conv_63_a = bindings.LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(ret_conv_63);
+ ChannelAnnouncement ret_conv_63_a_hu_conv = new ChannelAnnouncement(null, ret_conv_63_a);
+ ret_conv_63_a_hu_conv.ptrs_to.add(this);;
+ long ret_conv_63_b = bindings.LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(ret_conv_63);
+ ChannelUpdate ret_conv_63_b_hu_conv = new ChannelUpdate(null, ret_conv_63_b);
+ ret_conv_63_b_hu_conv.ptrs_to.add(this);;
+ long ret_conv_63_c = bindings.LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(ret_conv_63);
+ ChannelUpdate ret_conv_63_c_hu_conv = new ChannelUpdate(null, ret_conv_63_c);
+ ret_conv_63_c_hu_conv.ptrs_to.add(this);;
+ ThreeTuple<ChannelAnnouncement, ChannelUpdate, ChannelUpdate> ret_conv_63_conv = new ThreeTuple<ChannelAnnouncement, ChannelUpdate, ChannelUpdate>(ret_conv_63_a_hu_conv, ret_conv_63_b_hu_conv, ret_conv_63_c_hu_conv, () -> {
+ bindings.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(ret_conv_63);
});
- arr_conv_63_a_hu_conv.ptrs_to.add(arr_conv_63_conv);
- arr_conv_63_b_hu_conv.ptrs_to.add(arr_conv_63_conv);
- arr_conv_63_c_hu_conv.ptrs_to.add(arr_conv_63_conv);
- arr_conv_63_arr[l] = arr_conv_63_conv;
+ ret_conv_63_a_hu_conv.ptrs_to.add(ret_conv_63_conv);
+ ret_conv_63_b_hu_conv.ptrs_to.add(ret_conv_63_conv);
+ ret_conv_63_c_hu_conv.ptrs_to.add(ret_conv_63_conv);
+ ret_conv_63_arr[l] = ret_conv_63_conv;
}
- return arr_conv_63_arr;
+ return ret_conv_63_arr;
}
public NodeAnnouncement[] get_next_node_announcements(byte[] starting_point, byte batch_amount) {
long[] ret = bindings.RoutingMessageHandler_get_next_node_announcements(this.ptr, starting_point, batch_amount);
- NodeAnnouncement[] arr_conv_18_arr = new NodeAnnouncement[ret.length];
+ NodeAnnouncement[] ret_conv_18_arr = new NodeAnnouncement[ret.length];
for (int s = 0; s < ret.length; s++) {
- long arr_conv_18 = ret[s];
- NodeAnnouncement arr_conv_18_hu_conv = new NodeAnnouncement(null, arr_conv_18);
- arr_conv_18_hu_conv.ptrs_to.add(this);
- arr_conv_18_arr[s] = arr_conv_18_hu_conv;
+ long ret_conv_18 = ret[s];
+ NodeAnnouncement ret_conv_18_hu_conv = new NodeAnnouncement(null, ret_conv_18);
+ ret_conv_18_hu_conv.ptrs_to.add(this);
+ ret_conv_18_arr[s] = ret_conv_18_hu_conv;
}
- return arr_conv_18_arr;
+ return ret_conv_18_arr;
}
public void sync_routing_table(byte[] their_node_id, Init init) {
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class Sign extends CommonBase {
+ final bindings.LDKSign bindings_instance;
+ Sign(Object _dummy, long ptr) { super(ptr); bindings_instance = null; }
+ private Sign(bindings.LDKSign arg, ChannelPublicKeys pubkeys) {
+ super(bindings.LDKSign_new(arg, pubkeys == null ? 0 : pubkeys.ptr & ~1));
+ this.ptrs_to.add(arg);
+ this.ptrs_to.add(pubkeys);
+ this.bindings_instance = arg;
+ }
+ @Override @SuppressWarnings("deprecation")
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.Sign_free(ptr); } super.finalize();
+ }
+
+ public static interface SignInterface {
+ byte[] get_per_commitment_point(long idx);
+ byte[] release_commitment_secret(long idx);
+ byte[] channel_keys_id();
+ Result_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment(CommitmentTransaction commitment_tx);
+ Result_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htlcs(HolderCommitmentTransaction commitment_tx);
+ Result_SignatureNoneZ sign_justice_transaction(byte[] justice_tx, long input, long amount, byte[] per_commitment_key, HTLCOutputInCommitment htlc);
+ Result_SignatureNoneZ sign_counterparty_htlc_transaction(byte[] htlc_tx, long input, long amount, byte[] per_commitment_point, HTLCOutputInCommitment htlc);
+ Result_SignatureNoneZ sign_closing_transaction(byte[] closing_tx);
+ Result_SignatureNoneZ sign_channel_announcement(UnsignedChannelAnnouncement msg);
+ void ready_channel(ChannelTransactionParameters channel_parameters);
+ byte[] write();
+ }
+ private static class LDKSignHolder { Sign held; }
+ public static Sign new_impl(SignInterface arg, ChannelPublicKeys pubkeys) {
+ final LDKSignHolder impl_holder = new LDKSignHolder();
+ impl_holder.held = new Sign(new bindings.LDKSign() {
+ @Override public byte[] get_per_commitment_point(long idx) {
+ byte[] ret = arg.get_per_commitment_point(idx);
+ return ret;
+ }
+ @Override public byte[] release_commitment_secret(long idx) {
+ byte[] ret = arg.release_commitment_secret(idx);
+ return ret;
+ }
+ @Override public byte[] channel_keys_id() {
+ byte[] ret = arg.channel_keys_id();
+ return ret;
+ }
+ @Override public long sign_counterparty_commitment(long commitment_tx) {
+ CommitmentTransaction commitment_tx_hu_conv = new CommitmentTransaction(null, commitment_tx);
+ Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret = arg.sign_counterparty_commitment(commitment_tx_hu_conv);
+ long result = ret != null ? ret.ptr : 0;
+ return result;
+ }
+ @Override public long sign_holder_commitment_and_htlcs(long commitment_tx) {
+ HolderCommitmentTransaction commitment_tx_hu_conv = new HolderCommitmentTransaction(null, commitment_tx);
+ Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret = arg.sign_holder_commitment_and_htlcs(commitment_tx_hu_conv);
+ long result = ret != null ? ret.ptr : 0;
+ return result;
+ }
+ @Override public long sign_justice_transaction(byte[] justice_tx, long input, long amount, byte[] per_commitment_key, long htlc) {
+ HTLCOutputInCommitment htlc_hu_conv = new HTLCOutputInCommitment(null, htlc);
+ Result_SignatureNoneZ ret = arg.sign_justice_transaction(justice_tx, input, amount, per_commitment_key, htlc_hu_conv);
+ long result = ret != null ? ret.ptr : 0;
+ return result;
+ }
+ @Override public long sign_counterparty_htlc_transaction(byte[] htlc_tx, long input, long amount, byte[] per_commitment_point, long htlc) {
+ HTLCOutputInCommitment htlc_hu_conv = new HTLCOutputInCommitment(null, htlc);
+ Result_SignatureNoneZ ret = arg.sign_counterparty_htlc_transaction(htlc_tx, input, amount, per_commitment_point, htlc_hu_conv);
+ long result = ret != null ? ret.ptr : 0;
+ return result;
+ }
+ @Override public long sign_closing_transaction(byte[] closing_tx) {
+ Result_SignatureNoneZ ret = arg.sign_closing_transaction(closing_tx);
+ long result = ret != null ? ret.ptr : 0;
+ return result;
+ }
+ @Override public long sign_channel_announcement(long msg) {
+ UnsignedChannelAnnouncement msg_hu_conv = new UnsignedChannelAnnouncement(null, msg);
+ Result_SignatureNoneZ ret = arg.sign_channel_announcement(msg_hu_conv);
+ long result = ret != null ? ret.ptr : 0;
+ return result;
+ }
+ @Override public void ready_channel(long channel_parameters) {
+ ChannelTransactionParameters channel_parameters_hu_conv = new ChannelTransactionParameters(null, channel_parameters);
+ arg.ready_channel(channel_parameters_hu_conv);
+ }
+ @Override public byte[] write() {
+ byte[] ret = arg.write();
+ return ret;
+ }
+ }, pubkeys);
+ return impl_holder.held;
+ }
+ public byte[] get_per_commitment_point(long idx) {
+ byte[] ret = bindings.Sign_get_per_commitment_point(this.ptr, idx);
+ return ret;
+ }
+
+ public byte[] release_commitment_secret(long idx) {
+ byte[] ret = bindings.Sign_release_commitment_secret(this.ptr, idx);
+ return ret;
+ }
+
+ public byte[] channel_keys_id() {
+ byte[] ret = bindings.Sign_channel_keys_id(this.ptr);
+ return ret;
+ }
+
+ public Result_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment(CommitmentTransaction commitment_tx) {
+ long ret = bindings.Sign_sign_counterparty_commitment(this.ptr, commitment_tx == null ? 0 : commitment_tx.ptr & ~1);
+ Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_hu_conv = Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.constr_from_ptr(ret);
+ this.ptrs_to.add(commitment_tx);
+ return ret_hu_conv;
+ }
+
+ public Result_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htlcs(HolderCommitmentTransaction commitment_tx) {
+ long ret = bindings.Sign_sign_holder_commitment_and_htlcs(this.ptr, commitment_tx == null ? 0 : commitment_tx.ptr & ~1);
+ Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_hu_conv = Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.constr_from_ptr(ret);
+ this.ptrs_to.add(commitment_tx);
+ return ret_hu_conv;
+ }
+
+ public Result_SignatureNoneZ sign_justice_transaction(byte[] justice_tx, long input, long amount, byte[] per_commitment_key, HTLCOutputInCommitment htlc) {
+ long ret = bindings.Sign_sign_justice_transaction(this.ptr, justice_tx, input, amount, per_commitment_key, htlc == null ? 0 : htlc.ptr & ~1);
+ Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret);
+ this.ptrs_to.add(htlc);
+ return ret_hu_conv;
+ }
+
+ public Result_SignatureNoneZ sign_counterparty_htlc_transaction(byte[] htlc_tx, long input, long amount, byte[] per_commitment_point, HTLCOutputInCommitment htlc) {
+ long ret = bindings.Sign_sign_counterparty_htlc_transaction(this.ptr, htlc_tx, input, amount, per_commitment_point, htlc == null ? 0 : htlc.ptr & ~1);
+ Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret);
+ this.ptrs_to.add(htlc);
+ return ret_hu_conv;
+ }
+
+ public Result_SignatureNoneZ sign_closing_transaction(byte[] closing_tx) {
+ long ret = bindings.Sign_sign_closing_transaction(this.ptr, closing_tx);
+ Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ public Result_SignatureNoneZ sign_channel_announcement(UnsignedChannelAnnouncement msg) {
+ long ret = bindings.Sign_sign_channel_announcement(this.ptr, msg == null ? 0 : msg.ptr & ~1);
+ Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret);
+ this.ptrs_to.add(msg);
+ return ret_hu_conv;
+ }
+
+ public void ready_channel(ChannelTransactionParameters channel_parameters) {
+ bindings.Sign_ready_channel(this.ptr, channel_parameters == null ? 0 : channel_parameters.ptr & ~1);
+ this.ptrs_to.add(channel_parameters);
+ }
+
+ public byte[] write() {
+ byte[] ret = bindings.Sign_write(this.ptr);
+ return ret;
+ }
+
+ public ChannelPublicKeys get_pubkeys() {
+ long ret = bindings.Sign_get_pubkeys(this.ptr);
+ ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
+ public Sign clone() {
+ long ret = bindings.Sign_clone(this.ptr);
+ Sign ret_hu_conv = new Sign(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
+}
if (raw_val.getClass() == bindings.LDKSpendableOutputDescriptor.StaticOutput.class) {
return new StaticOutput(ptr, (bindings.LDKSpendableOutputDescriptor.StaticOutput)raw_val);
}
- if (raw_val.getClass() == bindings.LDKSpendableOutputDescriptor.DynamicOutputP2WSH.class) {
- return new DynamicOutputP2WSH(ptr, (bindings.LDKSpendableOutputDescriptor.DynamicOutputP2WSH)raw_val);
+ if (raw_val.getClass() == bindings.LDKSpendableOutputDescriptor.DelayedPaymentOutput.class) {
+ return new DelayedPaymentOutput(ptr, (bindings.LDKSpendableOutputDescriptor.DelayedPaymentOutput)raw_val);
}
- if (raw_val.getClass() == bindings.LDKSpendableOutputDescriptor.StaticOutputCounterpartyPayment.class) {
- return new StaticOutputCounterpartyPayment(ptr, (bindings.LDKSpendableOutputDescriptor.StaticOutputCounterpartyPayment)raw_val);
+ if (raw_val.getClass() == bindings.LDKSpendableOutputDescriptor.StaticPaymentOutput.class) {
+ return new StaticPaymentOutput(ptr, (bindings.LDKSpendableOutputDescriptor.StaticPaymentOutput)raw_val);
}
assert false; return null; // Unreachable without extending the (internal) bindings interface
}
this.output = output_conv;
}
}
- public final static class DynamicOutputP2WSH extends SpendableOutputDescriptor {
- public final OutPoint outpoint;
- public final byte[] per_commitment_point;
- public final short to_self_delay;
- public final TxOut output;
- public final TwoTuple<Long, Long> key_derivation_params;
- public final byte[] revocation_pubkey;
- private DynamicOutputP2WSH(long ptr, bindings.LDKSpendableOutputDescriptor.DynamicOutputP2WSH obj) {
+ public final static class DelayedPaymentOutput extends SpendableOutputDescriptor {
+ private DelayedPaymentOutput(long ptr, bindings.LDKSpendableOutputDescriptor.DelayedPaymentOutput obj) {
super(null, ptr);
- long outpoint = obj.outpoint;
- OutPoint outpoint_hu_conv = new OutPoint(null, outpoint);
- outpoint_hu_conv.ptrs_to.add(this);
- this.outpoint = outpoint_hu_conv;
- this.per_commitment_point = obj.per_commitment_point;
- this.to_self_delay = obj.to_self_delay;
- long output = obj.output;
- TxOut output_conv = new TxOut(null, output);
- this.output = output_conv;
- long key_derivation_params = obj.key_derivation_params;
- long key_derivation_params_a = bindings.LDKC2Tuple_u64u64Z_get_a(key_derivation_params);
- long key_derivation_params_b = bindings.LDKC2Tuple_u64u64Z_get_b(key_derivation_params);
- TwoTuple<Long, Long> key_derivation_params_conv = new TwoTuple<Long, Long>(key_derivation_params_a, key_derivation_params_b, () -> {
- bindings.C2Tuple_u64u64Z_free(key_derivation_params);
- });
- this.key_derivation_params = key_derivation_params_conv;
- this.revocation_pubkey = obj.revocation_pubkey;
}
}
- public final static class StaticOutputCounterpartyPayment extends SpendableOutputDescriptor {
- public final OutPoint outpoint;
- public final TxOut output;
- public final TwoTuple<Long, Long> key_derivation_params;
- private StaticOutputCounterpartyPayment(long ptr, bindings.LDKSpendableOutputDescriptor.StaticOutputCounterpartyPayment obj) {
+ public final static class StaticPaymentOutput extends SpendableOutputDescriptor {
+ private StaticPaymentOutput(long ptr, bindings.LDKSpendableOutputDescriptor.StaticPaymentOutput obj) {
super(null, ptr);
- long outpoint = obj.outpoint;
- OutPoint outpoint_hu_conv = new OutPoint(null, outpoint);
- outpoint_hu_conv.ptrs_to.add(this);
- this.outpoint = outpoint_hu_conv;
- long output = obj.output;
- TxOut output_conv = new TxOut(null, output);
- this.output = output_conv;
- long key_derivation_params = obj.key_derivation_params;
- long key_derivation_params_a = bindings.LDKC2Tuple_u64u64Z_get_a(key_derivation_params);
- long key_derivation_params_b = bindings.LDKC2Tuple_u64u64Z_get_b(key_derivation_params);
- TwoTuple<Long, Long> key_derivation_params_conv = new TwoTuple<Long, Long>(key_derivation_params_a, key_derivation_params_b, () -> {
- bindings.C2Tuple_u64u64Z_free(key_derivation_params);
- });
- this.key_derivation_params = key_derivation_params_conv;
}
}
}
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class StaticPaymentOutputDescriptor extends CommonBase {
+ StaticPaymentOutputDescriptor(Object _dummy, long ptr) { super(ptr); }
+ @Override @SuppressWarnings("deprecation")
+ protected void finalize() throws Throwable {
+ super.finalize();
+ if (ptr != 0) { bindings.StaticPaymentOutputDescriptor_free(ptr); }
+ }
+
+ public OutPoint get_outpoint() {
+ long ret = bindings.StaticPaymentOutputDescriptor_get_outpoint(this.ptr);
+ OutPoint ret_hu_conv = new OutPoint(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
+ public void set_outpoint(OutPoint val) {
+ bindings.StaticPaymentOutputDescriptor_set_outpoint(this.ptr, val == null ? 0 : val.ptr & ~1);
+ this.ptrs_to.add(val);
+ }
+
+ public void set_output(TxOut val) {
+ bindings.StaticPaymentOutputDescriptor_set_output(this.ptr, val.ptr);
+ }
+
+ public byte[] get_channel_keys_id() {
+ byte[] ret = bindings.StaticPaymentOutputDescriptor_get_channel_keys_id(this.ptr);
+ return ret;
+ }
+
+ public void set_channel_keys_id(byte[] val) {
+ bindings.StaticPaymentOutputDescriptor_set_channel_keys_id(this.ptr, val);
+ }
+
+ public long get_channel_value_satoshis() {
+ long ret = bindings.StaticPaymentOutputDescriptor_get_channel_value_satoshis(this.ptr);
+ return ret;
+ }
+
+ public void set_channel_value_satoshis(long val) {
+ bindings.StaticPaymentOutputDescriptor_set_channel_value_satoshis(this.ptr, val);
+ }
+
+ public static StaticPaymentOutputDescriptor constructor_new(OutPoint outpoint_arg, TxOut output_arg, byte[] channel_keys_id_arg, long channel_value_satoshis_arg) {
+ long ret = bindings.StaticPaymentOutputDescriptor_new(outpoint_arg == null ? 0 : outpoint_arg.ptr & ~1, output_arg.ptr, channel_keys_id_arg, channel_value_satoshis_arg);
+ StaticPaymentOutputDescriptor ret_hu_conv = new StaticPaymentOutputDescriptor(null, ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ ret_hu_conv.ptrs_to.add(outpoint_arg);
+ return ret_hu_conv;
+ }
+
+ public StaticPaymentOutputDescriptor clone() {
+ long ret = bindings.StaticPaymentOutputDescriptor_clone(this.ptr);
+ StaticPaymentOutputDescriptor ret_hu_conv = new StaticPaymentOutputDescriptor(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
+}
}
public void set_addresses(NetAddress[] val) {
- bindings.UnsignedNodeAnnouncement_set_addresses(this.ptr, Arrays.stream(val).mapToLong(arr_conv_12 -> arr_conv_12.ptr).toArray());
+ bindings.UnsignedNodeAnnouncement_set_addresses(this.ptr, Arrays.stream(val).mapToLong(val_conv_12 -> val_conv_12.ptr).toArray());
/* TODO 2 NetAddress */;
}
}
public static Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ constructor_BlockHashChannelManagerZ_read(byte[] ser, KeysInterface arg_keys_manager, FeeEstimator arg_fee_estimator, Watch arg_chain_monitor, BroadcasterInterface arg_tx_broadcaster, Logger arg_logger, UserConfig arg_default_config, ChannelMonitor[] arg_channel_monitors) {
- long ret = bindings.C2Tuple_BlockHashChannelManagerZ_read(ser, bindings.ChannelManagerReadArgs_new(arg_keys_manager == null ? 0 : arg_keys_manager.ptr, arg_fee_estimator == null ? 0 : arg_fee_estimator.ptr, arg_chain_monitor == null ? 0 : arg_chain_monitor.ptr, arg_tx_broadcaster == null ? 0 : arg_tx_broadcaster.ptr, arg_logger == null ? 0 : arg_logger.ptr, arg_default_config == null ? 0 : arg_default_config.ptr & ~1, Arrays.stream(arg_channel_monitors).mapToLong(arr_conv_16 -> arr_conv_16 == null ? 0 : arr_conv_16.ptr & ~1).toArray()));
+ long ret = bindings.C2Tuple_BlockHashChannelManagerZ_read(ser, bindings.ChannelManagerReadArgs_new(arg_keys_manager == null ? 0 : arg_keys_manager.ptr, arg_fee_estimator == null ? 0 : arg_fee_estimator.ptr, arg_chain_monitor == null ? 0 : arg_chain_monitor.ptr, arg_tx_broadcaster == null ? 0 : arg_tx_broadcaster.ptr, arg_logger == null ? 0 : arg_logger.ptr, arg_default_config == null ? 0 : arg_default_config.ptr & ~1, Arrays.stream(arg_channel_monitors).mapToLong(arg_channel_monitors_conv_16 -> arg_channel_monitors_conv_16 == null ? 0 : arg_channel_monitors_conv_16.ptr & ~1).toArray()));
Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ ret_hu_conv = Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(arg_keys_manager);
ret_hu_conv.ptrs_to.add(arg_fee_estimator);
}
@Override public long[] release_pending_monitor_events() {
MonitorEvent[] ret = arg.release_pending_monitor_events();
- long[] result = Arrays.stream(ret).mapToLong(arr_conv_14 -> arr_conv_14 == null ? 0 : arr_conv_14.ptr & ~1).toArray();
+ long[] result = Arrays.stream(ret).mapToLong(ret_conv_14 -> ret_conv_14.ptr).toArray();
/* TODO 2 MonitorEvent */;
return result;
}
public MonitorEvent[] release_pending_monitor_events() {
long[] ret = bindings.Watch_release_pending_monitor_events(this.ptr);
- MonitorEvent[] arr_conv_14_arr = new MonitorEvent[ret.length];
+ MonitorEvent[] ret_conv_14_arr = new MonitorEvent[ret.length];
for (int o = 0; o < ret.length; o++) {
- long arr_conv_14 = ret[o];
- MonitorEvent arr_conv_14_hu_conv = new MonitorEvent(null, arr_conv_14);
- arr_conv_14_hu_conv.ptrs_to.add(this);
- arr_conv_14_arr[o] = arr_conv_14_hu_conv;
+ long ret_conv_14 = ret[o];
+ MonitorEvent ret_conv_14_hu_conv = MonitorEvent.constr_from_ptr(ret_conv_14);
+ ret_conv_14_hu_conv.ptrs_to.add(this);
+ ret_conv_14_arr[o] = ret_conv_14_hu_conv;
}
- return arr_conv_14_arr;
+ return ret_conv_14_arr;
}
}
#include <stdatomic.h>
#include <stdlib.h>
-#define MALLOC(a, _) malloc(a)
-#define FREE(p) if ((long)(p) > 1024) { free(p); }
-#define DO_ASSERT(a) (void)(a)
-#define CHECK(a)
+#include <assert.h>
+// Always run a, then assert it is true:
+#define DO_ASSERT(a) do { bool _assert_val = (a); assert(_assert_val); } while(0)
+// Assert a is true or do nothing
+#define CHECK(a) DO_ASSERT(a)
+
+// Running a leak check across all the allocations and frees of the JDK is a mess,
+// so instead we implement our own naive leak checker here, relying on the -wrap
+// linker option to wrap malloc/calloc/realloc/free, tracking everyhing allocated
+// and free'd in Rust or C across the generated bindings shared library.
+#include <threads.h>
+#include <execinfo.h>
+#include <unistd.h>
+static mtx_t allocation_mtx;
+
+void __attribute__((constructor)) init_mtx() {
+ DO_ASSERT(mtx_init(&allocation_mtx, mtx_plain) == thrd_success);
+}
+
+#define BT_MAX 128
+typedef struct allocation {
+ struct allocation* next;
+ void* ptr;
+ const char* struct_name;
+ void* bt[BT_MAX];
+ int bt_len;
+ size_t alloc_len;
+} allocation;
+static allocation* allocation_ll = NULL;
+
+void* __real_malloc(size_t len);
+void* __real_calloc(size_t nmemb, size_t len);
+static void new_allocation(void* res, const char* struct_name, size_t len) {
+ allocation* new_alloc = __real_malloc(sizeof(allocation));
+ new_alloc->ptr = res;
+ new_alloc->struct_name = struct_name;
+ new_alloc->bt_len = backtrace(new_alloc->bt, BT_MAX);
+ new_alloc->alloc_len = len;
+ DO_ASSERT(mtx_lock(&allocation_mtx) == thrd_success);
+ new_alloc->next = allocation_ll;
+ allocation_ll = new_alloc;
+ DO_ASSERT(mtx_unlock(&allocation_mtx) == thrd_success);
+}
+static void* MALLOC(size_t len, const char* struct_name) {
+ void* res = __real_malloc(len);
+ new_allocation(res, struct_name, len);
+ return res;
+}
+void __real_free(void* ptr);
+static void alloc_freed(void* ptr) {
+ allocation* p = NULL;
+ DO_ASSERT(mtx_lock(&allocation_mtx) == thrd_success);
+ allocation* it = allocation_ll;
+ while (it->ptr != ptr) {
+ p = it; it = it->next;
+ if (it == NULL) {
+ fprintf(stderr, "Tried to free unknown pointer %p at:\n", ptr);
+ void* bt[BT_MAX];
+ int bt_len = backtrace(bt, BT_MAX);
+ backtrace_symbols_fd(bt, bt_len, STDERR_FILENO);
+ fprintf(stderr, "\n\n");
+ DO_ASSERT(mtx_unlock(&allocation_mtx) == thrd_success);
+ return; // addrsan should catch malloc-unknown and print more info than we have
+ }
+ }
+ if (p) { p->next = it->next; } else { allocation_ll = it->next; }
+ DO_ASSERT(mtx_unlock(&allocation_mtx) == thrd_success);
+ DO_ASSERT(it->ptr == ptr);
+ __real_free(it);
+}
+static void FREE(void* ptr) {
+ if ((long)ptr < 1024) return; // Rust loves to create pointers to the NULL page for dummys
+ alloc_freed(ptr);
+ __real_free(ptr);
+}
+
+void* __wrap_malloc(size_t len) {
+ void* res = __real_malloc(len);
+ new_allocation(res, "malloc call", len);
+ return res;
+}
+void* __wrap_calloc(size_t nmemb, size_t len) {
+ void* res = __real_calloc(nmemb, len);
+ new_allocation(res, "calloc call", len);
+ return res;
+}
+void __wrap_free(void* ptr) {
+ if (ptr == NULL) return;
+ alloc_freed(ptr);
+ __real_free(ptr);
+}
+
+void* __real_realloc(void* ptr, size_t newlen);
+void* __wrap_realloc(void* ptr, size_t len) {
+ if (ptr != NULL) alloc_freed(ptr);
+ void* res = __real_realloc(ptr, len);
+ new_allocation(res, "realloc call", len);
+ return res;
+}
+void __wrap_reallocarray(void* ptr, size_t new_sz) {
+ // Rust doesn't seem to use reallocarray currently
+ DO_ASSERT(false);
+}
+
+void __attribute__((destructor)) check_leaks() {
+ size_t alloc_count = 0;
+ size_t alloc_size = 0;
+ for (allocation* a = allocation_ll; a != NULL; a = a->next) {
+ fprintf(stderr, "%s %p (%lu bytes) remains:\n", a->struct_name, a->ptr, a->alloc_len);
+ backtrace_symbols_fd(a->bt, a->bt_len, STDERR_FILENO);
+ fprintf(stderr, "\n\n");
+ alloc_count++;
+ alloc_size += a->alloc_len;
+ }
+ fprintf(stderr, "%lu allocations remained for %lu bytes.\n", alloc_count, alloc_size);
+ DO_ASSERT(allocation_ll == NULL);
+}
static jmethodID ordinal_meth = NULL;
static jmethodID slicedef_meth = NULL;
case 4: return LDKSecp256k1Error_InvalidSecretKey;
case 5: return LDKSecp256k1Error_InvalidRecoveryId;
case 6: return LDKSecp256k1Error_InvalidTweak;
- case 7: return LDKSecp256k1Error_NotEnoughMemory;
- case 8: return LDKSecp256k1Error_CallbackPanicked;
+ case 7: return LDKSecp256k1Error_TweakCheckFailed;
+ case 8: return LDKSecp256k1Error_NotEnoughMemory;
}
abort();
}
static jfieldID LDKSecp256k1Error_LDKSecp256k1Error_InvalidSecretKey = NULL;
static jfieldID LDKSecp256k1Error_LDKSecp256k1Error_InvalidRecoveryId = NULL;
static jfieldID LDKSecp256k1Error_LDKSecp256k1Error_InvalidTweak = NULL;
+static jfieldID LDKSecp256k1Error_LDKSecp256k1Error_TweakCheckFailed = NULL;
static jfieldID LDKSecp256k1Error_LDKSecp256k1Error_NotEnoughMemory = NULL;
-static jfieldID LDKSecp256k1Error_LDKSecp256k1Error_CallbackPanicked = NULL;
JNIEXPORT void JNICALL Java_org_ldk_enums_LDKSecp256k1Error_init (JNIEnv *env, jclass clz) {
LDKSecp256k1Error_class = (*env)->NewGlobalRef(env, clz);
CHECK(LDKSecp256k1Error_class != NULL);
CHECK(LDKSecp256k1Error_LDKSecp256k1Error_InvalidRecoveryId != NULL);
LDKSecp256k1Error_LDKSecp256k1Error_InvalidTweak = (*env)->GetStaticFieldID(env, LDKSecp256k1Error_class, "LDKSecp256k1Error_InvalidTweak", "Lorg/ldk/enums/LDKSecp256k1Error;");
CHECK(LDKSecp256k1Error_LDKSecp256k1Error_InvalidTweak != NULL);
+ LDKSecp256k1Error_LDKSecp256k1Error_TweakCheckFailed = (*env)->GetStaticFieldID(env, LDKSecp256k1Error_class, "LDKSecp256k1Error_TweakCheckFailed", "Lorg/ldk/enums/LDKSecp256k1Error;");
+ CHECK(LDKSecp256k1Error_LDKSecp256k1Error_TweakCheckFailed != NULL);
LDKSecp256k1Error_LDKSecp256k1Error_NotEnoughMemory = (*env)->GetStaticFieldID(env, LDKSecp256k1Error_class, "LDKSecp256k1Error_NotEnoughMemory", "Lorg/ldk/enums/LDKSecp256k1Error;");
CHECK(LDKSecp256k1Error_LDKSecp256k1Error_NotEnoughMemory != NULL);
- LDKSecp256k1Error_LDKSecp256k1Error_CallbackPanicked = (*env)->GetStaticFieldID(env, LDKSecp256k1Error_class, "LDKSecp256k1Error_CallbackPanicked", "Lorg/ldk/enums/LDKSecp256k1Error;");
- CHECK(LDKSecp256k1Error_LDKSecp256k1Error_CallbackPanicked != NULL);
}
static inline jclass LDKSecp256k1Error_to_java(JNIEnv *env, LDKSecp256k1Error val) {
switch (val) {
return (*env)->GetStaticObjectField(env, LDKSecp256k1Error_class, LDKSecp256k1Error_LDKSecp256k1Error_InvalidRecoveryId);
case LDKSecp256k1Error_InvalidTweak:
return (*env)->GetStaticObjectField(env, LDKSecp256k1Error_class, LDKSecp256k1Error_LDKSecp256k1Error_InvalidTweak);
+ case LDKSecp256k1Error_TweakCheckFailed:
+ return (*env)->GetStaticObjectField(env, LDKSecp256k1Error_class, LDKSecp256k1Error_LDKSecp256k1Error_TweakCheckFailed);
case LDKSecp256k1Error_NotEnoughMemory:
return (*env)->GetStaticObjectField(env, LDKSecp256k1Error_class, LDKSecp256k1Error_LDKSecp256k1Error_NotEnoughMemory);
- case LDKSecp256k1Error_CallbackPanicked:
- return (*env)->GetStaticObjectField(env, LDKSecp256k1Error_class, LDKSecp256k1Error_LDKSecp256k1Error_CallbackPanicked);
default: abort();
}
}
jobjectArray res_arr = (*env)->NewObjectArray(env, res_var.datalen, arr_of_B_clz, NULL);
;
for (size_t i = 0; i < res_var.datalen; i++) {
- int8_tArray arr_conv_8_arr = (*env)->NewByteArray(env, 64);
- (*env)->SetByteArrayRegion(env, arr_conv_8_arr, 0, 64, res_var.data[i].compact_form);
- (*env)->SetObjectArrayElement(env, res_arr, i, arr_conv_8_arr);
+ int8_tArray res_conv_8_arr = (*env)->NewByteArray(env, 64);
+ (*env)->SetByteArrayRegion(env, res_conv_8_arr, 0, 64, res_var.data[i].compact_form);
+ (*env)->SetObjectArrayElement(env, res_arr, i, res_conv_8_arr);
}
return res_arr;
}
jclass err_conv = LDKChannelMonitorUpdateErr_to_java(env, (*val->contents.err));
return err_conv;
}
+static jclass LDKMonitorEvent_HTLCEvent_class = NULL;
+static jmethodID LDKMonitorEvent_HTLCEvent_meth = NULL;
+static jclass LDKMonitorEvent_CommitmentTxBroadcasted_class = NULL;
+static jmethodID LDKMonitorEvent_CommitmentTxBroadcasted_meth = NULL;
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMonitorEvent_init (JNIEnv *env, jclass clz) {
+ LDKMonitorEvent_HTLCEvent_class =
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMonitorEvent$HTLCEvent;"));
+ CHECK(LDKMonitorEvent_HTLCEvent_class != NULL);
+ LDKMonitorEvent_HTLCEvent_meth = (*env)->GetMethodID(env, LDKMonitorEvent_HTLCEvent_class, "<init>", "()V");
+ CHECK(LDKMonitorEvent_HTLCEvent_meth != NULL);
+ LDKMonitorEvent_CommitmentTxBroadcasted_class =
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMonitorEvent$CommitmentTxBroadcasted;"));
+ CHECK(LDKMonitorEvent_CommitmentTxBroadcasted_class != NULL);
+ LDKMonitorEvent_CommitmentTxBroadcasted_meth = (*env)->GetMethodID(env, LDKMonitorEvent_CommitmentTxBroadcasted_class, "<init>", "()V");
+ CHECK(LDKMonitorEvent_CommitmentTxBroadcasted_meth != NULL);
+}
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMonitorEvent_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
+ LDKMonitorEvent *obj = (LDKMonitorEvent*)ptr;
+ switch(obj->tag) {
+ case LDKMonitorEvent_HTLCEvent: {
+ return (*env)->NewObject(env, LDKMonitorEvent_HTLCEvent_class, LDKMonitorEvent_HTLCEvent_meth);
+ }
+ case LDKMonitorEvent_CommitmentTxBroadcasted: {
+ return (*env)->NewObject(env, LDKMonitorEvent_CommitmentTxBroadcasted_class, LDKMonitorEvent_CommitmentTxBroadcasted_meth);
+ }
+ default: abort();
+ }
+}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1MonitorEventZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
LDKCVec_MonitorEventZ *ret = MALLOC(sizeof(LDKCVec_MonitorEventZ), "LDKCVec_MonitorEventZ");
ret->datalen = (*env)->GetArrayLength(env, elems);
int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
for (size_t i = 0; i < ret->datalen; i++) {
int64_t arr_elem = java_elems[i];
- LDKMonitorEvent arr_elem_conv;
- arr_elem_conv.inner = (void*)(arr_elem & (~1));
- arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0);
- arr_elem_conv = MonitorEvent_clone(&arr_elem_conv);
+ LDKMonitorEvent arr_elem_conv = *(LDKMonitorEvent*)(((uint64_t)arr_elem) & ~1);
+ FREE((void*)arr_elem);
ret->data[i] = arr_elem_conv;
}
(*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
}
return ret;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1u64u64Z_1new(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
- LDKC2Tuple_u64u64Z* ret = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
- ret->a = a;
- ret->b = b;
- return (long)ret;
-}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1u64u64Z_1get_1a(JNIEnv *env, jclass clz, int64_t ptr) {
- LDKC2Tuple_u64u64Z *tuple = (LDKC2Tuple_u64u64Z*)(ptr & ~1);
- return tuple->a;
-}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1u64u64Z_1get_1b(JNIEnv *env, jclass clz, int64_t ptr) {
- LDKC2Tuple_u64u64Z *tuple = (LDKC2Tuple_u64u64Z*)(ptr & ~1);
- return tuple->b;
-}
static jclass LDKSpendableOutputDescriptor_StaticOutput_class = NULL;
static jmethodID LDKSpendableOutputDescriptor_StaticOutput_meth = NULL;
-static jclass LDKSpendableOutputDescriptor_DynamicOutputP2WSH_class = NULL;
-static jmethodID LDKSpendableOutputDescriptor_DynamicOutputP2WSH_meth = NULL;
-static jclass LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_class = NULL;
-static jmethodID LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_meth = NULL;
+static jclass LDKSpendableOutputDescriptor_DelayedPaymentOutput_class = NULL;
+static jmethodID LDKSpendableOutputDescriptor_DelayedPaymentOutput_meth = NULL;
+static jclass LDKSpendableOutputDescriptor_StaticPaymentOutput_class = NULL;
+static jmethodID LDKSpendableOutputDescriptor_StaticPaymentOutput_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKSpendableOutputDescriptor_init (JNIEnv *env, jclass clz) {
LDKSpendableOutputDescriptor_StaticOutput_class =
(*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKSpendableOutputDescriptor$StaticOutput;"));
CHECK(LDKSpendableOutputDescriptor_StaticOutput_class != NULL);
LDKSpendableOutputDescriptor_StaticOutput_meth = (*env)->GetMethodID(env, LDKSpendableOutputDescriptor_StaticOutput_class, "<init>", "(JJ)V");
CHECK(LDKSpendableOutputDescriptor_StaticOutput_meth != NULL);
- LDKSpendableOutputDescriptor_DynamicOutputP2WSH_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKSpendableOutputDescriptor$DynamicOutputP2WSH;"));
- CHECK(LDKSpendableOutputDescriptor_DynamicOutputP2WSH_class != NULL);
- LDKSpendableOutputDescriptor_DynamicOutputP2WSH_meth = (*env)->GetMethodID(env, LDKSpendableOutputDescriptor_DynamicOutputP2WSH_class, "<init>", "(J[BSJJ[B)V");
- CHECK(LDKSpendableOutputDescriptor_DynamicOutputP2WSH_meth != NULL);
- LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKSpendableOutputDescriptor$StaticOutputCounterpartyPayment;"));
- CHECK(LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_class != NULL);
- LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_meth = (*env)->GetMethodID(env, LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_class, "<init>", "(JJJ)V");
- CHECK(LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_meth != NULL);
+ LDKSpendableOutputDescriptor_DelayedPaymentOutput_class =
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKSpendableOutputDescriptor$DelayedPaymentOutput;"));
+ CHECK(LDKSpendableOutputDescriptor_DelayedPaymentOutput_class != NULL);
+ LDKSpendableOutputDescriptor_DelayedPaymentOutput_meth = (*env)->GetMethodID(env, LDKSpendableOutputDescriptor_DelayedPaymentOutput_class, "<init>", "()V");
+ CHECK(LDKSpendableOutputDescriptor_DelayedPaymentOutput_meth != NULL);
+ LDKSpendableOutputDescriptor_StaticPaymentOutput_class =
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKSpendableOutputDescriptor$StaticPaymentOutput;"));
+ CHECK(LDKSpendableOutputDescriptor_StaticPaymentOutput_class != NULL);
+ LDKSpendableOutputDescriptor_StaticPaymentOutput_meth = (*env)->GetMethodID(env, LDKSpendableOutputDescriptor_StaticPaymentOutput_class, "<init>", "()V");
+ CHECK(LDKSpendableOutputDescriptor_StaticPaymentOutput_meth != NULL);
}
JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSpendableOutputDescriptor_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
LDKSpendableOutputDescriptor *obj = (LDKSpendableOutputDescriptor*)ptr;
long output_ref = ((long)&obj->static_output.output) | 1;
return (*env)->NewObject(env, LDKSpendableOutputDescriptor_StaticOutput_class, LDKSpendableOutputDescriptor_StaticOutput_meth, outpoint_ref, (long)output_ref);
}
- case LDKSpendableOutputDescriptor_DynamicOutputP2WSH: {
- LDKOutPoint outpoint_var = obj->dynamic_output_p2wsh.outpoint;
- CHECK((((long)outpoint_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
- CHECK((((long)&outpoint_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- long outpoint_ref = (long)outpoint_var.inner & ~1;
- int8_tArray per_commitment_point_arr = (*env)->NewByteArray(env, 33);
- (*env)->SetByteArrayRegion(env, per_commitment_point_arr, 0, 33, obj->dynamic_output_p2wsh.per_commitment_point.compressed_form);
- long output_ref = ((long)&obj->dynamic_output_p2wsh.output) | 1;
- long key_derivation_params_ref = (long)(&obj->dynamic_output_p2wsh.key_derivation_params) | 1;
- int8_tArray revocation_pubkey_arr = (*env)->NewByteArray(env, 33);
- (*env)->SetByteArrayRegion(env, revocation_pubkey_arr, 0, 33, obj->dynamic_output_p2wsh.revocation_pubkey.compressed_form);
- return (*env)->NewObject(env, LDKSpendableOutputDescriptor_DynamicOutputP2WSH_class, LDKSpendableOutputDescriptor_DynamicOutputP2WSH_meth, outpoint_ref, per_commitment_point_arr, obj->dynamic_output_p2wsh.to_self_delay, (long)output_ref, key_derivation_params_ref, revocation_pubkey_arr);
+ case LDKSpendableOutputDescriptor_DelayedPaymentOutput: {
+ return (*env)->NewObject(env, LDKSpendableOutputDescriptor_DelayedPaymentOutput_class, LDKSpendableOutputDescriptor_DelayedPaymentOutput_meth);
}
- case LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment: {
- LDKOutPoint outpoint_var = obj->static_output_counterparty_payment.outpoint;
- CHECK((((long)outpoint_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
- CHECK((((long)&outpoint_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- long outpoint_ref = (long)outpoint_var.inner & ~1;
- long output_ref = ((long)&obj->static_output_counterparty_payment.output) | 1;
- long key_derivation_params_ref = (long)(&obj->static_output_counterparty_payment.key_derivation_params) | 1;
- return (*env)->NewObject(env, LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_class, LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_meth, outpoint_ref, (long)output_ref, key_derivation_params_ref);
+ case LDKSpendableOutputDescriptor_StaticPaymentOutput: {
+ return (*env)->NewObject(env, LDKSpendableOutputDescriptor_StaticPaymentOutput_class, LDKSpendableOutputDescriptor_StaticPaymentOutput_meth);
}
default: abort();
}
int64_tArray outputs_arr = (*env)->NewLongArray(env, outputs_var.datalen);
int64_t *outputs_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, outputs_arr, NULL);
for (size_t b = 0; b < outputs_var.datalen; b++) {
- long arr_conv_27_ref = ((long)&outputs_var.data[b]) | 1;
- outputs_arr_ptr[b] = arr_conv_27_ref;
+ long outputs_conv_27_ref = ((long)&outputs_var.data[b]) | 1;
+ outputs_arr_ptr[b] = outputs_conv_27_ref;
}
(*env)->ReleasePrimitiveArrayCritical(env, outputs_arr, outputs_arr_ptr, 0);
return (*env)->NewObject(env, LDKEvent_SpendableOutputs_class, LDKEvent_SpendableOutputs_meth, outputs_arr);
b_constr.data = NULL;
int64_t* b_vals = (*env)->GetLongArrayElements (env, b, NULL);
for (size_t a = 0; a < b_constr.datalen; a++) {
- int64_t arr_conv_26 = b_vals[a];
- LDKC2Tuple_u32TxOutZ arr_conv_26_conv = *(LDKC2Tuple_u32TxOutZ*)(((uint64_t)arr_conv_26) & ~1);
- FREE((void*)arr_conv_26);
- b_constr.data[a] = arr_conv_26_conv;
+ int64_t b_conv_26 = b_vals[a];
+ LDKC2Tuple_u32TxOutZ b_conv_26_conv = *(LDKC2Tuple_u32TxOutZ*)(((uint64_t)b_conv_26) & ~1);
+ FREE((void*)b_conv_26);
+ b_constr.data[a] = b_conv_26_conv;
}
(*env)->ReleaseLongArrayElements(env, b, b_vals, 0);
ret->b = b_constr;
int64_tArray b_arr = (*env)->NewLongArray(env, b_var.datalen);
int64_t *b_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, b_arr, NULL);
for (size_t a = 0; a < b_var.datalen; a++) {
- long arr_conv_26_ref = (long)(&b_var.data[a]) | 1;
- b_arr_ptr[a] = arr_conv_26_ref;
+ long b_conv_26_ref = (long)(&b_var.data[a]) | 1;
+ b_arr_ptr[a] = b_conv_26_ref;
}
(*env)->ReleasePrimitiveArrayCritical(env, b_arr, b_arr_ptr, 0);
return b_arr;
else
b_constr.data = NULL;
for (size_t i = 0; i < b_constr.datalen; i++) {
- int8_tArray arr_conv_8 = (*env)->GetObjectArrayElement(env, b, i);
- LDKSignature arr_conv_8_ref;
- CHECK((*env)->GetArrayLength(env, arr_conv_8) == 64);
- (*env)->GetByteArrayRegion(env, arr_conv_8, 0, 64, arr_conv_8_ref.compact_form);
- b_constr.data[i] = arr_conv_8_ref;
+ int8_tArray b_conv_8 = (*env)->GetObjectArrayElement(env, b, i);
+ LDKSignature b_conv_8_ref;
+ CHECK((*env)->GetArrayLength(env, b_conv_8) == 64);
+ (*env)->GetByteArrayRegion(env, b_conv_8, 0, 64, b_conv_8_ref.compact_form);
+ b_constr.data[i] = b_conv_8_ref;
}
ret->b = b_constr;
return (long)ret;
jobjectArray b_arr = (*env)->NewObjectArray(env, b_var.datalen, arr_of_B_clz, NULL);
;
for (size_t i = 0; i < b_var.datalen; i++) {
- int8_tArray arr_conv_8_arr = (*env)->NewByteArray(env, 64);
- (*env)->SetByteArrayRegion(env, arr_conv_8_arr, 0, 64, b_var.data[i].compact_form);
- (*env)->SetObjectArrayElement(env, b_arr, i, arr_conv_8_arr);
+ int8_tArray b_conv_8_arr = (*env)->NewByteArray(env, 64);
+ (*env)->SetByteArrayRegion(env, b_conv_8_arr, 0, 64, b_var.data[i].compact_form);
+ (*env)->SetObjectArrayElement(env, b_arr, i, b_conv_8_arr);
}
return b_arr;
}
CHECK(!val->result_ok);
return *val->contents.err;
}
-typedef struct LDKChannelKeys_JCalls {
+typedef struct LDKSign_JCalls {
atomic_size_t refcnt;
JavaVM *vm;
jweak o;
jmethodID get_per_commitment_point_meth;
jmethodID release_commitment_secret_meth;
- jmethodID key_derivation_params_meth;
+ jmethodID channel_keys_id_meth;
jmethodID sign_counterparty_commitment_meth;
jmethodID sign_holder_commitment_and_htlcs_meth;
jmethodID sign_justice_transaction_meth;
jmethodID sign_channel_announcement_meth;
jmethodID ready_channel_meth;
jmethodID write_meth;
-} LDKChannelKeys_JCalls;
-static void LDKChannelKeys_JCalls_free(void* this_arg) {
- LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
+} LDKSign_JCalls;
+static void LDKSign_JCalls_free(void* this_arg) {
+ LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
JNIEnv *env;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
}
}
LDKPublicKey get_per_commitment_point_jcall(const void* this_arg, uint64_t idx) {
- LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) 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);
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
- int8_tArray arg = (*env)->CallObjectMethod(env, obj, j_calls->get_per_commitment_point_meth, idx);
- LDKPublicKey arg_ref;
- CHECK((*env)->GetArrayLength(env, arg) == 33);
- (*env)->GetByteArrayRegion(env, arg, 0, 33, arg_ref.compressed_form);
- return arg_ref;
+ int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_per_commitment_point_meth, idx);
+ LDKPublicKey ret_ref;
+ CHECK((*env)->GetArrayLength(env, ret) == 33);
+ (*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) {
- LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) 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);
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
- int8_tArray arg = (*env)->CallObjectMethod(env, obj, j_calls->release_commitment_secret_meth, idx);
- LDKThirtyTwoBytes arg_ref;
- CHECK((*env)->GetArrayLength(env, arg) == 32);
- (*env)->GetByteArrayRegion(env, arg, 0, 32, arg_ref.data);
- return arg_ref;
-}
-LDKC2Tuple_u64u64Z key_derivation_params_jcall(const void* this_arg) {
- LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
+ int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->release_commitment_secret_meth, idx);
+ LDKThirtyTwoBytes ret_ref;
+ CHECK((*env)->GetArrayLength(env, ret) == 32);
+ (*env)->GetByteArrayRegion(env, ret, 0, 32, ret_ref.data);
+ return ret_ref;
+}
+LDKThirtyTwoBytes channel_keys_id_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);
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
- LDKC2Tuple_u64u64Z* ret = (LDKC2Tuple_u64u64Z*)(*env)->CallLongMethod(env, obj, j_calls->key_derivation_params_meth);
- LDKC2Tuple_u64u64Z ret_conv = *(LDKC2Tuple_u64u64Z*)(((uint64_t)ret) & ~1);
- ret_conv = C2Tuple_u64u64Z_clone((LDKC2Tuple_u64u64Z*)ret);
- return ret_conv;
+ int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->channel_keys_id_meth);
+ LDKThirtyTwoBytes ret_ref;
+ CHECK((*env)->GetArrayLength(env, ret) == 32);
+ (*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) {
- LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) 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);
LDKCommitmentTransaction commitment_tx_var = *commitment_tx;
return ret_conv;
}
LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htlcs_jcall(const void* this_arg, const LDKHolderCommitmentTransaction * commitment_tx) {
- LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) 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);
LDKHolderCommitmentTransaction commitment_tx_var = *commitment_tx;
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) {
- LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) 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);
LDKTransaction justice_tx_var = justice_tx;
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) {
- LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) 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);
LDKTransaction htlc_tx_var = htlc_tx;
return ret_conv;
}
LDKCResult_SignatureNoneZ sign_closing_transaction_jcall(const void* this_arg, LDKTransaction closing_tx) {
- LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) 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);
LDKTransaction closing_tx_var = closing_tx;
return ret_conv;
}
LDKCResult_SignatureNoneZ sign_channel_announcement_jcall(const void* this_arg, const LDKUnsignedChannelAnnouncement * msg) {
- LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) 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);
LDKUnsignedChannelAnnouncement msg_var = *msg;
return ret_conv;
}
void ready_channel_jcall(void* this_arg, const LDKChannelTransactionParameters * channel_parameters) {
- LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) 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);
LDKChannelTransactionParameters channel_parameters_var = *channel_parameters;
return (*env)->CallVoidMethod(env, obj, j_calls->ready_channel_meth, channel_parameters_ref);
}
LDKCVec_u8Z write_jcall(const void* this_arg) {
- LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) 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);
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
- int8_tArray arg = (*env)->CallObjectMethod(env, obj, j_calls->write_meth);
- LDKCVec_u8Z arg_ref;
- arg_ref.datalen = (*env)->GetArrayLength(env, arg);
- arg_ref.data = MALLOC(arg_ref.datalen, "LDKCVec_u8Z Bytes");
- (*env)->GetByteArrayRegion(env, arg, 0, arg_ref.datalen, arg_ref.data);
- return arg_ref;
-}
-static void* LDKChannelKeys_JCalls_clone(const void* this_arg) {
- LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
+ int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->write_meth);
+ LDKCVec_u8Z ret_ref;
+ ret_ref.datalen = (*env)->GetArrayLength(env, ret);
+ ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
+ (*env)->GetByteArrayRegion(env, ret, 0, ret_ref.datalen, ret_ref.data);
+ return ret_ref;
+}
+static void* LDKSign_JCalls_clone(const void* this_arg) {
+ LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
return (void*) this_arg;
}
-static inline LDKChannelKeys LDKChannelKeys_init (JNIEnv *env, jclass clz, jobject o, int64_t pubkeys) {
+static inline LDKSign LDKSign_init (JNIEnv *env, jclass clz, jobject o, int64_t pubkeys) {
jclass c = (*env)->GetObjectClass(env, o);
CHECK(c != NULL);
- LDKChannelKeys_JCalls *calls = MALLOC(sizeof(LDKChannelKeys_JCalls), "LDKChannelKeys_JCalls");
+ LDKSign_JCalls *calls = MALLOC(sizeof(LDKSign_JCalls), "LDKSign_JCalls");
atomic_init(&calls->refcnt, 1);
DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
calls->o = (*env)->NewWeakGlobalRef(env, o);
CHECK(calls->get_per_commitment_point_meth != NULL);
calls->release_commitment_secret_meth = (*env)->GetMethodID(env, c, "release_commitment_secret", "(J)[B");
CHECK(calls->release_commitment_secret_meth != NULL);
- calls->key_derivation_params_meth = (*env)->GetMethodID(env, c, "key_derivation_params", "()J");
- CHECK(calls->key_derivation_params_meth != NULL);
+ calls->channel_keys_id_meth = (*env)->GetMethodID(env, c, "channel_keys_id", "()[B");
+ CHECK(calls->channel_keys_id_meth != NULL);
calls->sign_counterparty_commitment_meth = (*env)->GetMethodID(env, c, "sign_counterparty_commitment", "(J)J");
CHECK(calls->sign_counterparty_commitment_meth != NULL);
calls->sign_holder_commitment_and_htlcs_meth = (*env)->GetMethodID(env, c, "sign_holder_commitment_and_htlcs", "(J)J");
pubkeys_conv.is_owned = (pubkeys & 1) || (pubkeys == 0);
pubkeys_conv = ChannelPublicKeys_clone(&pubkeys_conv);
- LDKChannelKeys ret = {
+ LDKSign ret = {
.this_arg = (void*) calls,
.get_per_commitment_point = get_per_commitment_point_jcall,
.release_commitment_secret = release_commitment_secret_jcall,
- .key_derivation_params = key_derivation_params_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_closing_transaction = sign_closing_transaction_jcall,
.sign_channel_announcement = sign_channel_announcement_jcall,
.ready_channel = ready_channel_jcall,
- .clone = LDKChannelKeys_JCalls_clone,
+ .clone = LDKSign_JCalls_clone,
.write = write_jcall,
- .free = LDKChannelKeys_JCalls_free,
+ .free = LDKSign_JCalls_free,
.pubkeys = pubkeys_conv,
.set_pubkeys = NULL,
};
return ret;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1new(JNIEnv *env, jclass clz, jobject o, int64_t pubkeys) {
- LDKChannelKeys *res_ptr = MALLOC(sizeof(LDKChannelKeys), "LDKChannelKeys");
- *res_ptr = LDKChannelKeys_init(env, clz, o, pubkeys);
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKSign_1new(JNIEnv *env, jclass clz, jobject o, int64_t pubkeys) {
+ LDKSign *res_ptr = MALLOC(sizeof(LDKSign), "LDKSign");
+ *res_ptr = LDKSign_init(env, clz, o, pubkeys);
return (long)res_ptr;
}
-JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1get_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_arg, int64_t idx) {
- LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 33);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 33, (this_arg_conv->get_per_commitment_point)(this_arg_conv->this_arg, idx).compressed_form);
- return arg_arr;
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Sign_1get_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_arg, int64_t idx) {
+ LDKSign* this_arg_conv = (LDKSign*)this_arg;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, (this_arg_conv->get_per_commitment_point)(this_arg_conv->this_arg, idx).compressed_form);
+ return ret_arr;
}
-JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1release_1commitment_1secret(JNIEnv *env, jclass clz, int64_t this_arg, int64_t idx) {
- LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 32);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 32, (this_arg_conv->release_commitment_secret)(this_arg_conv->this_arg, idx).data);
- return arg_arr;
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Sign_1release_1commitment_1secret(JNIEnv *env, jclass clz, int64_t this_arg, int64_t idx) {
+ LDKSign* this_arg_conv = (LDKSign*)this_arg;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, (this_arg_conv->release_commitment_secret)(this_arg_conv->this_arg, idx).data);
+ return ret_arr;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1key_1derivation_1params(JNIEnv *env, jclass clz, int64_t this_arg) {
- LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg;
- LDKC2Tuple_u64u64Z* ret_ref = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
- *ret_ref = (this_arg_conv->key_derivation_params)(this_arg_conv->this_arg);
- return (long)ret_ref;
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Sign_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_arg) {
+ LDKSign* this_arg_conv = (LDKSign*)this_arg;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, (this_arg_conv->channel_keys_id)(this_arg_conv->this_arg).data);
+ return ret_arr;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1sign_1counterparty_1commitment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t commitment_tx) {
- LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg;
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sign_1sign_1counterparty_1commitment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t commitment_tx) {
+ LDKSign* this_arg_conv = (LDKSign*)this_arg;
LDKCommitmentTransaction commitment_tx_conv;
commitment_tx_conv.inner = (void*)(commitment_tx & (~1));
commitment_tx_conv.is_owned = false;
return (long)ret_conv;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1sign_1holder_1commitment_1and_1htlcs(JNIEnv *env, jclass clz, int64_t this_arg, int64_t commitment_tx) {
- LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg;
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sign_1sign_1holder_1commitment_1and_1htlcs(JNIEnv *env, jclass clz, int64_t this_arg, int64_t commitment_tx) {
+ LDKSign* this_arg_conv = (LDKSign*)this_arg;
LDKHolderCommitmentTransaction commitment_tx_conv;
commitment_tx_conv.inner = (void*)(commitment_tx & (~1));
commitment_tx_conv.is_owned = false;
return (long)ret_conv;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1sign_1justice_1transaction(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray justice_tx, int64_t input, int64_t amount, int8_tArray per_commitment_key, int64_t htlc) {
- LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg;
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sign_1sign_1justice_1transaction(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray justice_tx, int64_t input, int64_t amount, int8_tArray per_commitment_key, int64_t htlc) {
+ LDKSign* this_arg_conv = (LDKSign*)this_arg;
LDKTransaction justice_tx_ref;
justice_tx_ref.datalen = (*env)->GetArrayLength(env, justice_tx);
justice_tx_ref.data = MALLOC(justice_tx_ref.datalen, "LDKTransaction Bytes");
return (long)ret_conv;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1sign_1counterparty_1htlc_1transaction(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray htlc_tx, int64_t input, int64_t amount, int8_tArray per_commitment_point, int64_t htlc) {
- LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg;
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sign_1sign_1counterparty_1htlc_1transaction(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray htlc_tx, int64_t input, int64_t amount, int8_tArray per_commitment_point, int64_t htlc) {
+ LDKSign* this_arg_conv = (LDKSign*)this_arg;
LDKTransaction htlc_tx_ref;
htlc_tx_ref.datalen = (*env)->GetArrayLength(env, htlc_tx);
htlc_tx_ref.data = MALLOC(htlc_tx_ref.datalen, "LDKTransaction Bytes");
return (long)ret_conv;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1sign_1closing_1transaction(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray closing_tx) {
- LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg;
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sign_1sign_1closing_1transaction(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray closing_tx) {
+ LDKSign* this_arg_conv = (LDKSign*)this_arg;
LDKTransaction closing_tx_ref;
closing_tx_ref.datalen = (*env)->GetArrayLength(env, closing_tx);
closing_tx_ref.data = MALLOC(closing_tx_ref.datalen, "LDKTransaction Bytes");
return (long)ret_conv;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1sign_1channel_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) {
- LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg;
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sign_1sign_1channel_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) {
+ LDKSign* this_arg_conv = (LDKSign*)this_arg;
LDKUnsignedChannelAnnouncement msg_conv;
msg_conv.inner = (void*)(msg & (~1));
msg_conv.is_owned = false;
return (long)ret_conv;
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1ready_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_parameters) {
- LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg;
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Sign_1ready_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_parameters) {
+ LDKSign* this_arg_conv = (LDKSign*)this_arg;
LDKChannelTransactionParameters channel_parameters_conv;
channel_parameters_conv.inner = (void*)(channel_parameters & (~1));
channel_parameters_conv.is_owned = false;
(this_arg_conv->ready_channel)(this_arg_conv->this_arg, &channel_parameters_conv);
}
-JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1write(JNIEnv *env, jclass clz, int64_t this_arg) {
- LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg;
- LDKCVec_u8Z arg_var = (this_arg_conv->write)(this_arg_conv->this_arg);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Sign_1write(JNIEnv *env, jclass clz, int64_t this_arg) {
+ LDKSign* this_arg_conv = (LDKSign*)this_arg;
+ LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
-LDKChannelPublicKeys LDKChannelKeys_set_get_pubkeys(LDKChannelKeys* this_arg) {
+LDKChannelPublicKeys LDKSign_set_get_pubkeys(LDKSign* this_arg) {
if (this_arg->set_pubkeys != NULL)
this_arg->set_pubkeys(this_arg);
return this_arg->pubkeys;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1get_1pubkeys(JNIEnv *env, jclass clz, int64_t this_arg) {
- LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg;
- LDKChannelPublicKeys ret_var = LDKChannelKeys_set_get_pubkeys(this_arg_conv);
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sign_1get_1pubkeys(JNIEnv *env, jclass clz, int64_t this_arg) {
+ LDKSign* this_arg_conv = (LDKSign*)this_arg;
+ LDKChannelPublicKeys ret_var = LDKSign_set_get_pubkeys(this_arg_conv);
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;
long err_ref = ((long)&(*val->contents.err)) | 1;
return err_ref;
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1CResult_1NoneAPIErrorZZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
+ LDKCVec_CResult_NoneAPIErrorZZ *ret = MALLOC(sizeof(LDKCVec_CResult_NoneAPIErrorZZ), "LDKCVec_CResult_NoneAPIErrorZZ");
+ ret->datalen = (*env)->GetArrayLength(env, elems);
+ if (ret->datalen == 0) {
+ ret->data = NULL;
+ } else {
+ ret->data = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ) * ret->datalen, "LDKCVec_CResult_NoneAPIErrorZZ Data");
+ int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
+ for (size_t i = 0; i < ret->datalen; i++) {
+ int64_t arr_elem = java_elems[i];
+ LDKCResult_NoneAPIErrorZ arr_elem_conv = *(LDKCResult_NoneAPIErrorZ*)(((uint64_t)arr_elem) & ~1);
+ FREE((void*)arr_elem);
+ ret->data[i] = arr_elem_conv;
+ }
+ (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
+ }
+ return (long)ret;
+}
+static inline LDKCVec_CResult_NoneAPIErrorZZ CVec_CResult_NoneAPIErrorZZ_clone(const LDKCVec_CResult_NoneAPIErrorZZ *orig) {
+ LDKCVec_CResult_NoneAPIErrorZZ ret = { .data = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ) * orig->datalen, "LDKCVec_CResult_NoneAPIErrorZZ clone bytes"), .datalen = orig->datalen };
+ for (size_t i = 0; i < ret.datalen; i++) {
+ ret.data[i] = CResult_NoneAPIErrorZ_clone(&orig->data[i]);
+ }
+ return ret;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1APIErrorZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
+ LDKCVec_APIErrorZ *ret = MALLOC(sizeof(LDKCVec_APIErrorZ), "LDKCVec_APIErrorZ");
+ ret->datalen = (*env)->GetArrayLength(env, elems);
+ if (ret->datalen == 0) {
+ ret->data = NULL;
+ } else {
+ ret->data = MALLOC(sizeof(LDKAPIError) * ret->datalen, "LDKCVec_APIErrorZ Data");
+ int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
+ for (size_t i = 0; i < ret->datalen; i++) {
+ int64_t arr_elem = java_elems[i];
+ LDKAPIError arr_elem_conv = *(LDKAPIError*)(((uint64_t)arr_elem) & ~1);
+ FREE((void*)arr_elem);
+ ret->data[i] = arr_elem_conv;
+ }
+ (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
+ }
+ return (long)ret;
+}
+static inline LDKCVec_APIErrorZ CVec_APIErrorZ_clone(const LDKCVec_APIErrorZ *orig) {
+ LDKCVec_APIErrorZ ret = { .data = MALLOC(sizeof(LDKAPIError) * orig->datalen, "LDKCVec_APIErrorZ clone bytes"), .datalen = orig->datalen };
+ for (size_t i = 0; i < ret.datalen; i++) {
+ ret.data[i] = APIError_clone(&orig->data[i]);
+ }
+ return ret;
+}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1ChannelDetailsZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
LDKCVec_ChannelDetailsZ *ret = MALLOC(sizeof(LDKCVec_ChannelDetailsZ), "LDKCVec_ChannelDetailsZ");
ret->datalen = (*env)->GetArrayLength(env, elems);
}
return ret;
}
+static jclass LDKPaymentSendFailure_ParameterError_class = NULL;
+static jmethodID LDKPaymentSendFailure_ParameterError_meth = NULL;
+static jclass LDKPaymentSendFailure_PathParameterError_class = NULL;
+static jmethodID LDKPaymentSendFailure_PathParameterError_meth = NULL;
+static jclass LDKPaymentSendFailure_AllFailedRetrySafe_class = NULL;
+static jmethodID LDKPaymentSendFailure_AllFailedRetrySafe_meth = NULL;
+static jclass LDKPaymentSendFailure_PartialFailure_class = NULL;
+static jmethodID LDKPaymentSendFailure_PartialFailure_meth = NULL;
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPaymentSendFailure_init (JNIEnv *env, jclass clz) {
+ LDKPaymentSendFailure_ParameterError_class =
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKPaymentSendFailure$ParameterError;"));
+ CHECK(LDKPaymentSendFailure_ParameterError_class != NULL);
+ LDKPaymentSendFailure_ParameterError_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_ParameterError_class, "<init>", "()V");
+ CHECK(LDKPaymentSendFailure_ParameterError_meth != NULL);
+ LDKPaymentSendFailure_PathParameterError_class =
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKPaymentSendFailure$PathParameterError;"));
+ CHECK(LDKPaymentSendFailure_PathParameterError_class != NULL);
+ LDKPaymentSendFailure_PathParameterError_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_PathParameterError_class, "<init>", "()V");
+ CHECK(LDKPaymentSendFailure_PathParameterError_meth != NULL);
+ LDKPaymentSendFailure_AllFailedRetrySafe_class =
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKPaymentSendFailure$AllFailedRetrySafe;"));
+ CHECK(LDKPaymentSendFailure_AllFailedRetrySafe_class != NULL);
+ LDKPaymentSendFailure_AllFailedRetrySafe_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_AllFailedRetrySafe_class, "<init>", "()V");
+ CHECK(LDKPaymentSendFailure_AllFailedRetrySafe_meth != NULL);
+ LDKPaymentSendFailure_PartialFailure_class =
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKPaymentSendFailure$PartialFailure;"));
+ CHECK(LDKPaymentSendFailure_PartialFailure_class != NULL);
+ LDKPaymentSendFailure_PartialFailure_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_PartialFailure_class, "<init>", "()V");
+ CHECK(LDKPaymentSendFailure_PartialFailure_meth != NULL);
+}
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentSendFailure_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
+ LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)ptr;
+ switch(obj->tag) {
+ case LDKPaymentSendFailure_ParameterError: {
+ return (*env)->NewObject(env, LDKPaymentSendFailure_ParameterError_class, LDKPaymentSendFailure_ParameterError_meth);
+ }
+ case LDKPaymentSendFailure_PathParameterError: {
+ return (*env)->NewObject(env, LDKPaymentSendFailure_PathParameterError_class, LDKPaymentSendFailure_PathParameterError_meth);
+ }
+ case LDKPaymentSendFailure_AllFailedRetrySafe: {
+ return (*env)->NewObject(env, LDKPaymentSendFailure_AllFailedRetrySafe_class, LDKPaymentSendFailure_AllFailedRetrySafe_meth);
+ }
+ case LDKPaymentSendFailure_PartialFailure: {
+ return (*env)->NewObject(env, LDKPaymentSendFailure_PartialFailure_class, LDKPaymentSendFailure_PartialFailure_meth);
+ }
+ default: abort();
+ }
+}
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePaymentSendFailureZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
return ((LDKCResult_NonePaymentSendFailureZ*)arg)->result_ok;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePaymentSendFailureZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_NonePaymentSendFailureZ *val = (LDKCResult_NonePaymentSendFailureZ*)(arg & ~1);
CHECK(!val->result_ok);
- LDKPaymentSendFailure err_var = (*val->contents.err);
- CHECK((((long)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
- CHECK((((long)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- long err_ref = (long)err_var.inner & ~1;
+ long err_ref = ((long)&(*val->contents.err)) | 1;
return err_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1ChannelMonitorZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
- int64_tArray arg = (*env)->CallObjectMethod(env, obj, j_calls->release_pending_monitor_events_meth);
- LDKCVec_MonitorEventZ arg_constr;
- arg_constr.datalen = (*env)->GetArrayLength(env, arg);
- if (arg_constr.datalen > 0)
- arg_constr.data = MALLOC(arg_constr.datalen * sizeof(LDKMonitorEvent), "LDKCVec_MonitorEventZ Elements");
+ int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->release_pending_monitor_events_meth);
+ LDKCVec_MonitorEventZ ret_constr;
+ ret_constr.datalen = (*env)->GetArrayLength(env, ret);
+ if (ret_constr.datalen > 0)
+ ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKMonitorEvent), "LDKCVec_MonitorEventZ Elements");
else
- arg_constr.data = NULL;
- int64_t* arg_vals = (*env)->GetLongArrayElements (env, arg, NULL);
- for (size_t o = 0; o < arg_constr.datalen; o++) {
- int64_t arr_conv_14 = arg_vals[o];
- LDKMonitorEvent arr_conv_14_conv;
- arr_conv_14_conv.inner = (void*)(arr_conv_14 & (~1));
- arr_conv_14_conv.is_owned = (arr_conv_14 & 1) || (arr_conv_14 == 0);
- arr_conv_14_conv = MonitorEvent_clone(&arr_conv_14_conv);
- arg_constr.data[o] = arr_conv_14_conv;
- }
- (*env)->ReleaseLongArrayElements(env, arg, arg_vals, 0);
- return arg_constr;
+ ret_constr.data = NULL;
+ int64_t* ret_vals = (*env)->GetLongArrayElements (env, ret, NULL);
+ for (size_t o = 0; o < ret_constr.datalen; o++) {
+ int64_t ret_conv_14 = ret_vals[o];
+ LDKMonitorEvent ret_conv_14_conv = *(LDKMonitorEvent*)(((uint64_t)ret_conv_14) & ~1);
+ ret_conv_14_conv = MonitorEvent_clone((LDKMonitorEvent*)ret_conv_14);
+ ret_constr.data[o] = ret_conv_14_conv;
+ }
+ (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0);
+ return ret_constr;
}
static void* LDKWatch_JCalls_clone(const void* this_arg) {
LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t o = 0; o < ret_var.datalen; o++) {
- LDKMonitorEvent arr_conv_14_var = ret_var.data[o];
- CHECK((((long)arr_conv_14_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
- CHECK((((long)&arr_conv_14_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- long arr_conv_14_ref = (long)arr_conv_14_var.inner;
- if (arr_conv_14_var.is_owned) {
- arr_conv_14_ref |= 1;
- }
- ret_arr_ptr[o] = arr_conv_14_ref;
+ LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
+ *ret_conv_14_copy = MonitorEvent_clone(&ret_var.data[o]);
+ long ret_conv_14_ref = (long)ret_conv_14_copy;
+ ret_arr_ptr[o] = ret_conv_14_ref;
}
(*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
FREE(ret_var.data);
(this_arg_conv->broadcast_transaction)(this_arg_conv->this_arg, tx_ref);
}
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelKeysDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
- return ((LDKCResult_ChannelKeysDecodeErrorZ*)arg)->result_ok;
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ return ((LDKCResult_SignDecodeErrorZ*)arg)->result_ok;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelKeysDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
- LDKCResult_ChannelKeysDecodeErrorZ *val = (LDKCResult_ChannelKeysDecodeErrorZ*)(arg & ~1);
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_SignDecodeErrorZ *val = (LDKCResult_SignDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
- LDKChannelKeys* ret = MALLOC(sizeof(LDKChannelKeys), "LDKChannelKeys");
- *ret = ChannelKeys_clone(&(*val->contents.result));
+ LDKSign* ret = MALLOC(sizeof(LDKSign), "LDKSign");
+ *ret = Sign_clone(&(*val->contents.result));
return (long)ret;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelKeysDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
- LDKCResult_ChannelKeysDecodeErrorZ *val = (LDKCResult_ChannelKeysDecodeErrorZ*)(arg & ~1);
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_SignDecodeErrorZ *val = (LDKCResult_SignDecodeErrorZ*)(arg & ~1);
CHECK(!val->result_ok);
LDKDecodeError err_var = (*val->contents.err);
CHECK((((long)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
jmethodID get_node_secret_meth;
jmethodID get_destination_script_meth;
jmethodID get_shutdown_pubkey_meth;
- jmethodID get_channel_keys_meth;
+ jmethodID get_channel_signer_meth;
jmethodID get_secure_random_bytes_meth;
jmethodID read_chan_signer_meth;
} LDKKeysInterface_JCalls;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
- int8_tArray arg = (*env)->CallObjectMethod(env, obj, j_calls->get_node_secret_meth);
- LDKSecretKey arg_ref;
- CHECK((*env)->GetArrayLength(env, arg) == 32);
- (*env)->GetByteArrayRegion(env, arg, 0, 32, arg_ref.bytes);
- return arg_ref;
+ int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_node_secret_meth);
+ LDKSecretKey ret_ref;
+ CHECK((*env)->GetArrayLength(env, ret) == 32);
+ (*env)->GetByteArrayRegion(env, ret, 0, 32, ret_ref.bytes);
+ return ret_ref;
}
LDKCVec_u8Z get_destination_script_jcall(const void* this_arg) {
LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
- int8_tArray arg = (*env)->CallObjectMethod(env, obj, j_calls->get_destination_script_meth);
- LDKCVec_u8Z arg_ref;
- arg_ref.datalen = (*env)->GetArrayLength(env, arg);
- arg_ref.data = MALLOC(arg_ref.datalen, "LDKCVec_u8Z Bytes");
- (*env)->GetByteArrayRegion(env, arg, 0, arg_ref.datalen, arg_ref.data);
- return arg_ref;
+ int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_destination_script_meth);
+ LDKCVec_u8Z ret_ref;
+ ret_ref.datalen = (*env)->GetArrayLength(env, ret);
+ ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
+ (*env)->GetByteArrayRegion(env, ret, 0, ret_ref.datalen, ret_ref.data);
+ return ret_ref;
}
LDKPublicKey get_shutdown_pubkey_jcall(const void* this_arg) {
LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
- int8_tArray arg = (*env)->CallObjectMethod(env, obj, j_calls->get_shutdown_pubkey_meth);
- LDKPublicKey arg_ref;
- CHECK((*env)->GetArrayLength(env, arg) == 33);
- (*env)->GetByteArrayRegion(env, arg, 0, 33, arg_ref.compressed_form);
- return arg_ref;
+ int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_shutdown_pubkey_meth);
+ LDKPublicKey ret_ref;
+ CHECK((*env)->GetArrayLength(env, ret) == 33);
+ (*env)->GetByteArrayRegion(env, ret, 0, 33, ret_ref.compressed_form);
+ return ret_ref;
}
-LDKChannelKeys get_channel_keys_jcall(const void* this_arg, bool inbound, uint64_t channel_value_satoshis) {
+LDKSign get_channel_signer_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);
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
- LDKChannelKeys* ret = (LDKChannelKeys*)(*env)->CallLongMethod(env, obj, j_calls->get_channel_keys_meth, inbound, channel_value_satoshis);
- LDKChannelKeys ret_conv = *(LDKChannelKeys*)(((uint64_t)ret) & ~1);
- ret_conv = ChannelKeys_clone(ret);
+ LDKSign* ret = (LDKSign*)(*env)->CallLongMethod(env, obj, 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) {
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
- int8_tArray arg = (*env)->CallObjectMethod(env, obj, j_calls->get_secure_random_bytes_meth);
- LDKThirtyTwoBytes arg_ref;
- CHECK((*env)->GetArrayLength(env, arg) == 32);
- (*env)->GetByteArrayRegion(env, arg, 0, 32, arg_ref.data);
- return arg_ref;
+ int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_secure_random_bytes_meth);
+ LDKThirtyTwoBytes ret_ref;
+ CHECK((*env)->GetArrayLength(env, ret) == 32);
+ (*env)->GetByteArrayRegion(env, ret, 0, 32, ret_ref.data);
+ return ret_ref;
}
-LDKCResult_ChannelKeysDecodeErrorZ read_chan_signer_jcall(const void* this_arg, LDKu8slice reader) {
+LDKCResult_SignDecodeErrorZ read_chan_signer_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);
(*env)->SetByteArrayRegion(env, reader_arr, 0, reader_var.datalen, reader_var.data);
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
- LDKCResult_ChannelKeysDecodeErrorZ* ret = (LDKCResult_ChannelKeysDecodeErrorZ*)(*env)->CallLongMethod(env, obj, j_calls->read_chan_signer_meth, reader_arr);
- LDKCResult_ChannelKeysDecodeErrorZ ret_conv = *(LDKCResult_ChannelKeysDecodeErrorZ*)(((uint64_t)ret) & ~1);
- ret_conv = CResult_ChannelKeysDecodeErrorZ_clone((LDKCResult_ChannelKeysDecodeErrorZ*)ret);
+ LDKCResult_SignDecodeErrorZ* ret = (LDKCResult_SignDecodeErrorZ*)(*env)->CallLongMethod(env, obj, j_calls->read_chan_signer_meth, reader_arr);
+ LDKCResult_SignDecodeErrorZ ret_conv = *(LDKCResult_SignDecodeErrorZ*)(((uint64_t)ret) & ~1);
+ ret_conv = CResult_SignDecodeErrorZ_clone((LDKCResult_SignDecodeErrorZ*)ret);
return ret_conv;
}
static void* LDKKeysInterface_JCalls_clone(const void* this_arg) {
CHECK(calls->get_destination_script_meth != NULL);
calls->get_shutdown_pubkey_meth = (*env)->GetMethodID(env, c, "get_shutdown_pubkey", "()[B");
CHECK(calls->get_shutdown_pubkey_meth != NULL);
- calls->get_channel_keys_meth = (*env)->GetMethodID(env, c, "get_channel_keys", "(ZJ)J");
- CHECK(calls->get_channel_keys_meth != NULL);
+ calls->get_channel_signer_meth = (*env)->GetMethodID(env, c, "get_channel_signer", "(ZJ)J");
+ CHECK(calls->get_channel_signer_meth != NULL);
calls->get_secure_random_bytes_meth = (*env)->GetMethodID(env, c, "get_secure_random_bytes", "()[B");
CHECK(calls->get_secure_random_bytes_meth != NULL);
calls->read_chan_signer_meth = (*env)->GetMethodID(env, c, "read_chan_signer", "([B)J");
.get_node_secret = get_node_secret_jcall,
.get_destination_script = get_destination_script_jcall,
.get_shutdown_pubkey = get_shutdown_pubkey_jcall,
- .get_channel_keys = get_channel_keys_jcall,
+ .get_channel_signer = get_channel_signer_jcall,
.get_secure_random_bytes = get_secure_random_bytes_jcall,
.read_chan_signer = read_chan_signer_jcall,
.free = LDKKeysInterface_JCalls_free,
}
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1node_1secret(JNIEnv *env, jclass clz, int64_t this_arg) {
LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 32);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 32, (this_arg_conv->get_node_secret)(this_arg_conv->this_arg).bytes);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, (this_arg_conv->get_node_secret)(this_arg_conv->this_arg).bytes);
+ return ret_arr;
}
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1destination_1script(JNIEnv *env, jclass clz, int64_t this_arg) {
LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg;
- LDKCVec_u8Z arg_var = (this_arg_conv->get_destination_script)(this_arg_conv->this_arg);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = (this_arg_conv->get_destination_script)(this_arg_conv->this_arg);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1shutdown_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg) {
LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 33);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 33, (this_arg_conv->get_shutdown_pubkey)(this_arg_conv->this_arg).compressed_form);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, (this_arg_conv->get_shutdown_pubkey)(this_arg_conv->this_arg).compressed_form);
+ return ret_arr;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1channel_1keys(JNIEnv *env, jclass clz, int64_t this_arg, jboolean inbound, int64_t channel_value_satoshis) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1channel_1signer(JNIEnv *env, jclass clz, int64_t this_arg, jboolean inbound, int64_t channel_value_satoshis) {
LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg;
- LDKChannelKeys* ret = MALLOC(sizeof(LDKChannelKeys), "LDKChannelKeys");
- *ret = (this_arg_conv->get_channel_keys)(this_arg_conv->this_arg, inbound, channel_value_satoshis);
+ LDKSign* ret = MALLOC(sizeof(LDKSign), "LDKSign");
+ *ret = (this_arg_conv->get_channel_signer)(this_arg_conv->this_arg, inbound, channel_value_satoshis);
return (long)ret;
}
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1secure_1random_1bytes(JNIEnv *env, jclass clz, int64_t this_arg) {
LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 32);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 32, (this_arg_conv->get_secure_random_bytes)(this_arg_conv->this_arg).data);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, (this_arg_conv->get_secure_random_bytes)(this_arg_conv->this_arg).data);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysInterface_1read_1chan_1signer(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray reader) {
LDKu8slice reader_ref;
reader_ref.datalen = (*env)->GetArrayLength(env, reader);
reader_ref.data = (*env)->GetByteArrayElements (env, reader, NULL);
- LDKCResult_ChannelKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelKeysDecodeErrorZ), "LDKCResult_ChannelKeysDecodeErrorZ");
+ LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
*ret_conv = (this_arg_conv->read_chan_signer)(this_arg_conv->this_arg, reader_ref);
(*env)->ReleaseByteArrayElements(env, reader, (int8_t*)reader_ref.data, 0);
return (long)ret_conv;
long err_ref = (long)err_var.inner & ~1;
return err_ref;
}
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InMemoryChannelKeysDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
- return ((LDKCResult_InMemoryChannelKeysDecodeErrorZ*)arg)->result_ok;
+static inline LDKCVec_CVec_u8ZZ CVec_CVec_u8ZZ_clone(const LDKCVec_CVec_u8ZZ *orig) {
+ LDKCVec_CVec_u8ZZ ret = { .data = MALLOC(sizeof(LDKCVec_u8Z) * orig->datalen, "LDKCVec_CVec_u8ZZ clone bytes"), .datalen = orig->datalen };
+ for (size_t i = 0; i < ret.datalen; i++) {
+ ret.data[i] = CVec_u8Z_clone(&orig->data[i]);
+ }
+ return ret;
+}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1CVec_1u8ZZNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ return ((LDKCResult_CVec_CVec_u8ZZNoneZ*)arg)->result_ok;
+}
+JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1CVec_1u8ZZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_CVec_CVec_u8ZZNoneZ *val = (LDKCResult_CVec_CVec_u8ZZNoneZ*)(arg & ~1);
+ CHECK(val->result_ok);
+ LDKCVec_CVec_u8ZZ res_var = (*val->contents.result);
+ jobjectArray res_arr = (*env)->NewObjectArray(env, res_var.datalen, arr_of_B_clz, NULL);
+ ;
+ for (size_t i = 0; i < res_var.datalen; i++) {
+ LDKCVec_u8Z res_conv_8_var = res_var.data[i];
+ int8_tArray res_conv_8_arr = (*env)->NewByteArray(env, res_conv_8_var.datalen);
+ (*env)->SetByteArrayRegion(env, res_conv_8_arr, 0, res_conv_8_var.datalen, res_conv_8_var.data);
+ (*env)->SetObjectArrayElement(env, res_arr, i, res_conv_8_arr);
+ }
+ return res_arr;
+}
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1CVec_1u8ZZNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_CVec_CVec_u8ZZNoneZ *val = (LDKCResult_CVec_CVec_u8ZZNoneZ*)(arg & ~1);
+ CHECK(!val->result_ok);
+ return *val->contents.err;
+}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InMemorySignerDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ return ((LDKCResult_InMemorySignerDecodeErrorZ*)arg)->result_ok;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InMemoryChannelKeysDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
- LDKCResult_InMemoryChannelKeysDecodeErrorZ *val = (LDKCResult_InMemoryChannelKeysDecodeErrorZ*)(arg & ~1);
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InMemorySignerDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_InMemorySignerDecodeErrorZ *val = (LDKCResult_InMemorySignerDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
- LDKInMemoryChannelKeys res_var = (*val->contents.result);
+ LDKInMemorySigner res_var = (*val->contents.result);
CHECK((((long)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((long)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
long res_ref = (long)res_var.inner & ~1;
return res_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InMemoryChannelKeysDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
- LDKCResult_InMemoryChannelKeysDecodeErrorZ *val = (LDKCResult_InMemoryChannelKeysDecodeErrorZ*)(arg & ~1);
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InMemorySignerDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_InMemorySignerDecodeErrorZ *val = (LDKCResult_InMemorySignerDecodeErrorZ*)(arg & ~1);
CHECK(!val->result_ok);
LDKDecodeError err_var = (*val->contents.err);
CHECK((((long)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
long err_ref = (long)err_var.inner & ~1;
return err_ref;
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1TxOutZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
+ LDKCVec_TxOutZ *ret = MALLOC(sizeof(LDKCVec_TxOutZ), "LDKCVec_TxOutZ");
+ ret->datalen = (*env)->GetArrayLength(env, elems);
+ if (ret->datalen == 0) {
+ ret->data = NULL;
+ } else {
+ ret->data = MALLOC(sizeof(LDKTxOut) * ret->datalen, "LDKCVec_TxOutZ Data");
+ int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
+ for (size_t i = 0; i < ret->datalen; i++) {
+ int64_t arr_elem = java_elems[i];
+ LDKTxOut arr_elem_conv = *(LDKTxOut*)(((uint64_t)arr_elem) & ~1);
+ FREE((void*)arr_elem);
+ ret->data[i] = arr_elem_conv;
+ }
+ (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
+ }
+ return (long)ret;
+}
+static inline LDKCVec_TxOutZ CVec_TxOutZ_clone(const LDKCVec_TxOutZ *orig) {
+ LDKCVec_TxOutZ ret = { .data = MALLOC(sizeof(LDKTxOut) * orig->datalen, "LDKCVec_TxOutZ clone bytes"), .datalen = orig->datalen };
+ for (size_t i = 0; i < ret.datalen; i++) {
+ ret.data[i] = TxOut_clone(&orig->data[i]);
+ }
+ return ret;
+}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TransactionNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ return ((LDKCResult_TransactionNoneZ*)arg)->result_ok;
+}
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TransactionNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_TransactionNoneZ *val = (LDKCResult_TransactionNoneZ*)(arg & ~1);
+ CHECK(val->result_ok);
+ LDKTransaction res_var = (*val->contents.result);
+ int8_tArray res_arr = (*env)->NewByteArray(env, res_var.datalen);
+ (*env)->SetByteArrayRegion(env, res_arr, 0, res_var.datalen, res_var.data);
+ return res_arr;
+}
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TransactionNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_TransactionNoneZ *val = (LDKCResult_TransactionNoneZ*)(arg & ~1);
+ CHECK(!val->result_ok);
+ return *val->contents.err;
+}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1RouteHopZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) {
LDKCVec_RouteHopZ *ret = MALLOC(sizeof(LDKCVec_RouteHopZ), "LDKCVec_RouteHopZ");
ret->datalen = (*env)->GetArrayLength(env, elems);
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
- int64_tArray arg = (*env)->CallObjectMethod(env, obj, j_calls->get_and_clear_pending_msg_events_meth);
- LDKCVec_MessageSendEventZ arg_constr;
- arg_constr.datalen = (*env)->GetArrayLength(env, arg);
- if (arg_constr.datalen > 0)
- arg_constr.data = MALLOC(arg_constr.datalen * sizeof(LDKMessageSendEvent), "LDKCVec_MessageSendEventZ Elements");
+ int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_and_clear_pending_msg_events_meth);
+ LDKCVec_MessageSendEventZ ret_constr;
+ ret_constr.datalen = (*env)->GetArrayLength(env, ret);
+ if (ret_constr.datalen > 0)
+ ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKMessageSendEvent), "LDKCVec_MessageSendEventZ Elements");
else
- arg_constr.data = NULL;
- int64_t* arg_vals = (*env)->GetLongArrayElements (env, arg, NULL);
- for (size_t s = 0; s < arg_constr.datalen; s++) {
- int64_t arr_conv_18 = arg_vals[s];
- LDKMessageSendEvent arr_conv_18_conv = *(LDKMessageSendEvent*)(((uint64_t)arr_conv_18) & ~1);
- FREE((void*)arr_conv_18);
- arg_constr.data[s] = arr_conv_18_conv;
+ ret_constr.data = NULL;
+ int64_t* ret_vals = (*env)->GetLongArrayElements (env, ret, NULL);
+ for (size_t s = 0; s < ret_constr.datalen; s++) {
+ int64_t ret_conv_18 = ret_vals[s];
+ LDKMessageSendEvent ret_conv_18_conv = *(LDKMessageSendEvent*)(((uint64_t)ret_conv_18) & ~1);
+ ret_conv_18_conv = MessageSendEvent_clone((LDKMessageSendEvent*)ret_conv_18);
+ ret_constr.data[s] = ret_conv_18_conv;
}
- (*env)->ReleaseLongArrayElements(env, arg, arg_vals, 0);
- return arg_constr;
+ (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0);
+ return ret_constr;
}
static void* LDKMessageSendEventsProvider_JCalls_clone(const void* this_arg) {
LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t s = 0; s < ret_var.datalen; s++) {
- LDKMessageSendEvent *arr_conv_18_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
- *arr_conv_18_copy = MessageSendEvent_clone(&ret_var.data[s]);
- long arr_conv_18_ref = (long)arr_conv_18_copy;
- ret_arr_ptr[s] = arr_conv_18_ref;
+ LDKMessageSendEvent *ret_conv_18_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+ *ret_conv_18_copy = MessageSendEvent_clone(&ret_var.data[s]);
+ long ret_conv_18_ref = (long)ret_conv_18_copy;
+ ret_arr_ptr[s] = ret_conv_18_ref;
}
(*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
FREE(ret_var.data);
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
- int64_tArray arg = (*env)->CallObjectMethod(env, obj, j_calls->get_and_clear_pending_events_meth);
- LDKCVec_EventZ arg_constr;
- arg_constr.datalen = (*env)->GetArrayLength(env, arg);
- if (arg_constr.datalen > 0)
- arg_constr.data = MALLOC(arg_constr.datalen * sizeof(LDKEvent), "LDKCVec_EventZ Elements");
+ int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_and_clear_pending_events_meth);
+ LDKCVec_EventZ ret_constr;
+ ret_constr.datalen = (*env)->GetArrayLength(env, ret);
+ if (ret_constr.datalen > 0)
+ ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKEvent), "LDKCVec_EventZ Elements");
else
- arg_constr.data = NULL;
- int64_t* arg_vals = (*env)->GetLongArrayElements (env, arg, NULL);
- for (size_t h = 0; h < arg_constr.datalen; h++) {
- int64_t arr_conv_7 = arg_vals[h];
- LDKEvent arr_conv_7_conv = *(LDKEvent*)(((uint64_t)arr_conv_7) & ~1);
- FREE((void*)arr_conv_7);
- arg_constr.data[h] = arr_conv_7_conv;
+ ret_constr.data = NULL;
+ int64_t* ret_vals = (*env)->GetLongArrayElements (env, ret, NULL);
+ for (size_t h = 0; h < ret_constr.datalen; h++) {
+ int64_t ret_conv_7 = ret_vals[h];
+ LDKEvent ret_conv_7_conv = *(LDKEvent*)(((uint64_t)ret_conv_7) & ~1);
+ ret_conv_7_conv = Event_clone((LDKEvent*)ret_conv_7);
+ ret_constr.data[h] = ret_conv_7_conv;
}
- (*env)->ReleaseLongArrayElements(env, arg, arg_vals, 0);
- return arg_constr;
+ (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0);
+ return ret_constr;
}
static void* LDKEventsProvider_JCalls_clone(const void* this_arg) {
LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t h = 0; h < ret_var.datalen; h++) {
- LDKEvent *arr_conv_7_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
- *arr_conv_7_copy = Event_clone(&ret_var.data[h]);
- long arr_conv_7_ref = (long)arr_conv_7_copy;
- ret_arr_ptr[h] = arr_conv_7_ref;
+ LDKEvent *ret_conv_7_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
+ *ret_conv_7_copy = Event_clone(&ret_var.data[h]);
+ long ret_conv_7_ref = (long)ret_conv_7_copy;
+ ret_arr_ptr[h] = ret_conv_7_ref;
}
(*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
FREE(ret_var.data);
return (long)ret_conv;
}
+typedef struct LDKListen_JCalls {
+ atomic_size_t refcnt;
+ JavaVM *vm;
+ jweak o;
+ jmethodID block_connected_meth;
+ jmethodID block_disconnected_meth;
+} LDKListen_JCalls;
+static void LDKListen_JCalls_free(void* this_arg) {
+ LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
+ if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
+ JNIEnv *env;
+ DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
+ (*env)->DeleteWeakGlobalRef(env, j_calls->o);
+ FREE(j_calls);
+ }
+}
+void block_connected_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);
+ LDKu8slice block_var = block;
+ int8_tArray block_arr = (*env)->NewByteArray(env, block_var.datalen);
+ (*env)->SetByteArrayRegion(env, block_arr, 0, block_var.datalen, block_var.data);
+ jobject obj = (*env)->NewLocalRef(env, j_calls->o);
+ 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) {
+ 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);
+ int8_tArray header_arr = (*env)->NewByteArray(env, 80);
+ (*env)->SetByteArrayRegion(env, header_arr, 0, 80, *header);
+ jobject obj = (*env)->NewLocalRef(env, j_calls->o);
+ CHECK(obj != NULL);
+ return (*env)->CallVoidMethod(env, obj, j_calls->block_disconnected_meth, header_arr, height);
+}
+static void* LDKListen_JCalls_clone(const void* this_arg) {
+ LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
+ atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
+ return (void*) this_arg;
+}
+static inline LDKListen LDKListen_init (JNIEnv *env, jclass clz, jobject o) {
+ jclass c = (*env)->GetObjectClass(env, o);
+ CHECK(c != NULL);
+ LDKListen_JCalls *calls = MALLOC(sizeof(LDKListen_JCalls), "LDKListen_JCalls");
+ atomic_init(&calls->refcnt, 1);
+ DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
+ calls->o = (*env)->NewWeakGlobalRef(env, o);
+ calls->block_connected_meth = (*env)->GetMethodID(env, c, "block_connected", "([BI)V");
+ CHECK(calls->block_connected_meth != NULL);
+ calls->block_disconnected_meth = (*env)->GetMethodID(env, c, "block_disconnected", "([BI)V");
+ CHECK(calls->block_disconnected_meth != NULL);
+
+ LDKListen ret = {
+ .this_arg = (void*) calls,
+ .block_connected = block_connected_jcall,
+ .block_disconnected = block_disconnected_jcall,
+ .free = LDKListen_JCalls_free,
+ };
+ return ret;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKListen_1new(JNIEnv *env, jclass clz, jobject o) {
+ LDKListen *res_ptr = MALLOC(sizeof(LDKListen), "LDKListen");
+ *res_ptr = LDKListen_init(env, clz, o);
+ return (long)res_ptr;
+}
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Listen_1block_1connected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray block, int32_t height) {
+ LDKListen* this_arg_conv = (LDKListen*)this_arg;
+ LDKu8slice block_ref;
+ block_ref.datalen = (*env)->GetArrayLength(env, block);
+ block_ref.data = (*env)->GetByteArrayElements (env, block, NULL);
+ (this_arg_conv->block_connected)(this_arg_conv->this_arg, block_ref, height);
+ (*env)->ReleaseByteArrayElements(env, block, (int8_t*)block_ref.data, 0);
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Listen_1block_1disconnected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray header, int32_t height) {
+ LDKListen* this_arg_conv = (LDKListen*)this_arg;
+ unsigned char header_arr[80];
+ CHECK((*env)->GetArrayLength(env, header) == 80);
+ (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr);
+ unsigned char (*header_ref)[80] = &header_arr;
+ (this_arg_conv->block_disconnected)(this_arg_conv->this_arg, header_ref, height);
+}
+
typedef struct LDKFilter_JCalls {
atomic_size_t refcnt;
JavaVM *vm;
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 LDKShutdown * msg) {
+void handle_shutdown_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);
int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
+ LDKInitFeatures their_features_var = *their_features;
+ their_features_var = InitFeatures_clone(their_features);
+ CHECK((((long)their_features_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&their_features_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long their_features_ref = (long)their_features_var.inner;
+ if (their_features_var.is_owned) {
+ their_features_ref |= 1;
+ }
LDKShutdown msg_var = *msg;
msg_var = Shutdown_clone(msg);
CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
}
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
- return (*env)->CallVoidMethod(env, obj, j_calls->handle_shutdown_meth, their_node_id_arr, msg_ref);
+ 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) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
CHECK(calls->handle_funding_signed_meth != NULL);
calls->handle_funding_locked_meth = (*env)->GetMethodID(env, c, "handle_funding_locked", "([BJ)V");
CHECK(calls->handle_funding_locked_meth != NULL);
- calls->handle_shutdown_meth = (*env)->GetMethodID(env, c, "handle_shutdown", "([BJ)V");
+ calls->handle_shutdown_meth = (*env)->GetMethodID(env, c, "handle_shutdown", "([BJJ)V");
CHECK(calls->handle_shutdown_meth != NULL);
calls->handle_closing_signed_meth = (*env)->GetMethodID(env, c, "handle_closing_signed", "([BJ)V");
CHECK(calls->handle_closing_signed_meth != NULL);
(this_arg_conv->handle_funding_locked)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1shutdown(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1shutdown(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t their_features, int64_t msg) {
LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg;
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);
+ LDKInitFeatures their_features_conv;
+ their_features_conv.inner = (void*)(their_features & (~1));
+ their_features_conv.is_owned = false;
LDKShutdown msg_conv;
msg_conv.inner = (void*)(msg & (~1));
msg_conv.is_owned = false;
- (this_arg_conv->handle_shutdown)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
+ (this_arg_conv->handle_shutdown)(this_arg_conv->this_arg, their_node_id_ref, &their_features_conv, &msg_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1closing_1signed(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK);
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
- int64_tArray arg = (*env)->CallObjectMethod(env, obj, j_calls->get_next_channel_announcements_meth, starting_point, batch_amount);
- LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ arg_constr;
- arg_constr.datalen = (*env)->GetArrayLength(env, arg);
- if (arg_constr.datalen > 0)
- arg_constr.data = MALLOC(arg_constr.datalen * sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ Elements");
+ int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_next_channel_announcements_meth, starting_point, batch_amount);
+ LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret_constr;
+ ret_constr.datalen = (*env)->GetArrayLength(env, ret);
+ if (ret_constr.datalen > 0)
+ ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ Elements");
else
- arg_constr.data = NULL;
- int64_t* arg_vals = (*env)->GetLongArrayElements (env, arg, NULL);
- for (size_t l = 0; l < arg_constr.datalen; l++) {
- int64_t arr_conv_63 = arg_vals[l];
- LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ arr_conv_63_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(((uint64_t)arr_conv_63) & ~1);
- FREE((void*)arr_conv_63);
- arg_constr.data[l] = arr_conv_63_conv;
+ ret_constr.data = NULL;
+ int64_t* ret_vals = (*env)->GetLongArrayElements (env, ret, NULL);
+ for (size_t l = 0; l < ret_constr.datalen; l++) {
+ int64_t ret_conv_63 = ret_vals[l];
+ LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ ret_conv_63_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(((uint64_t)ret_conv_63) & ~1);
+ ret_conv_63_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone((LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)ret_conv_63);
+ ret_constr.data[l] = ret_conv_63_conv;
}
- (*env)->ReleaseLongArrayElements(env, arg, arg_vals, 0);
- return arg_constr;
+ (*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) {
LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
(*env)->SetByteArrayRegion(env, starting_point_arr, 0, 33, starting_point.compressed_form);
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
- int64_tArray arg = (*env)->CallObjectMethod(env, obj, j_calls->get_next_node_announcements_meth, starting_point_arr, batch_amount);
- LDKCVec_NodeAnnouncementZ arg_constr;
- arg_constr.datalen = (*env)->GetArrayLength(env, arg);
- if (arg_constr.datalen > 0)
- arg_constr.data = MALLOC(arg_constr.datalen * sizeof(LDKNodeAnnouncement), "LDKCVec_NodeAnnouncementZ Elements");
+ int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_next_node_announcements_meth, starting_point_arr, batch_amount);
+ LDKCVec_NodeAnnouncementZ ret_constr;
+ ret_constr.datalen = (*env)->GetArrayLength(env, ret);
+ if (ret_constr.datalen > 0)
+ ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKNodeAnnouncement), "LDKCVec_NodeAnnouncementZ Elements");
else
- arg_constr.data = NULL;
- int64_t* arg_vals = (*env)->GetLongArrayElements (env, arg, NULL);
- for (size_t s = 0; s < arg_constr.datalen; s++) {
- int64_t arr_conv_18 = arg_vals[s];
- LDKNodeAnnouncement arr_conv_18_conv;
- arr_conv_18_conv.inner = (void*)(arr_conv_18 & (~1));
- arr_conv_18_conv.is_owned = (arr_conv_18 & 1) || (arr_conv_18 == 0);
- arr_conv_18_conv = NodeAnnouncement_clone(&arr_conv_18_conv);
- arg_constr.data[s] = arr_conv_18_conv;
- }
- (*env)->ReleaseLongArrayElements(env, arg, arg_vals, 0);
- return arg_constr;
+ ret_constr.data = NULL;
+ int64_t* ret_vals = (*env)->GetLongArrayElements (env, ret, NULL);
+ for (size_t s = 0; s < ret_constr.datalen; s++) {
+ int64_t ret_conv_18 = ret_vals[s];
+ LDKNodeAnnouncement ret_conv_18_conv;
+ ret_conv_18_conv.inner = (void*)(ret_conv_18 & (~1));
+ ret_conv_18_conv.is_owned = (ret_conv_18 & 1) || (ret_conv_18 == 0);
+ ret_conv_18_conv = NodeAnnouncement_clone(&ret_conv_18_conv);
+ ret_constr.data[s] = ret_conv_18_conv;
+ }
+ (*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) {
LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t l = 0; l < ret_var.datalen; l++) {
- LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* arr_conv_63_ref = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
- *arr_conv_63_ref = ret_var.data[l];
- ret_arr_ptr[l] = (long)arr_conv_63_ref;
+ LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv_63_ref = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
+ *ret_conv_63_ref = ret_var.data[l];
+ ret_arr_ptr[l] = (long)ret_conv_63_ref;
}
(*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
FREE(ret_var.data);
int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t s = 0; s < ret_var.datalen; s++) {
- LDKNodeAnnouncement arr_conv_18_var = ret_var.data[s];
- CHECK((((long)arr_conv_18_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
- CHECK((((long)&arr_conv_18_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- long arr_conv_18_ref = (long)arr_conv_18_var.inner;
- if (arr_conv_18_var.is_owned) {
- arr_conv_18_ref |= 1;
+ LDKNodeAnnouncement ret_conv_18_var = ret_var.data[s];
+ CHECK((((long)ret_conv_18_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_conv_18_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_conv_18_ref = (long)ret_conv_18_var.inner;
+ if (ret_conv_18_var.is_owned) {
+ ret_conv_18_ref |= 1;
}
- ret_arr_ptr[s] = arr_conv_18_ref;
+ ret_arr_ptr[s] = ret_conv_18_ref;
}
(*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
FREE(ret_var.data);
else
_res_constr.data = NULL;
for (size_t i = 0; i < _res_constr.datalen; i++) {
- int8_tArray arr_conv_8 = (*env)->GetObjectArrayElement(env, _res, i);
- LDKSignature arr_conv_8_ref;
- CHECK((*env)->GetArrayLength(env, arr_conv_8) == 64);
- (*env)->GetByteArrayRegion(env, arr_conv_8, 0, 64, arr_conv_8_ref.compact_form);
- _res_constr.data[i] = arr_conv_8_ref;
+ int8_tArray _res_conv_8 = (*env)->GetObjectArrayElement(env, _res, i);
+ LDKSignature _res_conv_8_ref;
+ CHECK((*env)->GetArrayLength(env, _res_conv_8) == 64);
+ (*env)->GetByteArrayRegion(env, _res_conv_8, 0, 64, _res_conv_8_ref.compact_form);
+ _res_constr.data[i] = _res_conv_8_ref;
}
CVec_SignatureZ_free(_res_constr);
}
else
o_constr.data = NULL;
for (size_t i = 0; i < o_constr.datalen; i++) {
- int8_tArray arr_conv_8 = (*env)->GetObjectArrayElement(env, o, i);
- LDKSignature arr_conv_8_ref;
- CHECK((*env)->GetArrayLength(env, arr_conv_8) == 64);
- (*env)->GetByteArrayRegion(env, arr_conv_8, 0, 64, arr_conv_8_ref.compact_form);
- o_constr.data[i] = arr_conv_8_ref;
+ int8_tArray o_conv_8 = (*env)->GetObjectArrayElement(env, o, i);
+ LDKSignature o_conv_8_ref;
+ CHECK((*env)->GetArrayLength(env, o_conv_8) == 64);
+ (*env)->GetByteArrayRegion(env, o_conv_8, 0, 64, o_conv_8_ref.compact_form);
+ o_constr.data[i] = o_conv_8_ref;
}
LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
*ret_conv = CResult_CVec_SignatureZNoneZ_ok(o_constr);
else
_res_constr.data = NULL;
for (size_t i = 0; i < _res_constr.datalen; i++) {
- int8_tArray arr_conv_8 = (*env)->GetObjectArrayElement(env, _res, i);
- LDKPublicKey arr_conv_8_ref;
- CHECK((*env)->GetArrayLength(env, arr_conv_8) == 33);
- (*env)->GetByteArrayRegion(env, arr_conv_8, 0, 33, arr_conv_8_ref.compressed_form);
- _res_constr.data[i] = arr_conv_8_ref;
+ int8_tArray _res_conv_8 = (*env)->GetObjectArrayElement(env, _res, i);
+ LDKPublicKey _res_conv_8_ref;
+ CHECK((*env)->GetArrayLength(env, _res_conv_8) == 33);
+ (*env)->GetByteArrayRegion(env, _res_conv_8, 0, 33, _res_conv_8_ref.compressed_form);
+ _res_constr.data[i] = _res_conv_8_ref;
}
CVec_PublicKeyZ_free(_res_constr);
}
_res_constr.data = NULL;
int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
for (size_t l = 0; l < _res_constr.datalen; l++) {
- int64_t arr_conv_63 = _res_vals[l];
- LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ arr_conv_63_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(((uint64_t)arr_conv_63) & ~1);
- FREE((void*)arr_conv_63);
- _res_constr.data[l] = arr_conv_63_conv;
+ int64_t _res_conv_63 = _res_vals[l];
+ LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res_conv_63_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(((uint64_t)_res_conv_63) & ~1);
+ FREE((void*)_res_conv_63);
+ _res_constr.data[l] = _res_conv_63_conv;
}
(*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(_res_constr);
_res_constr.data = NULL;
int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
for (size_t s = 0; s < _res_constr.datalen; s++) {
- int64_t arr_conv_18 = _res_vals[s];
- LDKNodeAnnouncement arr_conv_18_conv;
- arr_conv_18_conv.inner = (void*)(arr_conv_18 & (~1));
- arr_conv_18_conv.is_owned = (arr_conv_18 & 1) || (arr_conv_18 == 0);
- _res_constr.data[s] = arr_conv_18_conv;
+ int64_t _res_conv_18 = _res_vals[s];
+ LDKNodeAnnouncement _res_conv_18_conv;
+ _res_conv_18_conv.inner = (void*)(_res_conv_18 & (~1));
+ _res_conv_18_conv.is_owned = (_res_conv_18 & 1) || (_res_conv_18 == 0);
+ _res_constr.data[s] = _res_conv_18_conv;
}
(*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
CVec_NodeAnnouncementZ_free(_res_constr);
_res_constr.data = NULL;
int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
for (size_t s = 0; s < _res_constr.datalen; s++) {
- int64_t arr_conv_18 = _res_vals[s];
- LDKMessageSendEvent arr_conv_18_conv = *(LDKMessageSendEvent*)(((uint64_t)arr_conv_18) & ~1);
- FREE((void*)arr_conv_18);
- _res_constr.data[s] = arr_conv_18_conv;
+ int64_t _res_conv_18 = _res_vals[s];
+ LDKMessageSendEvent _res_conv_18_conv = *(LDKMessageSendEvent*)(((uint64_t)_res_conv_18) & ~1);
+ FREE((void*)_res_conv_18);
+ _res_constr.data[s] = _res_conv_18_conv;
}
(*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
CVec_MessageSendEventZ_free(_res_constr);
LDKChannelInfo o_conv;
o_conv.inner = (void*)(o & (~1));
o_conv.is_owned = (o & 1) || (o == 0);
- // Warning: we need a move here but no clone is available for LDKChannelInfo
+ o_conv = ChannelInfo_clone(&o_conv);
LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
*ret_conv = CResult_ChannelInfoDecodeErrorZ_ok(o_conv);
return (long)ret_conv;
CResult_ChannelInfoDecodeErrorZ_free(_res_conv);
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKCResult_ChannelInfoDecodeErrorZ* orig_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)(orig & ~1);
+ LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
+ *ret_conv = CResult_ChannelInfoDecodeErrorZ_clone(orig_conv);
+ return (long)ret_conv;
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
LDKRoutingFees o_conv;
o_conv.inner = (void*)(o & (~1));
_res_constr.data = NULL;
int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
for (size_t m = 0; m < _res_constr.datalen; m++) {
- int64_t arr_conv_12 = _res_vals[m];
- LDKNetAddress arr_conv_12_conv = *(LDKNetAddress*)(((uint64_t)arr_conv_12) & ~1);
- FREE((void*)arr_conv_12);
- _res_constr.data[m] = arr_conv_12_conv;
+ int64_t _res_conv_12 = _res_vals[m];
+ LDKNetAddress _res_conv_12_conv = *(LDKNetAddress*)(((uint64_t)_res_conv_12) & ~1);
+ FREE((void*)_res_conv_12);
+ _res_constr.data[m] = _res_conv_12_conv;
}
(*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
CVec_NetAddressZ_free(_res_constr);
_res_constr.data = NULL;
int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
for (size_t g = 0; g < _res_constr.datalen; g++) {
- int64_t arr_conv_6 = _res_vals[g];
- _res_constr.data[g] = arr_conv_6;
+ int64_t _res_conv_6 = _res_vals[g];
+ _res_constr.data[g] = _res_conv_6;
}
(*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
CVec_u64Z_free(_res_constr);
LDKNetworkGraph o_conv;
o_conv.inner = (void*)(o & (~1));
o_conv.is_owned = (o & 1) || (o == 0);
- // Warning: we need a move here but no clone is available for LDKNetworkGraph
+ o_conv = NetworkGraph_clone(&o_conv);
LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ");
*ret_conv = CResult_NetworkGraphDecodeErrorZ_ok(o_conv);
return (long)ret_conv;
CResult_NetworkGraphDecodeErrorZ_free(_res_conv);
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKCResult_NetworkGraphDecodeErrorZ* orig_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)(orig & ~1);
+ LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ");
+ *ret_conv = CResult_NetworkGraphDecodeErrorZ_clone(orig_conv);
+ return (long)ret_conv;
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1new(JNIEnv *env, jclass clz, int64_t a, int8_tArray b) {
LDKTransaction b_ref;
b_ref.datalen = (*env)->GetArrayLength(env, b);
_res_constr.data = NULL;
int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
for (size_t y = 0; y < _res_constr.datalen; y++) {
- int64_t arr_conv_24 = _res_vals[y];
- LDKC2Tuple_usizeTransactionZ arr_conv_24_conv = *(LDKC2Tuple_usizeTransactionZ*)(((uint64_t)arr_conv_24) & ~1);
- FREE((void*)arr_conv_24);
- _res_constr.data[y] = arr_conv_24_conv;
+ int64_t _res_conv_24 = _res_vals[y];
+ LDKC2Tuple_usizeTransactionZ _res_conv_24_conv = *(LDKC2Tuple_usizeTransactionZ*)(((uint64_t)_res_conv_24) & ~1);
+ FREE((void*)_res_conv_24);
+ _res_constr.data[y] = _res_conv_24_conv;
}
(*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
CVec_C2Tuple_usizeTransactionZZ_free(_res_constr);
_res_constr.data = NULL;
int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
for (size_t o = 0; o < _res_constr.datalen; o++) {
- int64_t arr_conv_14 = _res_vals[o];
- LDKMonitorEvent arr_conv_14_conv;
- arr_conv_14_conv.inner = (void*)(arr_conv_14 & (~1));
- arr_conv_14_conv.is_owned = (arr_conv_14 & 1) || (arr_conv_14 == 0);
- _res_constr.data[o] = arr_conv_14_conv;
+ int64_t _res_conv_14 = _res_vals[o];
+ LDKMonitorEvent _res_conv_14_conv = *(LDKMonitorEvent*)(((uint64_t)_res_conv_14) & ~1);
+ FREE((void*)_res_conv_14);
+ _res_constr.data[o] = _res_conv_14_conv;
}
(*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
CVec_MonitorEventZ_free(_res_constr);
_res_constr.data = NULL;
int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
for (size_t h = 0; h < _res_constr.datalen; h++) {
- int64_t arr_conv_7 = _res_vals[h];
- LDKEvent arr_conv_7_conv = *(LDKEvent*)(((uint64_t)arr_conv_7) & ~1);
- FREE((void*)arr_conv_7);
- _res_constr.data[h] = arr_conv_7_conv;
+ int64_t _res_conv_7 = _res_vals[h];
+ LDKEvent _res_conv_7_conv = *(LDKEvent*)(((uint64_t)_res_conv_7) & ~1);
+ FREE((void*)_res_conv_7);
+ _res_constr.data[h] = _res_conv_7_conv;
}
(*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
CVec_EventZ_free(_res_constr);
else
_res_constr.data = NULL;
for (size_t i = 0; i < _res_constr.datalen; i++) {
- int8_tArray arr_conv_8 = (*env)->GetObjectArrayElement(env, _res, i);
- LDKTransaction arr_conv_8_ref;
- arr_conv_8_ref.datalen = (*env)->GetArrayLength(env, arr_conv_8);
- arr_conv_8_ref.data = MALLOC(arr_conv_8_ref.datalen, "LDKTransaction Bytes");
- (*env)->GetByteArrayRegion(env, arr_conv_8, 0, arr_conv_8_ref.datalen, arr_conv_8_ref.data);
- arr_conv_8_ref.data_is_owned = true;
- _res_constr.data[i] = arr_conv_8_ref;
+ int8_tArray _res_conv_8 = (*env)->GetObjectArrayElement(env, _res, i);
+ LDKTransaction _res_conv_8_ref;
+ _res_conv_8_ref.datalen = (*env)->GetArrayLength(env, _res_conv_8);
+ _res_conv_8_ref.data = MALLOC(_res_conv_8_ref.datalen, "LDKTransaction Bytes");
+ (*env)->GetByteArrayRegion(env, _res_conv_8, 0, _res_conv_8_ref.datalen, _res_conv_8_ref.data);
+ _res_conv_8_ref.data_is_owned = true;
+ _res_constr.data[i] = _res_conv_8_ref;
}
CVec_TransactionZ_free(_res_constr);
}
_res_constr.data = NULL;
int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
for (size_t a = 0; a < _res_constr.datalen; a++) {
- int64_t arr_conv_26 = _res_vals[a];
- LDKC2Tuple_u32TxOutZ arr_conv_26_conv = *(LDKC2Tuple_u32TxOutZ*)(((uint64_t)arr_conv_26) & ~1);
- FREE((void*)arr_conv_26);
- _res_constr.data[a] = arr_conv_26_conv;
+ int64_t _res_conv_26 = _res_vals[a];
+ LDKC2Tuple_u32TxOutZ _res_conv_26_conv = *(LDKC2Tuple_u32TxOutZ*)(((uint64_t)_res_conv_26) & ~1);
+ FREE((void*)_res_conv_26);
+ _res_constr.data[a] = _res_conv_26_conv;
}
(*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
CVec_C2Tuple_u32TxOutZZ_free(_res_constr);
b_constr.data = NULL;
int64_t* b_vals = (*env)->GetLongArrayElements (env, b, NULL);
for (size_t a = 0; a < b_constr.datalen; a++) {
- int64_t arr_conv_26 = b_vals[a];
- LDKC2Tuple_u32TxOutZ arr_conv_26_conv = *(LDKC2Tuple_u32TxOutZ*)(((uint64_t)arr_conv_26) & ~1);
- FREE((void*)arr_conv_26);
- b_constr.data[a] = arr_conv_26_conv;
+ int64_t b_conv_26 = b_vals[a];
+ LDKC2Tuple_u32TxOutZ b_conv_26_conv = *(LDKC2Tuple_u32TxOutZ*)(((uint64_t)b_conv_26) & ~1);
+ FREE((void*)b_conv_26);
+ b_constr.data[a] = b_conv_26_conv;
}
(*env)->ReleaseLongArrayElements(env, b, b_vals, 0);
LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_ref = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
_res_constr.data = NULL;
int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
for (size_t u = 0; u < _res_constr.datalen; u++) {
- int64_t arr_conv_46 = _res_vals[u];
- LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ arr_conv_46_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(((uint64_t)arr_conv_46) & ~1);
- FREE((void*)arr_conv_46);
- _res_constr.data[u] = arr_conv_46_conv;
+ int64_t _res_conv_46 = _res_vals[u];
+ LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res_conv_46_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(((uint64_t)_res_conv_46) & ~1);
+ FREE((void*)_res_conv_46);
+ _res_constr.data[u] = _res_conv_46_conv;
}
(*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free(_res_constr);
_res_constr.data = NULL;
int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
for (size_t b = 0; b < _res_constr.datalen; b++) {
- int64_t arr_conv_27 = _res_vals[b];
- LDKSpendableOutputDescriptor arr_conv_27_conv = *(LDKSpendableOutputDescriptor*)(((uint64_t)arr_conv_27) & ~1);
- FREE((void*)arr_conv_27);
- _res_constr.data[b] = arr_conv_27_conv;
+ int64_t _res_conv_27 = _res_vals[b];
+ LDKSpendableOutputDescriptor _res_conv_27_conv = *(LDKSpendableOutputDescriptor*)(((uint64_t)_res_conv_27) & ~1);
+ FREE((void*)_res_conv_27);
+ _res_constr.data[b] = _res_conv_27_conv;
}
(*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
CVec_SpendableOutputDescriptorZ_free(_res_constr);
return (long)ret_conv;
}
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1CResult_1NoneAPIErrorZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
+ LDKCVec_CResult_NoneAPIErrorZZ _res_constr;
+ _res_constr.datalen = (*env)->GetArrayLength(env, _res);
+ if (_res_constr.datalen > 0)
+ _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
+ else
+ _res_constr.data = NULL;
+ int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
+ for (size_t w = 0; w < _res_constr.datalen; w++) {
+ int64_t _res_conv_22 = _res_vals[w];
+ LDKCResult_NoneAPIErrorZ _res_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(((uint64_t)_res_conv_22) & ~1);
+ FREE((void*)_res_conv_22);
+ _res_constr.data[w] = _res_conv_22_conv;
+ }
+ (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
+ CVec_CResult_NoneAPIErrorZZ_free(_res_constr);
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1APIErrorZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
+ LDKCVec_APIErrorZ _res_constr;
+ _res_constr.datalen = (*env)->GetArrayLength(env, _res);
+ if (_res_constr.datalen > 0)
+ _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKAPIError), "LDKCVec_APIErrorZ Elements");
+ else
+ _res_constr.data = NULL;
+ int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
+ for (size_t k = 0; k < _res_constr.datalen; k++) {
+ int64_t _res_conv_10 = _res_vals[k];
+ LDKAPIError _res_conv_10_conv = *(LDKAPIError*)(((uint64_t)_res_conv_10) & ~1);
+ FREE((void*)_res_conv_10);
+ _res_constr.data[k] = _res_conv_10_conv;
+ }
+ (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
+ CVec_APIErrorZ_free(_res_constr);
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelDetailsZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
LDKCVec_ChannelDetailsZ _res_constr;
_res_constr.datalen = (*env)->GetArrayLength(env, _res);
_res_constr.data = NULL;
int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
for (size_t q = 0; q < _res_constr.datalen; q++) {
- int64_t arr_conv_16 = _res_vals[q];
- LDKChannelDetails arr_conv_16_conv;
- arr_conv_16_conv.inner = (void*)(arr_conv_16 & (~1));
- arr_conv_16_conv.is_owned = (arr_conv_16 & 1) || (arr_conv_16 == 0);
- _res_constr.data[q] = arr_conv_16_conv;
+ int64_t _res_conv_16 = _res_vals[q];
+ LDKChannelDetails _res_conv_16_conv;
+ _res_conv_16_conv.inner = (void*)(_res_conv_16 & (~1));
+ _res_conv_16_conv.is_owned = (_res_conv_16 & 1) || (_res_conv_16 == 0);
+ _res_constr.data[q] = _res_conv_16_conv;
}
(*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
CVec_ChannelDetailsZ_free(_res_constr);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKPaymentSendFailure e_conv;
- e_conv.inner = (void*)(e & (~1));
- e_conv.is_owned = (e & 1) || (e == 0);
- e_conv = PaymentSendFailure_clone(&e_conv);
+ LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(((uint64_t)e) & ~1);
+ FREE((void*)e);
LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
*ret_conv = CResult_NonePaymentSendFailureZ_err(e_conv);
return (long)ret_conv;
_res_constr.data = NULL;
int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
for (size_t q = 0; q < _res_constr.datalen; q++) {
- int64_t arr_conv_16 = _res_vals[q];
- LDKChannelMonitor arr_conv_16_conv;
- arr_conv_16_conv.inner = (void*)(arr_conv_16 & (~1));
- arr_conv_16_conv.is_owned = (arr_conv_16 & 1) || (arr_conv_16 == 0);
- _res_constr.data[q] = arr_conv_16_conv;
+ int64_t _res_conv_16 = _res_vals[q];
+ LDKChannelMonitor _res_conv_16_conv;
+ _res_conv_16_conv.inner = (void*)(_res_conv_16 & (~1));
+ _res_conv_16_conv.is_owned = (_res_conv_16 & 1) || (_res_conv_16 == 0);
+ _res_constr.data[q] = _res_conv_16_conv;
}
(*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
CVec_ChannelMonitorZ_free(_res_constr);
CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(_res_conv);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1clone(JNIEnv *env, jclass clz, int64_t orig) {
- LDKC2Tuple_u64u64Z* orig_conv = (LDKC2Tuple_u64u64Z*)(orig & ~1);
- LDKC2Tuple_u64u64Z* ret_ref = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
- *ret_ref = C2Tuple_u64u64Z_clone(orig_conv);
- return (long)ret_ref;
-}
-
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1new(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
- LDKC2Tuple_u64u64Z* ret_ref = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
- *ret_ref = C2Tuple_u64u64Z_new(a, b);
- return (long)ret_ref;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1free(JNIEnv *env, jclass clz, int64_t _res) {
- if ((_res & 1) != 0) return;
- LDKC2Tuple_u64u64Z _res_conv = *(LDKC2Tuple_u64u64Z*)(((uint64_t)_res) & ~1);
- FREE((void*)_res);
- C2Tuple_u64u64Z_free(_res_conv);
-}
-
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
LDKSpendableOutputDescriptor o_conv = *(LDKSpendableOutputDescriptor*)(((uint64_t)o) & ~1);
FREE((void*)o);
else
b_constr.data = NULL;
for (size_t i = 0; i < b_constr.datalen; i++) {
- int8_tArray arr_conv_8 = (*env)->GetObjectArrayElement(env, b, i);
- LDKSignature arr_conv_8_ref;
- CHECK((*env)->GetArrayLength(env, arr_conv_8) == 64);
- (*env)->GetByteArrayRegion(env, arr_conv_8, 0, 64, arr_conv_8_ref.compact_form);
- b_constr.data[i] = arr_conv_8_ref;
+ int8_tArray b_conv_8 = (*env)->GetObjectArrayElement(env, b, i);
+ LDKSignature b_conv_8_ref;
+ CHECK((*env)->GetArrayLength(env, b_conv_8) == 64);
+ (*env)->GetByteArrayRegion(env, b_conv_8, 0, 64, b_conv_8_ref.compact_form);
+ b_constr.data[i] = b_conv_8_ref;
}
LDKC2Tuple_SignatureCVec_SignatureZZ* ret_ref = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
*ret_ref = C2Tuple_SignatureCVec_SignatureZZ_new(a_ref, b_constr);
return (long)ret_conv;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelKeysDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKChannelKeys o_conv = *(LDKChannelKeys*)(((uint64_t)o) & ~1);
- if (o_conv.free == LDKChannelKeys_JCalls_free) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ LDKSign o_conv = *(LDKSign*)(((uint64_t)o) & ~1);
+ if (o_conv.free == LDKSign_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
- LDKChannelKeys_JCalls_clone(o_conv.this_arg);
+ LDKSign_JCalls_clone(o_conv.this_arg);
}
- LDKCResult_ChannelKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelKeysDecodeErrorZ), "LDKCResult_ChannelKeysDecodeErrorZ");
- *ret_conv = CResult_ChannelKeysDecodeErrorZ_ok(o_conv);
+ LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
+ *ret_conv = CResult_SignDecodeErrorZ_ok(o_conv);
return (long)ret_conv;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelKeysDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
LDKDecodeError e_conv;
e_conv.inner = (void*)(e & (~1));
e_conv.is_owned = (e & 1) || (e == 0);
e_conv = DecodeError_clone(&e_conv);
- LDKCResult_ChannelKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelKeysDecodeErrorZ), "LDKCResult_ChannelKeysDecodeErrorZ");
- *ret_conv = CResult_ChannelKeysDecodeErrorZ_err(e_conv);
+ LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
+ *ret_conv = CResult_SignDecodeErrorZ_err(e_conv);
return (long)ret_conv;
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelKeysDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ChannelKeysDecodeErrorZ _res_conv = *(LDKCResult_ChannelKeysDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ LDKCResult_SignDecodeErrorZ _res_conv = *(LDKCResult_SignDecodeErrorZ*)(((uint64_t)_res) & ~1);
FREE((void*)_res);
- CResult_ChannelKeysDecodeErrorZ_free(_res_conv);
+ CResult_SignDecodeErrorZ_free(_res_conv);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelKeysDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
- LDKCResult_ChannelKeysDecodeErrorZ* orig_conv = (LDKCResult_ChannelKeysDecodeErrorZ*)(orig & ~1);
- LDKCResult_ChannelKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelKeysDecodeErrorZ), "LDKCResult_ChannelKeysDecodeErrorZ");
- *ret_conv = CResult_ChannelKeysDecodeErrorZ_clone(orig_conv);
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKCResult_SignDecodeErrorZ* orig_conv = (LDKCResult_SignDecodeErrorZ*)(orig & ~1);
+ LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
+ *ret_conv = CResult_SignDecodeErrorZ_clone(orig_conv);
return (long)ret_conv;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemoryChannelKeysDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKInMemoryChannelKeys o_conv;
- o_conv.inner = (void*)(o & (~1));
- o_conv.is_owned = (o & 1) || (o == 0);
- o_conv = InMemoryChannelKeys_clone(&o_conv);
- LDKCResult_InMemoryChannelKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemoryChannelKeysDecodeErrorZ), "LDKCResult_InMemoryChannelKeysDecodeErrorZ");
- *ret_conv = CResult_InMemoryChannelKeysDecodeErrorZ_ok(o_conv);
- return (long)ret_conv;
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1CVec_1u8ZZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) {
+ LDKCVec_CVec_u8ZZ _res_constr;
+ _res_constr.datalen = (*env)->GetArrayLength(env, _res);
+ if (_res_constr.datalen > 0)
+ _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKCVec_u8Z), "LDKCVec_CVec_u8ZZ Elements");
+ else
+ _res_constr.data = NULL;
+ for (size_t i = 0; i < _res_constr.datalen; i++) {
+ int8_tArray _res_conv_8 = (*env)->GetObjectArrayElement(env, _res, i);
+ LDKCVec_u8Z _res_conv_8_ref;
+ _res_conv_8_ref.datalen = (*env)->GetArrayLength(env, _res_conv_8);
+ _res_conv_8_ref.data = MALLOC(_res_conv_8_ref.datalen, "LDKCVec_u8Z Bytes");
+ (*env)->GetByteArrayRegion(env, _res_conv_8, 0, _res_conv_8_ref.datalen, _res_conv_8_ref.data);
+ _res_constr.data[i] = _res_conv_8_ref;
+ }
+ CVec_CVec_u8ZZ_free(_res_constr);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemoryChannelKeysDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = (void*)(e & (~1));
- e_conv.is_owned = (e & 1) || (e == 0);
- e_conv = DecodeError_clone(&e_conv);
- LDKCResult_InMemoryChannelKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemoryChannelKeysDecodeErrorZ), "LDKCResult_InMemoryChannelKeysDecodeErrorZ");
- *ret_conv = CResult_InMemoryChannelKeysDecodeErrorZ_err(e_conv);
- return (long)ret_conv;
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1ok(JNIEnv *env, jclass clz, jobjectArray o) {
+ LDKCVec_CVec_u8ZZ o_constr;
+ o_constr.datalen = (*env)->GetArrayLength(env, o);
+ if (o_constr.datalen > 0)
+ o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKCVec_u8Z), "LDKCVec_CVec_u8ZZ Elements");
+ else
+ o_constr.data = NULL;
+ for (size_t i = 0; i < o_constr.datalen; i++) {
+ int8_tArray o_conv_8 = (*env)->GetObjectArrayElement(env, o, i);
+ LDKCVec_u8Z o_conv_8_ref;
+ o_conv_8_ref.datalen = (*env)->GetArrayLength(env, o_conv_8);
+ o_conv_8_ref.data = MALLOC(o_conv_8_ref.datalen, "LDKCVec_u8Z Bytes");
+ (*env)->GetByteArrayRegion(env, o_conv_8, 0, o_conv_8_ref.datalen, o_conv_8_ref.data);
+ o_constr.data[i] = o_conv_8_ref;
+ }
+ LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
+ *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_ok(o_constr);
+ return (long)ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1err(JNIEnv *env, jclass clz) {
+ LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
+ *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_err();
+ return (long)ret_conv;
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InMemoryChannelKeysDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_InMemoryChannelKeysDecodeErrorZ _res_conv = *(LDKCResult_InMemoryChannelKeysDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ LDKCResult_CVec_CVec_u8ZZNoneZ _res_conv = *(LDKCResult_CVec_CVec_u8ZZNoneZ*)(((uint64_t)_res) & ~1);
FREE((void*)_res);
- CResult_InMemoryChannelKeysDecodeErrorZ_free(_res_conv);
+ CResult_CVec_CVec_u8ZZNoneZ_free(_res_conv);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKCResult_CVec_CVec_u8ZZNoneZ* orig_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)(orig & ~1);
+ LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
+ *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone(orig_conv);
+ return (long)ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ LDKInMemorySigner o_conv;
+ o_conv.inner = (void*)(o & (~1));
+ o_conv.is_owned = (o & 1) || (o == 0);
+ o_conv = InMemorySigner_clone(&o_conv);
+ LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
+ *ret_conv = CResult_InMemorySignerDecodeErrorZ_ok(o_conv);
+ return (long)ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
+ LDKDecodeError e_conv;
+ e_conv.inner = (void*)(e & (~1));
+ e_conv.is_owned = (e & 1) || (e == 0);
+ e_conv = DecodeError_clone(&e_conv);
+ LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
+ *ret_conv = CResult_InMemorySignerDecodeErrorZ_err(e_conv);
+ return (long)ret_conv;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
+ if ((_res & 1) != 0) return;
+ LDKCResult_InMemorySignerDecodeErrorZ _res_conv = *(LDKCResult_InMemorySignerDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ FREE((void*)_res);
+ CResult_InMemorySignerDecodeErrorZ_free(_res_conv);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKCResult_InMemorySignerDecodeErrorZ* orig_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)(orig & ~1);
+ LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
+ *ret_conv = CResult_InMemorySignerDecodeErrorZ_clone(orig_conv);
+ return (long)ret_conv;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TxOutZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
+ LDKCVec_TxOutZ _res_constr;
+ _res_constr.datalen = (*env)->GetArrayLength(env, _res);
+ if (_res_constr.datalen > 0)
+ _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements");
+ else
+ _res_constr.data = NULL;
+ int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
+ for (size_t h = 0; h < _res_constr.datalen; h++) {
+ int64_t _res_conv_7 = _res_vals[h];
+ LDKTxOut _res_conv_7_conv = *(LDKTxOut*)(((uint64_t)_res_conv_7) & ~1);
+ FREE((void*)_res_conv_7);
+ _res_constr.data[h] = _res_conv_7_conv;
+ }
+ (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
+ CVec_TxOutZ_free(_res_constr);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
+ LDKTransaction o_ref;
+ o_ref.datalen = (*env)->GetArrayLength(env, o);
+ o_ref.data = MALLOC(o_ref.datalen, "LDKTransaction Bytes");
+ (*env)->GetByteArrayRegion(env, o, 0, o_ref.datalen, o_ref.data);
+ o_ref.data_is_owned = true;
+ LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
+ *ret_conv = CResult_TransactionNoneZ_ok(o_ref);
+ return (long)ret_conv;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemoryChannelKeysDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
- LDKCResult_InMemoryChannelKeysDecodeErrorZ* orig_conv = (LDKCResult_InMemoryChannelKeysDecodeErrorZ*)(orig & ~1);
- LDKCResult_InMemoryChannelKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemoryChannelKeysDecodeErrorZ), "LDKCResult_InMemoryChannelKeysDecodeErrorZ");
- *ret_conv = CResult_InMemoryChannelKeysDecodeErrorZ_clone(orig_conv);
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1err(JNIEnv *env, jclass clz) {
+ LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
+ *ret_conv = CResult_TransactionNoneZ_err();
return (long)ret_conv;
}
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
+ if ((_res & 1) != 0) return;
+ LDKCResult_TransactionNoneZ _res_conv = *(LDKCResult_TransactionNoneZ*)(((uint64_t)_res) & ~1);
+ FREE((void*)_res);
+ CResult_TransactionNoneZ_free(_res_conv);
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHopZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
LDKCVec_RouteHopZ _res_constr;
_res_constr.datalen = (*env)->GetArrayLength(env, _res);
_res_constr.data = NULL;
int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
for (size_t k = 0; k < _res_constr.datalen; k++) {
- int64_t arr_conv_10 = _res_vals[k];
- LDKRouteHop arr_conv_10_conv;
- arr_conv_10_conv.inner = (void*)(arr_conv_10 & (~1));
- arr_conv_10_conv.is_owned = (arr_conv_10 & 1) || (arr_conv_10 == 0);
- _res_constr.data[k] = arr_conv_10_conv;
+ int64_t _res_conv_10 = _res_vals[k];
+ LDKRouteHop _res_conv_10_conv;
+ _res_conv_10_conv.inner = (void*)(_res_conv_10 & (~1));
+ _res_conv_10_conv.is_owned = (_res_conv_10 & 1) || (_res_conv_10 == 0);
+ _res_constr.data[k] = _res_conv_10_conv;
}
(*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
CVec_RouteHopZ_free(_res_constr);
else
_res_constr.data = NULL;
for (size_t m = 0; m < _res_constr.datalen; m++) {
- int64_tArray arr_conv_12 = (*env)->GetObjectArrayElement(env, _res, m);
- LDKCVec_RouteHopZ arr_conv_12_constr;
- arr_conv_12_constr.datalen = (*env)->GetArrayLength(env, arr_conv_12);
- if (arr_conv_12_constr.datalen > 0)
- arr_conv_12_constr.data = MALLOC(arr_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
+ int64_tArray _res_conv_12 = (*env)->GetObjectArrayElement(env, _res, m);
+ LDKCVec_RouteHopZ _res_conv_12_constr;
+ _res_conv_12_constr.datalen = (*env)->GetArrayLength(env, _res_conv_12);
+ if (_res_conv_12_constr.datalen > 0)
+ _res_conv_12_constr.data = MALLOC(_res_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
else
- arr_conv_12_constr.data = NULL;
- int64_t* arr_conv_12_vals = (*env)->GetLongArrayElements (env, arr_conv_12, NULL);
- for (size_t k = 0; k < arr_conv_12_constr.datalen; k++) {
- int64_t arr_conv_10 = arr_conv_12_vals[k];
- LDKRouteHop arr_conv_10_conv;
- arr_conv_10_conv.inner = (void*)(arr_conv_10 & (~1));
- arr_conv_10_conv.is_owned = (arr_conv_10 & 1) || (arr_conv_10 == 0);
- arr_conv_12_constr.data[k] = arr_conv_10_conv;
+ _res_conv_12_constr.data = NULL;
+ int64_t* _res_conv_12_vals = (*env)->GetLongArrayElements (env, _res_conv_12, NULL);
+ for (size_t k = 0; k < _res_conv_12_constr.datalen; k++) {
+ int64_t _res_conv_12_conv_10 = _res_conv_12_vals[k];
+ LDKRouteHop _res_conv_12_conv_10_conv;
+ _res_conv_12_conv_10_conv.inner = (void*)(_res_conv_12_conv_10 & (~1));
+ _res_conv_12_conv_10_conv.is_owned = (_res_conv_12_conv_10 & 1) || (_res_conv_12_conv_10 == 0);
+ _res_conv_12_constr.data[k] = _res_conv_12_conv_10_conv;
}
- (*env)->ReleaseLongArrayElements(env, arr_conv_12, arr_conv_12_vals, 0);
- _res_constr.data[m] = arr_conv_12_constr;
+ (*env)->ReleaseLongArrayElements(env, _res_conv_12, _res_conv_12_vals, 0);
+ _res_constr.data[m] = _res_conv_12_constr;
}
CVec_CVec_RouteHopZZ_free(_res_constr);
}
_res_constr.data = NULL;
int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
for (size_t l = 0; l < _res_constr.datalen; l++) {
- int64_t arr_conv_11 = _res_vals[l];
- LDKRouteHint arr_conv_11_conv;
- arr_conv_11_conv.inner = (void*)(arr_conv_11 & (~1));
- arr_conv_11_conv.is_owned = (arr_conv_11 & 1) || (arr_conv_11 == 0);
- _res_constr.data[l] = arr_conv_11_conv;
+ int64_t _res_conv_11 = _res_vals[l];
+ LDKRouteHint _res_conv_11_conv;
+ _res_conv_11_conv.inner = (void*)(_res_conv_11 & (~1));
+ _res_conv_11_conv.is_owned = (_res_conv_11 & 1) || (_res_conv_11 == 0);
+ _res_constr.data[l] = _res_conv_11_conv;
}
(*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
CVec_RouteHintZ_free(_res_constr);
_res_constr.data = NULL;
int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
for (size_t p = 0; p < _res_constr.datalen; p++) {
- int64_t arr_conv_15 = _res_vals[p];
- LDKUpdateAddHTLC arr_conv_15_conv;
- arr_conv_15_conv.inner = (void*)(arr_conv_15 & (~1));
- arr_conv_15_conv.is_owned = (arr_conv_15 & 1) || (arr_conv_15 == 0);
- _res_constr.data[p] = arr_conv_15_conv;
+ int64_t _res_conv_15 = _res_vals[p];
+ LDKUpdateAddHTLC _res_conv_15_conv;
+ _res_conv_15_conv.inner = (void*)(_res_conv_15 & (~1));
+ _res_conv_15_conv.is_owned = (_res_conv_15 & 1) || (_res_conv_15 == 0);
+ _res_constr.data[p] = _res_conv_15_conv;
}
(*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
CVec_UpdateAddHTLCZ_free(_res_constr);
_res_constr.data = NULL;
int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
for (size_t t = 0; t < _res_constr.datalen; t++) {
- int64_t arr_conv_19 = _res_vals[t];
- LDKUpdateFulfillHTLC arr_conv_19_conv;
- arr_conv_19_conv.inner = (void*)(arr_conv_19 & (~1));
- arr_conv_19_conv.is_owned = (arr_conv_19 & 1) || (arr_conv_19 == 0);
- _res_constr.data[t] = arr_conv_19_conv;
+ int64_t _res_conv_19 = _res_vals[t];
+ LDKUpdateFulfillHTLC _res_conv_19_conv;
+ _res_conv_19_conv.inner = (void*)(_res_conv_19 & (~1));
+ _res_conv_19_conv.is_owned = (_res_conv_19 & 1) || (_res_conv_19 == 0);
+ _res_constr.data[t] = _res_conv_19_conv;
}
(*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
CVec_UpdateFulfillHTLCZ_free(_res_constr);
_res_constr.data = NULL;
int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
for (size_t q = 0; q < _res_constr.datalen; q++) {
- int64_t arr_conv_16 = _res_vals[q];
- LDKUpdateFailHTLC arr_conv_16_conv;
- arr_conv_16_conv.inner = (void*)(arr_conv_16 & (~1));
- arr_conv_16_conv.is_owned = (arr_conv_16 & 1) || (arr_conv_16 == 0);
- _res_constr.data[q] = arr_conv_16_conv;
+ int64_t _res_conv_16 = _res_vals[q];
+ LDKUpdateFailHTLC _res_conv_16_conv;
+ _res_conv_16_conv.inner = (void*)(_res_conv_16 & (~1));
+ _res_conv_16_conv.is_owned = (_res_conv_16 & 1) || (_res_conv_16 == 0);
+ _res_constr.data[q] = _res_conv_16_conv;
}
(*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
CVec_UpdateFailHTLCZ_free(_res_constr);
_res_constr.data = NULL;
int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
for (size_t z = 0; z < _res_constr.datalen; z++) {
- int64_t arr_conv_25 = _res_vals[z];
- LDKUpdateFailMalformedHTLC arr_conv_25_conv;
- arr_conv_25_conv.inner = (void*)(arr_conv_25 & (~1));
- arr_conv_25_conv.is_owned = (arr_conv_25 & 1) || (arr_conv_25 == 0);
- _res_constr.data[z] = arr_conv_25_conv;
+ int64_t _res_conv_25 = _res_vals[z];
+ LDKUpdateFailMalformedHTLC _res_conv_25_conv;
+ _res_conv_25_conv.inner = (void*)(_res_conv_25 & (~1));
+ _res_conv_25_conv.is_owned = (_res_conv_25 & 1) || (_res_conv_25 == 0);
+ _res_constr.data[z] = _res_conv_25_conv;
}
(*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
CVec_UpdateFailMalformedHTLCZ_free(_res_constr);
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Event_1write(JNIEnv *env, jclass clz, int64_t obj) {
LDKEvent* obj_conv = (LDKEvent*)obj;
- LDKCVec_u8Z arg_var = Event_write(obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = Event_write(obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
LDKChannelConfig obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = ChannelConfig_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = ChannelConfig_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
Access_free(this_ptr_conv);
}
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Listen_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ if ((this_ptr & 1) != 0) return;
+ LDKListen this_ptr_conv = *(LDKListen*)(((uint64_t)this_ptr) & ~1);
+ FREE((void*)this_ptr);
+ Listen_free(this_ptr_conv);
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Watch_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
LDKWatch this_ptr_conv = *(LDKWatch*)(((uint64_t)this_ptr) & ~1);
txdata_constr.data = NULL;
int64_t* txdata_vals = (*env)->GetLongArrayElements (env, txdata, NULL);
for (size_t y = 0; y < txdata_constr.datalen; y++) {
- int64_t arr_conv_24 = txdata_vals[y];
- LDKC2Tuple_usizeTransactionZ arr_conv_24_conv = *(LDKC2Tuple_usizeTransactionZ*)(((uint64_t)arr_conv_24) & ~1);
- FREE((void*)arr_conv_24);
- txdata_constr.data[y] = arr_conv_24_conv;
+ int64_t txdata_conv_24 = txdata_vals[y];
+ LDKC2Tuple_usizeTransactionZ txdata_conv_24_conv = *(LDKC2Tuple_usizeTransactionZ*)(((uint64_t)txdata_conv_24) & ~1);
+ FREE((void*)txdata_conv_24);
+ txdata_constr.data[y] = txdata_conv_24_conv;
}
(*env)->ReleaseLongArrayElements(env, txdata, txdata_vals, 0);
ChainMonitor_block_connected(&this_arg_conv, header_ref, txdata_constr, height);
LDKChannelMonitorUpdate obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = ChannelMonitorUpdate_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = ChannelMonitorUpdate_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
- LDKMonitorEvent this_ptr_conv;
- this_ptr_conv.inner = (void*)(this_ptr & (~1));
- this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+ if ((this_ptr & 1) != 0) return;
+ LDKMonitorEvent this_ptr_conv = *(LDKMonitorEvent*)(((uint64_t)this_ptr) & ~1);
+ FREE((void*)this_ptr);
MonitorEvent_free(this_ptr_conv);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1clone(JNIEnv *env, jclass clz, int64_t orig) {
- LDKMonitorEvent orig_conv;
- orig_conv.inner = (void*)(orig & (~1));
- orig_conv.is_owned = false;
- LDKMonitorEvent ret_var = MonitorEvent_clone(&orig_conv);
- 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;
- if (ret_var.is_owned) {
- ret_ref |= 1;
- }
+ LDKMonitorEvent* orig_conv = (LDKMonitorEvent*)orig;
+ LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
+ *ret_copy = MonitorEvent_clone(orig_conv);
+ long ret_ref = (long)ret_copy;
return ret_ref;
}
LDKHTLCUpdate obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = HTLCUpdate_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = HTLCUpdate_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKChannelMonitor obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = ChannelMonitor_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = ChannelMonitor_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1update_1monitor(JNIEnv *env, jclass clz, int64_t this_arg, int64_t updates, int64_t broadcaster, int64_t fee_estimator, int64_t logger) {
int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t o = 0; o < ret_var.datalen; o++) {
- LDKMonitorEvent arr_conv_14_var = ret_var.data[o];
- CHECK((((long)arr_conv_14_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
- CHECK((((long)&arr_conv_14_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- long arr_conv_14_ref = (long)arr_conv_14_var.inner;
- if (arr_conv_14_var.is_owned) {
- arr_conv_14_ref |= 1;
- }
- ret_arr_ptr[o] = arr_conv_14_ref;
+ LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
+ *ret_conv_14_copy = MonitorEvent_clone(&ret_var.data[o]);
+ long ret_conv_14_ref = (long)ret_conv_14_copy;
+ ret_arr_ptr[o] = ret_conv_14_ref;
}
(*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
FREE(ret_var.data);
int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t h = 0; h < ret_var.datalen; h++) {
- LDKEvent *arr_conv_7_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
- *arr_conv_7_copy = Event_clone(&ret_var.data[h]);
- long arr_conv_7_ref = (long)arr_conv_7_copy;
- ret_arr_ptr[h] = arr_conv_7_ref;
+ LDKEvent *ret_conv_7_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
+ *ret_conv_7_copy = Event_clone(&ret_var.data[h]);
+ long ret_conv_7_ref = (long)ret_conv_7_copy;
+ ret_arr_ptr[h] = ret_conv_7_ref;
}
(*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
FREE(ret_var.data);
jobjectArray ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
;
for (size_t i = 0; i < ret_var.datalen; i++) {
- LDKTransaction arr_conv_8_var = ret_var.data[i];
- int8_tArray arr_conv_8_arr = (*env)->NewByteArray(env, arr_conv_8_var.datalen);
- (*env)->SetByteArrayRegion(env, arr_conv_8_arr, 0, arr_conv_8_var.datalen, arr_conv_8_var.data);
- Transaction_free(arr_conv_8_var);
- (*env)->SetObjectArrayElement(env, ret_arr, i, arr_conv_8_arr);
+ LDKTransaction ret_conv_8_var = ret_var.data[i];
+ int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, ret_conv_8_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, ret_conv_8_var.datalen, ret_conv_8_var.data);
+ Transaction_free(ret_conv_8_var);
+ (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr);
}
FREE(ret_var.data);
return ret_arr;
txdata_constr.data = NULL;
int64_t* txdata_vals = (*env)->GetLongArrayElements (env, txdata, NULL);
for (size_t y = 0; y < txdata_constr.datalen; y++) {
- int64_t arr_conv_24 = txdata_vals[y];
- LDKC2Tuple_usizeTransactionZ arr_conv_24_conv = *(LDKC2Tuple_usizeTransactionZ*)(((uint64_t)arr_conv_24) & ~1);
- FREE((void*)arr_conv_24);
- txdata_constr.data[y] = arr_conv_24_conv;
+ int64_t txdata_conv_24 = txdata_vals[y];
+ LDKC2Tuple_usizeTransactionZ txdata_conv_24_conv = *(LDKC2Tuple_usizeTransactionZ*)(((uint64_t)txdata_conv_24) & ~1);
+ FREE((void*)txdata_conv_24);
+ txdata_constr.data[y] = txdata_conv_24_conv;
}
(*env)->ReleaseLongArrayElements(env, txdata, txdata_vals, 0);
LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(((uint64_t)broadcaster) & ~1);
int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t u = 0; u < ret_var.datalen; u++) {
- LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* arr_conv_46_ref = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
- *arr_conv_46_ref = ret_var.data[u];
- ret_arr_ptr[u] = (long)arr_conv_46_ref;
+ LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_46_ref = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
+ *ret_conv_46_ref = ret_var.data[u];
+ ret_arr_ptr[u] = (long)ret_conv_46_ref;
}
(*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
FREE(ret_var.data);
OutPoint_free(this_ptr_conv);
}
-JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1txid(JNIEnv *env, jclass clz, int64_t this_ptr) {
- LDKOutPoint this_ptr_conv;
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1txid(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKOutPoint this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *OutPoint_get_txid(&this_ptr_conv));
+ return ret_arr;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1txid(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
+ LDKOutPoint this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKThirtyTwoBytes val_ref;
+ CHECK((*env)->GetArrayLength(env, val) == 32);
+ (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
+ OutPoint_set_txid(&this_ptr_conv, val_ref);
+}
+
+JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1index(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKOutPoint this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ int16_t ret_val = OutPoint_get_index(&this_ptr_conv);
+ return ret_val;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1index(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
+ LDKOutPoint this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ OutPoint_set_index(&this_ptr_conv, val);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1new(JNIEnv *env, jclass clz, int8_tArray txid_arg, int16_t index_arg) {
+ LDKThirtyTwoBytes txid_arg_ref;
+ CHECK((*env)->GetArrayLength(env, txid_arg) == 32);
+ (*env)->GetByteArrayRegion(env, txid_arg, 0, 32, txid_arg_ref.data);
+ LDKOutPoint ret_var = OutPoint_new(txid_arg_ref, index_arg);
+ 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;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKOutPoint orig_conv;
+ orig_conv.inner = (void*)(orig & (~1));
+ orig_conv.is_owned = false;
+ LDKOutPoint ret_var = OutPoint_clone(&orig_conv);
+ 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;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1to_1channel_1id(JNIEnv *env, jclass clz, int64_t this_arg) {
+ LDKOutPoint this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, OutPoint_to_channel_id(&this_arg_conv).data);
+ return ret_arr;
+}
+
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1write(JNIEnv *env, jclass clz, int64_t obj) {
+ LDKOutPoint obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z ret_var = OutPoint_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = (*env)->GetArrayLength(env, ser);
+ ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
+ LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
+ *ret_conv = OutPoint_read(ser_ref);
+ (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
+ return (long)ret_conv;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKDelayedPaymentOutputDescriptor this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+ DelayedPaymentOutputDescriptor_free(this_ptr_conv);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKDelayedPaymentOutputDescriptor this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKOutPoint ret_var = DelayedPaymentOutputDescriptor_get_outpoint(&this_ptr_conv);
+ 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;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
+ LDKDelayedPaymentOutputDescriptor this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKOutPoint val_conv;
+ val_conv.inner = (void*)(val & (~1));
+ val_conv.is_owned = (val & 1) || (val == 0);
+ val_conv = OutPoint_clone(&val_conv);
+ DelayedPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv);
+}
+
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKDelayedPaymentOutputDescriptor this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, DelayedPaymentOutputDescriptor_get_per_commitment_point(&this_ptr_conv).compressed_form);
+ return ret_arr;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
+ LDKDelayedPaymentOutputDescriptor this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKPublicKey val_ref;
+ CHECK((*env)->GetArrayLength(env, val) == 33);
+ (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
+ DelayedPaymentOutputDescriptor_set_per_commitment_point(&this_ptr_conv, val_ref);
+}
+
+JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKDelayedPaymentOutputDescriptor this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ int16_t ret_val = DelayedPaymentOutputDescriptor_get_to_self_delay(&this_ptr_conv);
+ return ret_val;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
+ LDKDelayedPaymentOutputDescriptor this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ DelayedPaymentOutputDescriptor_set_to_self_delay(&this_ptr_conv, val);
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1output(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
+ LDKDelayedPaymentOutputDescriptor this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKTxOut val_conv = *(LDKTxOut*)(((uint64_t)val) & ~1);
+ FREE((void*)val);
+ DelayedPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv);
+}
+
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1revocation_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKDelayedPaymentOutputDescriptor this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, DelayedPaymentOutputDescriptor_get_revocation_pubkey(&this_ptr_conv).compressed_form);
+ return ret_arr;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1revocation_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
+ LDKDelayedPaymentOutputDescriptor this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKPublicKey val_ref;
+ CHECK((*env)->GetArrayLength(env, val) == 33);
+ (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
+ DelayedPaymentOutputDescriptor_set_revocation_pubkey(&this_ptr_conv, val_ref);
+}
+
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKDelayedPaymentOutputDescriptor this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *DelayedPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv));
+ return ret_arr;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
+ LDKDelayedPaymentOutputDescriptor this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKThirtyTwoBytes val_ref;
+ CHECK((*env)->GetArrayLength(env, val) == 32);
+ (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
+ DelayedPaymentOutputDescriptor_set_channel_keys_id(&this_ptr_conv, val_ref);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKDelayedPaymentOutputDescriptor this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ int64_t ret_val = DelayedPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv);
+ return ret_val;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
+ LDKDelayedPaymentOutputDescriptor this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ DelayedPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1new(JNIEnv *env, jclass clz, int64_t outpoint_arg, int8_tArray per_commitment_point_arg, int16_t to_self_delay_arg, int64_t output_arg, int8_tArray revocation_pubkey_arg, int8_tArray channel_keys_id_arg, int64_t channel_value_satoshis_arg) {
+ LDKOutPoint outpoint_arg_conv;
+ outpoint_arg_conv.inner = (void*)(outpoint_arg & (~1));
+ outpoint_arg_conv.is_owned = (outpoint_arg & 1) || (outpoint_arg == 0);
+ outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv);
+ LDKPublicKey per_commitment_point_arg_ref;
+ CHECK((*env)->GetArrayLength(env, per_commitment_point_arg) == 33);
+ (*env)->GetByteArrayRegion(env, per_commitment_point_arg, 0, 33, per_commitment_point_arg_ref.compressed_form);
+ LDKTxOut output_arg_conv = *(LDKTxOut*)(((uint64_t)output_arg) & ~1);
+ FREE((void*)output_arg);
+ LDKPublicKey revocation_pubkey_arg_ref;
+ CHECK((*env)->GetArrayLength(env, revocation_pubkey_arg) == 33);
+ (*env)->GetByteArrayRegion(env, revocation_pubkey_arg, 0, 33, revocation_pubkey_arg_ref.compressed_form);
+ LDKThirtyTwoBytes channel_keys_id_arg_ref;
+ CHECK((*env)->GetArrayLength(env, channel_keys_id_arg) == 32);
+ (*env)->GetByteArrayRegion(env, channel_keys_id_arg, 0, 32, channel_keys_id_arg_ref.data);
+ LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_new(outpoint_arg_conv, per_commitment_point_arg_ref, to_self_delay_arg, output_arg_conv, revocation_pubkey_arg_ref, channel_keys_id_arg_ref, channel_value_satoshis_arg);
+ 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;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKDelayedPaymentOutputDescriptor orig_conv;
+ orig_conv.inner = (void*)(orig & (~1));
+ orig_conv.is_owned = false;
+ LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(&orig_conv);
+ 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;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKStaticPaymentOutputDescriptor this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+ StaticPaymentOutputDescriptor_free(this_ptr_conv);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKStaticPaymentOutputDescriptor this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKOutPoint ret_var = StaticPaymentOutputDescriptor_get_outpoint(&this_ptr_conv);
+ 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;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
+ LDKStaticPaymentOutputDescriptor this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKOutPoint val_conv;
+ val_conv.inner = (void*)(val & (~1));
+ val_conv.is_owned = (val & 1) || (val == 0);
+ val_conv = OutPoint_clone(&val_conv);
+ StaticPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv);
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1output(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
+ LDKStaticPaymentOutputDescriptor this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKTxOut val_conv = *(LDKTxOut*)(((uint64_t)val) & ~1);
+ FREE((void*)val);
+ StaticPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv);
+}
+
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKStaticPaymentOutputDescriptor this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
- (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *OutPoint_get_txid(&this_ptr_conv));
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *StaticPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv));
return ret_arr;
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1txid(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
- LDKOutPoint this_ptr_conv;
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
+ LDKStaticPaymentOutputDescriptor this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKThirtyTwoBytes val_ref;
CHECK((*env)->GetArrayLength(env, val) == 32);
(*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
- OutPoint_set_txid(&this_ptr_conv, val_ref);
+ StaticPaymentOutputDescriptor_set_channel_keys_id(&this_ptr_conv, val_ref);
}
-JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1index(JNIEnv *env, jclass clz, int64_t this_ptr) {
- LDKOutPoint this_ptr_conv;
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKStaticPaymentOutputDescriptor this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int16_t ret_val = OutPoint_get_index(&this_ptr_conv);
+ int64_t ret_val = StaticPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv);
return ret_val;
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1index(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
- LDKOutPoint this_ptr_conv;
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
+ LDKStaticPaymentOutputDescriptor this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- OutPoint_set_index(&this_ptr_conv, val);
+ StaticPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1new(JNIEnv *env, jclass clz, int8_tArray txid_arg, int16_t index_arg) {
- LDKThirtyTwoBytes txid_arg_ref;
- CHECK((*env)->GetArrayLength(env, txid_arg) == 32);
- (*env)->GetByteArrayRegion(env, txid_arg, 0, 32, txid_arg_ref.data);
- LDKOutPoint ret_var = OutPoint_new(txid_arg_ref, index_arg);
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1new(JNIEnv *env, jclass clz, int64_t outpoint_arg, int64_t output_arg, int8_tArray channel_keys_id_arg, int64_t channel_value_satoshis_arg) {
+ LDKOutPoint outpoint_arg_conv;
+ outpoint_arg_conv.inner = (void*)(outpoint_arg & (~1));
+ outpoint_arg_conv.is_owned = (outpoint_arg & 1) || (outpoint_arg == 0);
+ outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv);
+ LDKTxOut output_arg_conv = *(LDKTxOut*)(((uint64_t)output_arg) & ~1);
+ FREE((void*)output_arg);
+ LDKThirtyTwoBytes channel_keys_id_arg_ref;
+ CHECK((*env)->GetArrayLength(env, channel_keys_id_arg) == 32);
+ (*env)->GetByteArrayRegion(env, channel_keys_id_arg, 0, 32, channel_keys_id_arg_ref.data);
+ LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_new(outpoint_arg_conv, output_arg_conv, channel_keys_id_arg_ref, channel_value_satoshis_arg);
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_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1clone(JNIEnv *env, jclass clz, int64_t orig) {
- LDKOutPoint orig_conv;
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKStaticPaymentOutputDescriptor orig_conv;
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
- LDKOutPoint ret_var = OutPoint_clone(&orig_conv);
+ LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(&orig_conv);
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_ref;
}
-JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1to_1channel_1id(JNIEnv *env, jclass clz, int64_t this_arg) {
- LDKOutPoint this_arg_conv;
- this_arg_conv.inner = (void*)(this_arg & (~1));
- this_arg_conv.is_owned = false;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 32);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 32, OutPoint_to_channel_id(&this_arg_conv).data);
- return arg_arr;
-}
-
-JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1write(JNIEnv *env, jclass clz, int64_t obj) {
- LDKOutPoint obj_conv;
- obj_conv.inner = (void*)(obj & (~1));
- obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = OutPoint_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
-}
-
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
- LDKu8slice ser_ref;
- ser_ref.datalen = (*env)->GetArrayLength(env, ser);
- ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
- LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
- *ret_conv = OutPoint_read(ser_ref);
- (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
- return (long)ret_conv;
-}
-
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
LDKSpendableOutputDescriptor this_ptr_conv = *(LDKSpendableOutputDescriptor*)(((uint64_t)this_ptr) & ~1);
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1write(JNIEnv *env, jclass clz, int64_t obj) {
LDKSpendableOutputDescriptor* obj_conv = (LDKSpendableOutputDescriptor*)obj;
- LDKCVec_u8Z arg_var = SpendableOutputDescriptor_write(obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = SpendableOutputDescriptor_write(obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
return (long)ret_conv;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1clone(JNIEnv *env, jclass clz, int64_t orig) {
- LDKChannelKeys* orig_conv = (LDKChannelKeys*)orig;
- LDKChannelKeys* ret = MALLOC(sizeof(LDKChannelKeys), "LDKChannelKeys");
- *ret = ChannelKeys_clone(orig_conv);
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sign_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKSign* orig_conv = (LDKSign*)orig;
+ LDKSign* ret = MALLOC(sizeof(LDKSign), "LDKSign");
+ *ret = Sign_clone(orig_conv);
return (long)ret;
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Sign_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKChannelKeys this_ptr_conv = *(LDKChannelKeys*)(((uint64_t)this_ptr) & ~1);
+ LDKSign this_ptr_conv = *(LDKSign*)(((uint64_t)this_ptr) & ~1);
FREE((void*)this_ptr);
- ChannelKeys_free(this_ptr_conv);
+ Sign_free(this_ptr_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KeysInterface_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
KeysInterface_free(this_ptr_conv);
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
- LDKInMemoryChannelKeys this_ptr_conv;
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKInMemorySigner this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
- InMemoryChannelKeys_free(this_ptr_conv);
+ InMemorySigner_free(this_ptr_conv);
}
-JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1funding_1key(JNIEnv *env, jclass clz, int64_t this_ptr) {
- LDKInMemoryChannelKeys this_ptr_conv;
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1funding_1key(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKInMemorySigner this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
- (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemoryChannelKeys_get_funding_key(&this_ptr_conv));
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_funding_key(&this_ptr_conv));
return ret_arr;
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1funding_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
- LDKInMemoryChannelKeys this_ptr_conv;
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1funding_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
+ LDKInMemorySigner this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKSecretKey val_ref;
CHECK((*env)->GetArrayLength(env, val) == 32);
(*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes);
- InMemoryChannelKeys_set_funding_key(&this_ptr_conv, val_ref);
+ InMemorySigner_set_funding_key(&this_ptr_conv, val_ref);
}
-JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1revocation_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr) {
- LDKInMemoryChannelKeys this_ptr_conv;
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1revocation_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKInMemorySigner this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
- (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemoryChannelKeys_get_revocation_base_key(&this_ptr_conv));
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_revocation_base_key(&this_ptr_conv));
return ret_arr;
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1revocation_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
- LDKInMemoryChannelKeys this_ptr_conv;
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1revocation_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
+ LDKInMemorySigner this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKSecretKey val_ref;
CHECK((*env)->GetArrayLength(env, val) == 32);
(*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes);
- InMemoryChannelKeys_set_revocation_base_key(&this_ptr_conv, val_ref);
+ InMemorySigner_set_revocation_base_key(&this_ptr_conv, val_ref);
}
-JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1payment_1key(JNIEnv *env, jclass clz, int64_t this_ptr) {
- LDKInMemoryChannelKeys this_ptr_conv;
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1payment_1key(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKInMemorySigner this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
- (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemoryChannelKeys_get_payment_key(&this_ptr_conv));
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_payment_key(&this_ptr_conv));
return ret_arr;
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1payment_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
- LDKInMemoryChannelKeys this_ptr_conv;
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1payment_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
+ LDKInMemorySigner this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKSecretKey val_ref;
CHECK((*env)->GetArrayLength(env, val) == 32);
(*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes);
- InMemoryChannelKeys_set_payment_key(&this_ptr_conv, val_ref);
+ InMemorySigner_set_payment_key(&this_ptr_conv, val_ref);
}
-JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1delayed_1payment_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr) {
- LDKInMemoryChannelKeys this_ptr_conv;
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1delayed_1payment_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKInMemorySigner this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
- (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemoryChannelKeys_get_delayed_payment_base_key(&this_ptr_conv));
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_delayed_payment_base_key(&this_ptr_conv));
return ret_arr;
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1delayed_1payment_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
- LDKInMemoryChannelKeys this_ptr_conv;
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1delayed_1payment_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
+ LDKInMemorySigner this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKSecretKey val_ref;
CHECK((*env)->GetArrayLength(env, val) == 32);
(*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes);
- InMemoryChannelKeys_set_delayed_payment_base_key(&this_ptr_conv, val_ref);
+ InMemorySigner_set_delayed_payment_base_key(&this_ptr_conv, val_ref);
}
-JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1htlc_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr) {
- LDKInMemoryChannelKeys this_ptr_conv;
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1htlc_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKInMemorySigner this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
- (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemoryChannelKeys_get_htlc_base_key(&this_ptr_conv));
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_htlc_base_key(&this_ptr_conv));
return ret_arr;
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1htlc_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
- LDKInMemoryChannelKeys this_ptr_conv;
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1htlc_1base_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
+ LDKInMemorySigner this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKSecretKey val_ref;
CHECK((*env)->GetArrayLength(env, val) == 32);
(*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes);
- InMemoryChannelKeys_set_htlc_base_key(&this_ptr_conv, val_ref);
+ InMemorySigner_set_htlc_base_key(&this_ptr_conv, val_ref);
}
-JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1commitment_1seed(JNIEnv *env, jclass clz, int64_t this_ptr) {
- LDKInMemoryChannelKeys this_ptr_conv;
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1commitment_1seed(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKInMemorySigner this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
- (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemoryChannelKeys_get_commitment_seed(&this_ptr_conv));
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_commitment_seed(&this_ptr_conv));
return ret_arr;
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1commitment_1seed(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
- LDKInMemoryChannelKeys this_ptr_conv;
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1commitment_1seed(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
+ LDKInMemorySigner this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKThirtyTwoBytes val_ref;
CHECK((*env)->GetArrayLength(env, val) == 32);
(*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
- InMemoryChannelKeys_set_commitment_seed(&this_ptr_conv, val_ref);
+ InMemorySigner_set_commitment_seed(&this_ptr_conv, val_ref);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1clone(JNIEnv *env, jclass clz, int64_t orig) {
- LDKInMemoryChannelKeys orig_conv;
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKInMemorySigner orig_conv;
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
- LDKInMemoryChannelKeys ret_var = InMemoryChannelKeys_clone(&orig_conv);
+ LDKInMemorySigner ret_var = InMemorySigner_clone(&orig_conv);
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_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1new(JNIEnv *env, jclass clz, int8_tArray funding_key, int8_tArray revocation_base_key, int8_tArray payment_key, int8_tArray delayed_payment_base_key, int8_tArray htlc_base_key, int8_tArray commitment_seed, int64_t channel_value_satoshis, int64_t key_derivation_params) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1new(JNIEnv *env, jclass clz, int8_tArray funding_key, int8_tArray revocation_base_key, int8_tArray payment_key, int8_tArray delayed_payment_base_key, int8_tArray htlc_base_key, int8_tArray commitment_seed, int64_t channel_value_satoshis, int8_tArray channel_keys_id) {
LDKSecretKey funding_key_ref;
CHECK((*env)->GetArrayLength(env, funding_key) == 32);
(*env)->GetByteArrayRegion(env, funding_key, 0, 32, funding_key_ref.bytes);
LDKThirtyTwoBytes commitment_seed_ref;
CHECK((*env)->GetArrayLength(env, commitment_seed) == 32);
(*env)->GetByteArrayRegion(env, commitment_seed, 0, 32, commitment_seed_ref.data);
- LDKC2Tuple_u64u64Z key_derivation_params_conv = *(LDKC2Tuple_u64u64Z*)(((uint64_t)key_derivation_params) & ~1);
- FREE((void*)key_derivation_params);
- LDKInMemoryChannelKeys ret_var = InMemoryChannelKeys_new(funding_key_ref, revocation_base_key_ref, payment_key_ref, delayed_payment_base_key_ref, htlc_base_key_ref, commitment_seed_ref, channel_value_satoshis, key_derivation_params_conv);
+ LDKThirtyTwoBytes channel_keys_id_ref;
+ CHECK((*env)->GetArrayLength(env, channel_keys_id) == 32);
+ (*env)->GetByteArrayRegion(env, channel_keys_id, 0, 32, channel_keys_id_ref.data);
+ LDKInMemorySigner ret_var = InMemorySigner_new(funding_key_ref, revocation_base_key_ref, payment_key_ref, delayed_payment_base_key_ref, htlc_base_key_ref, commitment_seed_ref, channel_value_satoshis, channel_keys_id_ref);
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_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1counterparty_1pubkeys(JNIEnv *env, jclass clz, int64_t this_arg) {
- LDKInMemoryChannelKeys this_arg_conv;
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1counterparty_1pubkeys(JNIEnv *env, jclass clz, int64_t this_arg) {
+ LDKInMemorySigner this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKChannelPublicKeys ret_var = InMemoryChannelKeys_counterparty_pubkeys(&this_arg_conv);
+ LDKChannelPublicKeys ret_var = InMemorySigner_counterparty_pubkeys(&this_arg_conv);
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_ref;
}
-JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1counterparty_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_arg) {
- LDKInMemoryChannelKeys this_arg_conv;
+JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1counterparty_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_arg) {
+ LDKInMemorySigner this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- int16_t ret_val = InMemoryChannelKeys_counterparty_selected_contest_delay(&this_arg_conv);
+ int16_t ret_val = InMemorySigner_counterparty_selected_contest_delay(&this_arg_conv);
return ret_val;
}
-JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1holder_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_arg) {
- LDKInMemoryChannelKeys this_arg_conv;
+JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1holder_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_arg) {
+ LDKInMemorySigner this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- int16_t ret_val = InMemoryChannelKeys_holder_selected_contest_delay(&this_arg_conv);
+ int16_t ret_val = InMemorySigner_holder_selected_contest_delay(&this_arg_conv);
return ret_val;
}
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1is_1outbound(JNIEnv *env, jclass clz, int64_t this_arg) {
- LDKInMemoryChannelKeys this_arg_conv;
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1is_1outbound(JNIEnv *env, jclass clz, int64_t this_arg) {
+ LDKInMemorySigner this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- jboolean ret_val = InMemoryChannelKeys_is_outbound(&this_arg_conv);
+ jboolean ret_val = InMemorySigner_is_outbound(&this_arg_conv);
return ret_val;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1funding_1outpoint(JNIEnv *env, jclass clz, int64_t this_arg) {
- LDKInMemoryChannelKeys this_arg_conv;
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1funding_1outpoint(JNIEnv *env, jclass clz, int64_t this_arg) {
+ LDKInMemorySigner this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKOutPoint ret_var = InMemoryChannelKeys_funding_outpoint(&this_arg_conv);
+ LDKOutPoint ret_var = InMemorySigner_funding_outpoint(&this_arg_conv);
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_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1channel_1parameters(JNIEnv *env, jclass clz, int64_t this_arg) {
- LDKInMemoryChannelKeys this_arg_conv;
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1channel_1parameters(JNIEnv *env, jclass clz, int64_t this_arg) {
+ LDKInMemorySigner this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKChannelTransactionParameters ret_var = InMemoryChannelKeys_get_channel_parameters(&this_arg_conv);
+ LDKChannelTransactionParameters ret_var = InMemorySigner_get_channel_parameters(&this_arg_conv);
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_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1as_1ChannelKeys(JNIEnv *env, jclass clz, int64_t this_arg) {
- LDKInMemoryChannelKeys this_arg_conv;
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1sign_1counterparty_1payment_1input(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray spend_tx, int64_t input_idx, int64_t descriptor) {
+ LDKInMemorySigner this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ LDKTransaction spend_tx_ref;
+ spend_tx_ref.datalen = (*env)->GetArrayLength(env, spend_tx);
+ spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes");
+ (*env)->GetByteArrayRegion(env, spend_tx, 0, spend_tx_ref.datalen, spend_tx_ref.data);
+ spend_tx_ref.data_is_owned = true;
+ LDKStaticPaymentOutputDescriptor descriptor_conv;
+ descriptor_conv.inner = (void*)(descriptor & (~1));
+ descriptor_conv.is_owned = false;
+ LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
+ *ret_conv = InMemorySigner_sign_counterparty_payment_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv);
+ return (long)ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1sign_1dynamic_1p2wsh_1input(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray spend_tx, int64_t input_idx, int64_t descriptor) {
+ LDKInMemorySigner this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ LDKTransaction spend_tx_ref;
+ spend_tx_ref.datalen = (*env)->GetArrayLength(env, spend_tx);
+ spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes");
+ (*env)->GetByteArrayRegion(env, spend_tx, 0, spend_tx_ref.datalen, spend_tx_ref.data);
+ spend_tx_ref.data_is_owned = true;
+ LDKDelayedPaymentOutputDescriptor descriptor_conv;
+ descriptor_conv.inner = (void*)(descriptor & (~1));
+ descriptor_conv.is_owned = false;
+ LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
+ *ret_conv = InMemorySigner_sign_dynamic_p2wsh_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv);
+ return (long)ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1as_1Sign(JNIEnv *env, jclass clz, int64_t this_arg) {
+ LDKInMemorySigner this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKChannelKeys* ret = MALLOC(sizeof(LDKChannelKeys), "LDKChannelKeys");
- *ret = InMemoryChannelKeys_as_ChannelKeys(&this_arg_conv);
+ LDKSign* ret = MALLOC(sizeof(LDKSign), "LDKSign");
+ *ret = InMemorySigner_as_Sign(&this_arg_conv);
return (long)ret;
}
-JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1write(JNIEnv *env, jclass clz, int64_t obj) {
- LDKInMemoryChannelKeys obj_conv;
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1write(JNIEnv *env, jclass clz, int64_t obj) {
+ LDKInMemorySigner obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = InMemoryChannelKeys_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = InMemorySigner_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = (*env)->GetArrayLength(env, ser);
ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
- LDKCResult_InMemoryChannelKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemoryChannelKeysDecodeErrorZ), "LDKCResult_InMemoryChannelKeysDecodeErrorZ");
- *ret_conv = InMemoryChannelKeys_read(ser_ref);
+ LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
+ *ret_conv = InMemorySigner_read(ser_ref);
(*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
return (long)ret_conv;
}
KeysManager_free(this_ptr_conv);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1new(JNIEnv *env, jclass clz, int8_tArray seed, jclass network, int64_t starting_time_secs, int32_t starting_time_nanos) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1new(JNIEnv *env, jclass clz, int8_tArray seed, int64_t starting_time_secs, int32_t starting_time_nanos) {
unsigned char seed_arr[32];
CHECK((*env)->GetArrayLength(env, seed) == 32);
(*env)->GetByteArrayRegion(env, seed, 0, 32, seed_arr);
unsigned char (*seed_ref)[32] = &seed_arr;
- LDKNetwork network_conv = LDKNetwork_from_java(env, network);
- LDKKeysManager ret_var = KeysManager_new(seed_ref, network_conv, starting_time_secs, starting_time_nanos);
+ LDKKeysManager ret_var = KeysManager_new(seed_ref, starting_time_secs, starting_time_nanos);
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_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1derive_1channel_1keys(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_value_satoshis, int64_t params_1, int64_t params_2) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1derive_1channel_1keys(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_value_satoshis, int8_tArray params) {
LDKKeysManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKInMemoryChannelKeys ret_var = KeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_1, params_2);
+ unsigned char params_arr[32];
+ CHECK((*env)->GetArrayLength(env, params) == 32);
+ (*env)->GetByteArrayRegion(env, params, 0, 32, params_arr);
+ unsigned char (*params_ref)[32] = ¶ms_arr;
+ LDKInMemorySigner ret_var = KeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_ref);
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_ref;
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1spend_1spendable_1outputs(JNIEnv *env, jclass clz, int64_t this_arg, int64_tArray descriptors, int64_tArray outputs, int8_tArray change_destination_script, int32_t feerate_sat_per_1000_weight) {
+ LDKKeysManager this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ LDKCVec_SpendableOutputDescriptorZ descriptors_constr;
+ descriptors_constr.datalen = (*env)->GetArrayLength(env, descriptors);
+ if (descriptors_constr.datalen > 0)
+ descriptors_constr.data = MALLOC(descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements");
+ else
+ descriptors_constr.data = NULL;
+ int64_t* descriptors_vals = (*env)->GetLongArrayElements (env, descriptors, NULL);
+ for (size_t b = 0; b < descriptors_constr.datalen; b++) {
+ int64_t descriptors_conv_27 = descriptors_vals[b];
+ LDKSpendableOutputDescriptor descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(((uint64_t)descriptors_conv_27) & ~1);
+ FREE((void*)descriptors_conv_27);
+ descriptors_constr.data[b] = descriptors_conv_27_conv;
+ }
+ (*env)->ReleaseLongArrayElements(env, descriptors, descriptors_vals, 0);
+ LDKCVec_TxOutZ outputs_constr;
+ outputs_constr.datalen = (*env)->GetArrayLength(env, outputs);
+ if (outputs_constr.datalen > 0)
+ outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements");
+ else
+ outputs_constr.data = NULL;
+ int64_t* outputs_vals = (*env)->GetLongArrayElements (env, outputs, NULL);
+ for (size_t h = 0; h < outputs_constr.datalen; h++) {
+ int64_t outputs_conv_7 = outputs_vals[h];
+ LDKTxOut outputs_conv_7_conv = *(LDKTxOut*)(((uint64_t)outputs_conv_7) & ~1);
+ FREE((void*)outputs_conv_7);
+ outputs_constr.data[h] = outputs_conv_7_conv;
+ }
+ (*env)->ReleaseLongArrayElements(env, outputs, outputs_vals, 0);
+ LDKCVec_u8Z change_destination_script_ref;
+ change_destination_script_ref.datalen = (*env)->GetArrayLength(env, change_destination_script);
+ change_destination_script_ref.data = MALLOC(change_destination_script_ref.datalen, "LDKCVec_u8Z Bytes");
+ (*env)->GetByteArrayRegion(env, change_destination_script, 0, change_destination_script_ref.datalen, change_destination_script_ref.data);
+ LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
+ *ret_conv = KeysManager_spend_spendable_outputs(&this_arg_conv, descriptors_constr, outputs_constr, change_destination_script_ref, feerate_sat_per_1000_weight);
+ return (long)ret_conv;
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1KeysInterface(JNIEnv *env, jclass clz, int64_t this_arg) {
LDKKeysManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
LDKChannelDetails this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 33);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 33, ChannelDetails_get_remote_network_id(&this_ptr_conv).compressed_form);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelDetails_get_remote_network_id(&this_ptr_conv).compressed_form);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1remote_1network_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
- LDKPaymentSendFailure this_ptr_conv;
- this_ptr_conv.inner = (void*)(this_ptr & (~1));
- this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+ if ((this_ptr & 1) != 0) return;
+ LDKPaymentSendFailure this_ptr_conv = *(LDKPaymentSendFailure*)(((uint64_t)this_ptr) & ~1);
+ FREE((void*)this_ptr);
PaymentSendFailure_free(this_ptr_conv);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1clone(JNIEnv *env, jclass clz, int64_t orig) {
- LDKPaymentSendFailure orig_conv;
- orig_conv.inner = (void*)(orig & (~1));
- orig_conv.is_owned = false;
- LDKPaymentSendFailure ret_var = PaymentSendFailure_clone(&orig_conv);
- 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;
- if (ret_var.is_owned) {
- ret_ref |= 1;
- }
+ LDKPaymentSendFailure* orig_conv = (LDKPaymentSendFailure*)orig;
+ LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
+ *ret_copy = PaymentSendFailure_clone(orig_conv);
+ long ret_ref = (long)ret_copy;
return ret_ref;
}
int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t q = 0; q < ret_var.datalen; q++) {
- LDKChannelDetails arr_conv_16_var = ret_var.data[q];
- CHECK((((long)arr_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
- CHECK((((long)&arr_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- long arr_conv_16_ref = (long)arr_conv_16_var.inner;
- if (arr_conv_16_var.is_owned) {
- arr_conv_16_ref |= 1;
+ LDKChannelDetails ret_conv_16_var = ret_var.data[q];
+ CHECK((((long)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_conv_16_ref = (long)ret_conv_16_var.inner;
+ if (ret_conv_16_var.is_owned) {
+ ret_conv_16_ref |= 1;
}
- ret_arr_ptr[q] = arr_conv_16_ref;
+ ret_arr_ptr[q] = ret_conv_16_ref;
}
(*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
FREE(ret_var.data);
int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t q = 0; q < ret_var.datalen; q++) {
- LDKChannelDetails arr_conv_16_var = ret_var.data[q];
- CHECK((((long)arr_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
- CHECK((((long)&arr_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- long arr_conv_16_ref = (long)arr_conv_16_var.inner;
- if (arr_conv_16_var.is_owned) {
- arr_conv_16_ref |= 1;
+ LDKChannelDetails ret_conv_16_var = ret_var.data[q];
+ CHECK((((long)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_conv_16_ref = (long)ret_conv_16_var.inner;
+ if (ret_conv_16_var.is_owned) {
+ ret_conv_16_ref |= 1;
}
- ret_arr_ptr[q] = arr_conv_16_ref;
+ ret_arr_ptr[q] = ret_conv_16_ref;
}
(*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
FREE(ret_var.data);
addresses_constr.data = NULL;
int64_t* addresses_vals = (*env)->GetLongArrayElements (env, addresses, NULL);
for (size_t m = 0; m < addresses_constr.datalen; m++) {
- int64_t arr_conv_12 = addresses_vals[m];
- LDKNetAddress arr_conv_12_conv = *(LDKNetAddress*)(((uint64_t)arr_conv_12) & ~1);
- FREE((void*)arr_conv_12);
- addresses_constr.data[m] = arr_conv_12_conv;
+ int64_t addresses_conv_12 = addresses_vals[m];
+ LDKNetAddress addresses_conv_12_conv = *(LDKNetAddress*)(((uint64_t)addresses_conv_12) & ~1);
+ FREE((void*)addresses_conv_12);
+ addresses_constr.data[m] = addresses_conv_12_conv;
}
(*env)->ReleaseLongArrayElements(env, addresses, addresses_vals, 0);
ChannelManager_broadcast_node_announcement(&this_arg_conv, rgb_ref, alias_ref, addresses_constr);
LDKChannelManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 33);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 33, ChannelManager_get_our_node_id(&this_arg_conv).compressed_form);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelManager_get_our_node_id(&this_arg_conv).compressed_form);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1channel_1monitor_1updated(JNIEnv *env, jclass clz, int64_t this_arg, int64_t funding_txo, int64_t highest_applied_update_id) {
return (long)ret;
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1Listen(JNIEnv *env, jclass clz, int64_t this_arg) {
+ LDKChannelManager this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ LDKListen* ret = MALLOC(sizeof(LDKListen), "LDKListen");
+ *ret = ChannelManager_as_Listen(&this_arg_conv);
+ return (long)ret;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1block_1connected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray header, int64_tArray txdata, int32_t height) {
LDKChannelManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
txdata_constr.data = NULL;
int64_t* txdata_vals = (*env)->GetLongArrayElements (env, txdata, NULL);
for (size_t y = 0; y < txdata_constr.datalen; y++) {
- int64_t arr_conv_24 = txdata_vals[y];
- LDKC2Tuple_usizeTransactionZ arr_conv_24_conv = *(LDKC2Tuple_usizeTransactionZ*)(((uint64_t)arr_conv_24) & ~1);
- FREE((void*)arr_conv_24);
- txdata_constr.data[y] = arr_conv_24_conv;
+ int64_t txdata_conv_24 = txdata_vals[y];
+ LDKC2Tuple_usizeTransactionZ txdata_conv_24_conv = *(LDKC2Tuple_usizeTransactionZ*)(((uint64_t)txdata_conv_24) & ~1);
+ FREE((void*)txdata_conv_24);
+ txdata_constr.data[y] = txdata_conv_24_conv;
}
(*env)->ReleaseLongArrayElements(env, txdata, txdata_vals, 0);
ChannelManager_block_connected(&this_arg_conv, header_ref, txdata_constr, height);
ChannelManager_block_disconnected(&this_arg_conv, header_ref);
}
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1await_1persistable_1update(JNIEnv *env, jclass clz, int64_t this_arg) {
+ LDKChannelManager this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ ChannelManager_await_persistable_update(&this_arg_conv);
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1ChannelMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) {
LDKChannelManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
LDKChannelManager obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = ChannelManager_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = ChannelManager_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
channel_monitors_constr.data = NULL;
int64_t* channel_monitors_vals = (*env)->GetLongArrayElements (env, channel_monitors, NULL);
for (size_t q = 0; q < channel_monitors_constr.datalen; q++) {
- int64_t arr_conv_16 = channel_monitors_vals[q];
- LDKChannelMonitor arr_conv_16_conv;
- arr_conv_16_conv.inner = (void*)(arr_conv_16 & (~1));
- arr_conv_16_conv.is_owned = (arr_conv_16 & 1) || (arr_conv_16 == 0);
- channel_monitors_constr.data[q] = arr_conv_16_conv;
+ int64_t channel_monitors_conv_16 = channel_monitors_vals[q];
+ LDKChannelMonitor channel_monitors_conv_16_conv;
+ channel_monitors_conv_16_conv.inner = (void*)(channel_monitors_conv_16 & (~1));
+ channel_monitors_conv_16_conv.is_owned = (channel_monitors_conv_16 & 1) || (channel_monitors_conv_16 == 0);
+ channel_monitors_constr.data[q] = channel_monitors_conv_16_conv;
}
(*env)->ReleaseLongArrayElements(env, channel_monitors, channel_monitors_vals, 0);
LDKChannelManagerReadArgs ret_var = ChannelManagerReadArgs_new(keys_manager_conv, fee_estimator_conv, chain_monitor_conv, tx_broadcaster_conv, logger_conv, default_config_conv, channel_monitors_constr);
Init_free(this_ptr_conv);
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKInit this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKInitFeatures ret_var = Init_get_features(&this_ptr_conv);
+ 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;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Init_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
+ LDKInit this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKInitFeatures val_conv;
+ val_conv.inner = (void*)(val & (~1));
+ val_conv.is_owned = (val & 1) || (val == 0);
+ val_conv = InitFeatures_clone(&val_conv);
+ Init_set_features(&this_ptr_conv, val_conv);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1new(JNIEnv *env, jclass clz, int64_t features_arg) {
+ LDKInitFeatures features_arg_conv;
+ features_arg_conv.inner = (void*)(features_arg & (~1));
+ features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0);
+ features_arg_conv = InitFeatures_clone(&features_arg_conv);
+ LDKInit ret_var = Init_new(features_arg_conv);
+ 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;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1clone(JNIEnv *env, jclass clz, int64_t orig) {
LDKInit orig_conv;
orig_conv.inner = (void*)(orig & (~1));
LDKOpenChannel this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 33);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 33, OpenChannel_get_funding_pubkey(&this_ptr_conv).compressed_form);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_funding_pubkey(&this_ptr_conv).compressed_form);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
LDKOpenChannel this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 33);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 33, OpenChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
LDKOpenChannel this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 33);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 33, OpenChannel_get_payment_point(&this_ptr_conv).compressed_form);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_payment_point(&this_ptr_conv).compressed_form);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1payment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
LDKOpenChannel this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 33);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 33, OpenChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1delayed_1payment_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
LDKOpenChannel this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 33);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 33, OpenChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1htlc_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
LDKOpenChannel this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 33);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 33, OpenChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1first_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
LDKAcceptChannel this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 33);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 33, AcceptChannel_get_funding_pubkey(&this_ptr_conv).compressed_form);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_funding_pubkey(&this_ptr_conv).compressed_form);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
LDKAcceptChannel this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 33);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 33, AcceptChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
LDKAcceptChannel this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 33);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 33, AcceptChannel_get_payment_point(&this_ptr_conv).compressed_form);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_payment_point(&this_ptr_conv).compressed_form);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1payment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
LDKAcceptChannel this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 33);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 33, AcceptChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1delayed_1payment_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
LDKAcceptChannel this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 33);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 33, AcceptChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1htlc_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
LDKAcceptChannel this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 33);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 33, AcceptChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1first_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
LDKFundingCreated this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 64);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 64, FundingCreated_get_signature(&this_ptr_conv).compact_form);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, FundingCreated_get_signature(&this_ptr_conv).compact_form);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
LDKFundingSigned this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 64);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 64, FundingSigned_get_signature(&this_ptr_conv).compact_form);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, FundingSigned_get_signature(&this_ptr_conv).compact_form);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
LDKFundingLocked this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 33);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 33, FundingLocked_get_next_per_commitment_point(&this_ptr_conv).compressed_form);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, FundingLocked_get_next_per_commitment_point(&this_ptr_conv).compressed_form);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1set_1next_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
LDKShutdown this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKu8slice arg_var = Shutdown_get_scriptpubkey(&this_ptr_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- return arg_arr;
+ LDKu8slice ret_var = Shutdown_get_scriptpubkey(&this_ptr_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1set_1scriptpubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
LDKClosingSigned this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 64);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 64, ClosingSigned_get_signature(&this_ptr_conv).compact_form);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ClosingSigned_get_signature(&this_ptr_conv).compact_form);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
LDKCommitmentSigned this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 64);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 64, CommitmentSigned_get_signature(&this_ptr_conv).compact_form);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, CommitmentSigned_get_signature(&this_ptr_conv).compact_form);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
else
val_constr.data = NULL;
for (size_t i = 0; i < val_constr.datalen; i++) {
- int8_tArray arr_conv_8 = (*env)->GetObjectArrayElement(env, val, i);
- LDKSignature arr_conv_8_ref;
- CHECK((*env)->GetArrayLength(env, arr_conv_8) == 64);
- (*env)->GetByteArrayRegion(env, arr_conv_8, 0, 64, arr_conv_8_ref.compact_form);
- val_constr.data[i] = arr_conv_8_ref;
+ int8_tArray val_conv_8 = (*env)->GetObjectArrayElement(env, val, i);
+ LDKSignature val_conv_8_ref;
+ CHECK((*env)->GetArrayLength(env, val_conv_8) == 64);
+ (*env)->GetByteArrayRegion(env, val_conv_8, 0, 64, val_conv_8_ref.compact_form);
+ val_constr.data[i] = val_conv_8_ref;
}
CommitmentSigned_set_htlc_signatures(&this_ptr_conv, val_constr);
}
else
htlc_signatures_arg_constr.data = NULL;
for (size_t i = 0; i < htlc_signatures_arg_constr.datalen; i++) {
- int8_tArray arr_conv_8 = (*env)->GetObjectArrayElement(env, htlc_signatures_arg, i);
- LDKSignature arr_conv_8_ref;
- CHECK((*env)->GetArrayLength(env, arr_conv_8) == 64);
- (*env)->GetByteArrayRegion(env, arr_conv_8, 0, 64, arr_conv_8_ref.compact_form);
- htlc_signatures_arg_constr.data[i] = arr_conv_8_ref;
+ int8_tArray htlc_signatures_arg_conv_8 = (*env)->GetObjectArrayElement(env, htlc_signatures_arg, i);
+ LDKSignature htlc_signatures_arg_conv_8_ref;
+ CHECK((*env)->GetArrayLength(env, htlc_signatures_arg_conv_8) == 64);
+ (*env)->GetByteArrayRegion(env, htlc_signatures_arg_conv_8, 0, 64, htlc_signatures_arg_conv_8_ref.compact_form);
+ htlc_signatures_arg_constr.data[i] = htlc_signatures_arg_conv_8_ref;
}
LDKCommitmentSigned ret_var = CommitmentSigned_new(channel_id_arg_ref, signature_arg_ref, htlc_signatures_arg_constr);
CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
LDKRevokeAndACK this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 33);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 33, RevokeAndACK_get_next_per_commitment_point(&this_ptr_conv).compressed_form);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, RevokeAndACK_get_next_per_commitment_point(&this_ptr_conv).compressed_form);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1next_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
LDKDataLossProtect this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 33);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 33, DataLossProtect_get_my_current_per_commitment_point(&this_ptr_conv).compressed_form);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, DataLossProtect_get_my_current_per_commitment_point(&this_ptr_conv).compressed_form);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1set_1my_1current_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
LDKAnnouncementSignatures this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 64);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 64, AnnouncementSignatures_get_node_signature(&this_ptr_conv).compact_form);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, AnnouncementSignatures_get_node_signature(&this_ptr_conv).compact_form);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1node_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
LDKAnnouncementSignatures this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 64);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 64, AnnouncementSignatures_get_bitcoin_signature(&this_ptr_conv).compact_form);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, AnnouncementSignatures_get_bitcoin_signature(&this_ptr_conv).compact_form);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1bitcoin_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NetAddress_1write(JNIEnv *env, jclass clz, int64_t obj) {
LDKNetAddress* obj_conv = (LDKNetAddress*)obj;
- LDKCVec_u8Z arg_var = NetAddress_write(obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = NetAddress_write(obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Result_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKUnsignedNodeAnnouncement this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 33);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 33, UnsignedNodeAnnouncement_get_node_id(&this_ptr_conv).compressed_form);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedNodeAnnouncement_get_node_id(&this_ptr_conv).compressed_form);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
val_constr.data = NULL;
int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
for (size_t m = 0; m < val_constr.datalen; m++) {
- int64_t arr_conv_12 = val_vals[m];
- LDKNetAddress arr_conv_12_conv = *(LDKNetAddress*)(((uint64_t)arr_conv_12) & ~1);
- FREE((void*)arr_conv_12);
- val_constr.data[m] = arr_conv_12_conv;
+ int64_t val_conv_12 = val_vals[m];
+ LDKNetAddress val_conv_12_conv = *(LDKNetAddress*)(((uint64_t)val_conv_12) & ~1);
+ FREE((void*)val_conv_12);
+ val_constr.data[m] = val_conv_12_conv;
}
(*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
UnsignedNodeAnnouncement_set_addresses(&this_ptr_conv, val_constr);
LDKNodeAnnouncement this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 64);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 64, NodeAnnouncement_get_signature(&this_ptr_conv).compact_form);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, NodeAnnouncement_get_signature(&this_ptr_conv).compact_form);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
LDKUnsignedChannelAnnouncement this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 33);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 33, UnsignedChannelAnnouncement_get_node_id_1(&this_ptr_conv).compressed_form);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedChannelAnnouncement_get_node_id_1(&this_ptr_conv).compressed_form);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1node_1id_11(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
LDKUnsignedChannelAnnouncement this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 33);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 33, UnsignedChannelAnnouncement_get_node_id_2(&this_ptr_conv).compressed_form);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedChannelAnnouncement_get_node_id_2(&this_ptr_conv).compressed_form);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1node_1id_12(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
LDKUnsignedChannelAnnouncement this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 33);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 33, UnsignedChannelAnnouncement_get_bitcoin_key_1(&this_ptr_conv).compressed_form);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedChannelAnnouncement_get_bitcoin_key_1(&this_ptr_conv).compressed_form);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1bitcoin_1key_11(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
LDKUnsignedChannelAnnouncement this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 33);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 33, UnsignedChannelAnnouncement_get_bitcoin_key_2(&this_ptr_conv).compressed_form);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedChannelAnnouncement_get_bitcoin_key_2(&this_ptr_conv).compressed_form);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1bitcoin_1key_12(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
LDKChannelAnnouncement this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 64);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 64, ChannelAnnouncement_get_node_signature_1(&this_ptr_conv).compact_form);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelAnnouncement_get_node_signature_1(&this_ptr_conv).compact_form);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node_1signature_11(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
LDKChannelAnnouncement this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 64);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 64, ChannelAnnouncement_get_node_signature_2(&this_ptr_conv).compact_form);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelAnnouncement_get_node_signature_2(&this_ptr_conv).compact_form);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node_1signature_12(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
LDKChannelAnnouncement this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 64);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 64, ChannelAnnouncement_get_bitcoin_signature_1(&this_ptr_conv).compact_form);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelAnnouncement_get_bitcoin_signature_1(&this_ptr_conv).compact_form);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitcoin_1signature_11(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
LDKChannelAnnouncement this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 64);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 64, ChannelAnnouncement_get_bitcoin_signature_2(&this_ptr_conv).compact_form);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelAnnouncement_get_bitcoin_signature_2(&this_ptr_conv).compact_form);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitcoin_1signature_12(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
LDKChannelUpdate this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 64);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 64, ChannelUpdate_get_signature(&this_ptr_conv).compact_form);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelUpdate_get_signature(&this_ptr_conv).compact_form);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
val_constr.data = NULL;
int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
for (size_t g = 0; g < val_constr.datalen; g++) {
- int64_t arr_conv_6 = val_vals[g];
- val_constr.data[g] = arr_conv_6;
+ int64_t val_conv_6 = val_vals[g];
+ val_constr.data[g] = val_conv_6;
}
(*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
ReplyChannelRange_set_short_channel_ids(&this_ptr_conv, val_constr);
short_channel_ids_arg_constr.data = NULL;
int64_t* short_channel_ids_arg_vals = (*env)->GetLongArrayElements (env, short_channel_ids_arg, NULL);
for (size_t g = 0; g < short_channel_ids_arg_constr.datalen; g++) {
- int64_t arr_conv_6 = short_channel_ids_arg_vals[g];
- short_channel_ids_arg_constr.data[g] = arr_conv_6;
+ int64_t short_channel_ids_arg_conv_6 = short_channel_ids_arg_vals[g];
+ short_channel_ids_arg_constr.data[g] = short_channel_ids_arg_conv_6;
}
(*env)->ReleaseLongArrayElements(env, short_channel_ids_arg, short_channel_ids_arg_vals, 0);
LDKReplyChannelRange ret_var = ReplyChannelRange_new(chain_hash_arg_ref, first_blocknum_arg, number_of_blocks_arg, sync_complete_arg, short_channel_ids_arg_constr);
val_constr.data = NULL;
int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
for (size_t g = 0; g < val_constr.datalen; g++) {
- int64_t arr_conv_6 = val_vals[g];
- val_constr.data[g] = arr_conv_6;
+ int64_t val_conv_6 = val_vals[g];
+ val_constr.data[g] = val_conv_6;
}
(*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
QueryShortChannelIds_set_short_channel_ids(&this_ptr_conv, val_constr);
short_channel_ids_arg_constr.data = NULL;
int64_t* short_channel_ids_arg_vals = (*env)->GetLongArrayElements (env, short_channel_ids_arg, NULL);
for (size_t g = 0; g < short_channel_ids_arg_constr.datalen; g++) {
- int64_t arr_conv_6 = short_channel_ids_arg_vals[g];
- short_channel_ids_arg_constr.data[g] = arr_conv_6;
+ int64_t short_channel_ids_arg_conv_6 = short_channel_ids_arg_vals[g];
+ short_channel_ids_arg_constr.data[g] = short_channel_ids_arg_conv_6;
}
(*env)->ReleaseLongArrayElements(env, short_channel_ids_arg, short_channel_ids_arg_vals, 0);
LDKQueryShortChannelIds ret_var = QueryShortChannelIds_new(chain_hash_arg_ref, short_channel_ids_arg_constr);
val_constr.data = NULL;
int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
for (size_t p = 0; p < val_constr.datalen; p++) {
- int64_t arr_conv_15 = val_vals[p];
- LDKUpdateAddHTLC arr_conv_15_conv;
- arr_conv_15_conv.inner = (void*)(arr_conv_15 & (~1));
- arr_conv_15_conv.is_owned = (arr_conv_15 & 1) || (arr_conv_15 == 0);
- arr_conv_15_conv = UpdateAddHTLC_clone(&arr_conv_15_conv);
- val_constr.data[p] = arr_conv_15_conv;
+ int64_t val_conv_15 = val_vals[p];
+ LDKUpdateAddHTLC val_conv_15_conv;
+ val_conv_15_conv.inner = (void*)(val_conv_15 & (~1));
+ val_conv_15_conv.is_owned = (val_conv_15 & 1) || (val_conv_15 == 0);
+ val_conv_15_conv = UpdateAddHTLC_clone(&val_conv_15_conv);
+ val_constr.data[p] = val_conv_15_conv;
}
(*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
CommitmentUpdate_set_update_add_htlcs(&this_ptr_conv, val_constr);
val_constr.data = NULL;
int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
for (size_t t = 0; t < val_constr.datalen; t++) {
- int64_t arr_conv_19 = val_vals[t];
- LDKUpdateFulfillHTLC arr_conv_19_conv;
- arr_conv_19_conv.inner = (void*)(arr_conv_19 & (~1));
- arr_conv_19_conv.is_owned = (arr_conv_19 & 1) || (arr_conv_19 == 0);
- arr_conv_19_conv = UpdateFulfillHTLC_clone(&arr_conv_19_conv);
- val_constr.data[t] = arr_conv_19_conv;
+ int64_t val_conv_19 = val_vals[t];
+ LDKUpdateFulfillHTLC val_conv_19_conv;
+ val_conv_19_conv.inner = (void*)(val_conv_19 & (~1));
+ val_conv_19_conv.is_owned = (val_conv_19 & 1) || (val_conv_19 == 0);
+ val_conv_19_conv = UpdateFulfillHTLC_clone(&val_conv_19_conv);
+ val_constr.data[t] = val_conv_19_conv;
}
(*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
CommitmentUpdate_set_update_fulfill_htlcs(&this_ptr_conv, val_constr);
val_constr.data = NULL;
int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
for (size_t q = 0; q < val_constr.datalen; q++) {
- int64_t arr_conv_16 = val_vals[q];
- LDKUpdateFailHTLC arr_conv_16_conv;
- arr_conv_16_conv.inner = (void*)(arr_conv_16 & (~1));
- arr_conv_16_conv.is_owned = (arr_conv_16 & 1) || (arr_conv_16 == 0);
- arr_conv_16_conv = UpdateFailHTLC_clone(&arr_conv_16_conv);
- val_constr.data[q] = arr_conv_16_conv;
+ int64_t val_conv_16 = val_vals[q];
+ LDKUpdateFailHTLC val_conv_16_conv;
+ val_conv_16_conv.inner = (void*)(val_conv_16 & (~1));
+ val_conv_16_conv.is_owned = (val_conv_16 & 1) || (val_conv_16 == 0);
+ val_conv_16_conv = UpdateFailHTLC_clone(&val_conv_16_conv);
+ val_constr.data[q] = val_conv_16_conv;
}
(*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
CommitmentUpdate_set_update_fail_htlcs(&this_ptr_conv, val_constr);
val_constr.data = NULL;
int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
for (size_t z = 0; z < val_constr.datalen; z++) {
- int64_t arr_conv_25 = val_vals[z];
- LDKUpdateFailMalformedHTLC arr_conv_25_conv;
- arr_conv_25_conv.inner = (void*)(arr_conv_25 & (~1));
- arr_conv_25_conv.is_owned = (arr_conv_25 & 1) || (arr_conv_25 == 0);
- arr_conv_25_conv = UpdateFailMalformedHTLC_clone(&arr_conv_25_conv);
- val_constr.data[z] = arr_conv_25_conv;
+ int64_t val_conv_25 = val_vals[z];
+ LDKUpdateFailMalformedHTLC val_conv_25_conv;
+ val_conv_25_conv.inner = (void*)(val_conv_25 & (~1));
+ val_conv_25_conv.is_owned = (val_conv_25 & 1) || (val_conv_25 == 0);
+ val_conv_25_conv = UpdateFailMalformedHTLC_clone(&val_conv_25_conv);
+ val_constr.data[z] = val_conv_25_conv;
}
(*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
CommitmentUpdate_set_update_fail_malformed_htlcs(&this_ptr_conv, val_constr);
update_add_htlcs_arg_constr.data = NULL;
int64_t* update_add_htlcs_arg_vals = (*env)->GetLongArrayElements (env, update_add_htlcs_arg, NULL);
for (size_t p = 0; p < update_add_htlcs_arg_constr.datalen; p++) {
- int64_t arr_conv_15 = update_add_htlcs_arg_vals[p];
- LDKUpdateAddHTLC arr_conv_15_conv;
- arr_conv_15_conv.inner = (void*)(arr_conv_15 & (~1));
- arr_conv_15_conv.is_owned = (arr_conv_15 & 1) || (arr_conv_15 == 0);
- arr_conv_15_conv = UpdateAddHTLC_clone(&arr_conv_15_conv);
- update_add_htlcs_arg_constr.data[p] = arr_conv_15_conv;
+ int64_t update_add_htlcs_arg_conv_15 = update_add_htlcs_arg_vals[p];
+ LDKUpdateAddHTLC update_add_htlcs_arg_conv_15_conv;
+ update_add_htlcs_arg_conv_15_conv.inner = (void*)(update_add_htlcs_arg_conv_15 & (~1));
+ update_add_htlcs_arg_conv_15_conv.is_owned = (update_add_htlcs_arg_conv_15 & 1) || (update_add_htlcs_arg_conv_15 == 0);
+ update_add_htlcs_arg_conv_15_conv = UpdateAddHTLC_clone(&update_add_htlcs_arg_conv_15_conv);
+ update_add_htlcs_arg_constr.data[p] = update_add_htlcs_arg_conv_15_conv;
}
(*env)->ReleaseLongArrayElements(env, update_add_htlcs_arg, update_add_htlcs_arg_vals, 0);
LDKCVec_UpdateFulfillHTLCZ update_fulfill_htlcs_arg_constr;
update_fulfill_htlcs_arg_constr.data = NULL;
int64_t* update_fulfill_htlcs_arg_vals = (*env)->GetLongArrayElements (env, update_fulfill_htlcs_arg, NULL);
for (size_t t = 0; t < update_fulfill_htlcs_arg_constr.datalen; t++) {
- int64_t arr_conv_19 = update_fulfill_htlcs_arg_vals[t];
- LDKUpdateFulfillHTLC arr_conv_19_conv;
- arr_conv_19_conv.inner = (void*)(arr_conv_19 & (~1));
- arr_conv_19_conv.is_owned = (arr_conv_19 & 1) || (arr_conv_19 == 0);
- arr_conv_19_conv = UpdateFulfillHTLC_clone(&arr_conv_19_conv);
- update_fulfill_htlcs_arg_constr.data[t] = arr_conv_19_conv;
+ int64_t update_fulfill_htlcs_arg_conv_19 = update_fulfill_htlcs_arg_vals[t];
+ LDKUpdateFulfillHTLC update_fulfill_htlcs_arg_conv_19_conv;
+ update_fulfill_htlcs_arg_conv_19_conv.inner = (void*)(update_fulfill_htlcs_arg_conv_19 & (~1));
+ update_fulfill_htlcs_arg_conv_19_conv.is_owned = (update_fulfill_htlcs_arg_conv_19 & 1) || (update_fulfill_htlcs_arg_conv_19 == 0);
+ update_fulfill_htlcs_arg_conv_19_conv = UpdateFulfillHTLC_clone(&update_fulfill_htlcs_arg_conv_19_conv);
+ update_fulfill_htlcs_arg_constr.data[t] = update_fulfill_htlcs_arg_conv_19_conv;
}
(*env)->ReleaseLongArrayElements(env, update_fulfill_htlcs_arg, update_fulfill_htlcs_arg_vals, 0);
LDKCVec_UpdateFailHTLCZ update_fail_htlcs_arg_constr;
update_fail_htlcs_arg_constr.data = NULL;
int64_t* update_fail_htlcs_arg_vals = (*env)->GetLongArrayElements (env, update_fail_htlcs_arg, NULL);
for (size_t q = 0; q < update_fail_htlcs_arg_constr.datalen; q++) {
- int64_t arr_conv_16 = update_fail_htlcs_arg_vals[q];
- LDKUpdateFailHTLC arr_conv_16_conv;
- arr_conv_16_conv.inner = (void*)(arr_conv_16 & (~1));
- arr_conv_16_conv.is_owned = (arr_conv_16 & 1) || (arr_conv_16 == 0);
- arr_conv_16_conv = UpdateFailHTLC_clone(&arr_conv_16_conv);
- update_fail_htlcs_arg_constr.data[q] = arr_conv_16_conv;
+ int64_t update_fail_htlcs_arg_conv_16 = update_fail_htlcs_arg_vals[q];
+ LDKUpdateFailHTLC update_fail_htlcs_arg_conv_16_conv;
+ update_fail_htlcs_arg_conv_16_conv.inner = (void*)(update_fail_htlcs_arg_conv_16 & (~1));
+ update_fail_htlcs_arg_conv_16_conv.is_owned = (update_fail_htlcs_arg_conv_16 & 1) || (update_fail_htlcs_arg_conv_16 == 0);
+ update_fail_htlcs_arg_conv_16_conv = UpdateFailHTLC_clone(&update_fail_htlcs_arg_conv_16_conv);
+ update_fail_htlcs_arg_constr.data[q] = update_fail_htlcs_arg_conv_16_conv;
}
(*env)->ReleaseLongArrayElements(env, update_fail_htlcs_arg, update_fail_htlcs_arg_vals, 0);
LDKCVec_UpdateFailMalformedHTLCZ update_fail_malformed_htlcs_arg_constr;
update_fail_malformed_htlcs_arg_constr.data = NULL;
int64_t* update_fail_malformed_htlcs_arg_vals = (*env)->GetLongArrayElements (env, update_fail_malformed_htlcs_arg, NULL);
for (size_t z = 0; z < update_fail_malformed_htlcs_arg_constr.datalen; z++) {
- int64_t arr_conv_25 = update_fail_malformed_htlcs_arg_vals[z];
- LDKUpdateFailMalformedHTLC arr_conv_25_conv;
- arr_conv_25_conv.inner = (void*)(arr_conv_25 & (~1));
- arr_conv_25_conv.is_owned = (arr_conv_25 & 1) || (arr_conv_25 == 0);
- arr_conv_25_conv = UpdateFailMalformedHTLC_clone(&arr_conv_25_conv);
- update_fail_malformed_htlcs_arg_constr.data[z] = arr_conv_25_conv;
+ int64_t update_fail_malformed_htlcs_arg_conv_25 = update_fail_malformed_htlcs_arg_vals[z];
+ LDKUpdateFailMalformedHTLC update_fail_malformed_htlcs_arg_conv_25_conv;
+ update_fail_malformed_htlcs_arg_conv_25_conv.inner = (void*)(update_fail_malformed_htlcs_arg_conv_25 & (~1));
+ update_fail_malformed_htlcs_arg_conv_25_conv.is_owned = (update_fail_malformed_htlcs_arg_conv_25 & 1) || (update_fail_malformed_htlcs_arg_conv_25 == 0);
+ update_fail_malformed_htlcs_arg_conv_25_conv = UpdateFailMalformedHTLC_clone(&update_fail_malformed_htlcs_arg_conv_25_conv);
+ update_fail_malformed_htlcs_arg_constr.data[z] = update_fail_malformed_htlcs_arg_conv_25_conv;
}
(*env)->ReleaseLongArrayElements(env, update_fail_malformed_htlcs_arg, update_fail_malformed_htlcs_arg_vals, 0);
LDKUpdateFee update_fee_arg_conv;
LDKAcceptChannel obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = AcceptChannel_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = AcceptChannel_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKAnnouncementSignatures obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = AnnouncementSignatures_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = AnnouncementSignatures_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKChannelReestablish obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = ChannelReestablish_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = ChannelReestablish_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKClosingSigned obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = ClosingSigned_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = ClosingSigned_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKCommitmentSigned obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = CommitmentSigned_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = CommitmentSigned_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKFundingCreated obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = FundingCreated_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = FundingCreated_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKFundingSigned obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = FundingSigned_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = FundingSigned_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingSigned_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKFundingLocked obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = FundingLocked_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = FundingLocked_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingLocked_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKInit obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = Init_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = Init_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKOpenChannel obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = OpenChannel_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = OpenChannel_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKRevokeAndACK obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = RevokeAndACK_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = RevokeAndACK_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKShutdown obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = Shutdown_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = Shutdown_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Shutdown_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKUpdateFailHTLC obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = UpdateFailHTLC_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = UpdateFailHTLC_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKUpdateFailMalformedHTLC obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = UpdateFailMalformedHTLC_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = UpdateFailMalformedHTLC_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKUpdateFee obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = UpdateFee_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = UpdateFee_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKUpdateFulfillHTLC obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = UpdateFulfillHTLC_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = UpdateFulfillHTLC_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKUpdateAddHTLC obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = UpdateAddHTLC_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = UpdateAddHTLC_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKPing obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = Ping_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = Ping_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKPong obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = Pong_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = Pong_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKUnsignedChannelAnnouncement obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = UnsignedChannelAnnouncement_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = UnsignedChannelAnnouncement_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKChannelAnnouncement obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = ChannelAnnouncement_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = ChannelAnnouncement_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKUnsignedChannelUpdate obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = UnsignedChannelUpdate_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = UnsignedChannelUpdate_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKChannelUpdate obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = ChannelUpdate_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = ChannelUpdate_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKErrorMessage obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = ErrorMessage_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = ErrorMessage_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKUnsignedNodeAnnouncement obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = UnsignedNodeAnnouncement_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = UnsignedNodeAnnouncement_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKNodeAnnouncement obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = NodeAnnouncement_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = NodeAnnouncement_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKQueryShortChannelIds obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = QueryShortChannelIds_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = QueryShortChannelIds_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKReplyShortChannelIdsEnd obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = ReplyShortChannelIdsEnd_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = ReplyShortChannelIdsEnd_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKQueryChannelRange obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = QueryChannelRange_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = QueryChannelRange_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKReplyChannelRange obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = ReplyChannelRange_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = ReplyChannelRange_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKGossipTimestampFilter obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = GossipTimestampFilter_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = GossipTimestampFilter_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
jobjectArray ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
;
for (size_t i = 0; i < ret_var.datalen; i++) {
- int8_tArray arr_conv_8_arr = (*env)->NewByteArray(env, 33);
- (*env)->SetByteArrayRegion(env, arr_conv_8_arr, 0, 33, ret_var.data[i].compressed_form);
- (*env)->SetObjectArrayElement(env, ret_arr, i, arr_conv_8_arr);
+ int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 33);
+ (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 33, ret_var.data[i].compressed_form);
+ (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr);
}
FREE(ret_var.data);
return ret_arr;
CHECK((*env)->GetArrayLength(env, commitment_seed) == 32);
(*env)->GetByteArrayRegion(env, commitment_seed, 0, 32, commitment_seed_arr);
unsigned char (*commitment_seed_ref)[32] = &commitment_seed_arr;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 32);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 32, build_commitment_secret(commitment_seed_ref, idx).data);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, build_commitment_secret(commitment_seed_ref, idx).data);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_derive_1private_1key(JNIEnv *env, jclass clz, int8_tArray per_commitment_point, int8_tArray base_secret) {
LDKTxCreationKeys this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 33);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 33, TxCreationKeys_get_per_commitment_point(&this_ptr_conv).compressed_form);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_per_commitment_point(&this_ptr_conv).compressed_form);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
LDKTxCreationKeys this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 33);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 33, TxCreationKeys_get_revocation_key(&this_ptr_conv).compressed_form);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_revocation_key(&this_ptr_conv).compressed_form);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1revocation_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
LDKTxCreationKeys this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 33);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 33, TxCreationKeys_get_broadcaster_htlc_key(&this_ptr_conv).compressed_form);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_broadcaster_htlc_key(&this_ptr_conv).compressed_form);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1broadcaster_1htlc_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
LDKTxCreationKeys this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 33);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 33, TxCreationKeys_get_countersignatory_htlc_key(&this_ptr_conv).compressed_form);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_countersignatory_htlc_key(&this_ptr_conv).compressed_form);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1countersignatory_1htlc_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
LDKTxCreationKeys this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 33);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 33, TxCreationKeys_get_broadcaster_delayed_payment_key(&this_ptr_conv).compressed_form);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_broadcaster_delayed_payment_key(&this_ptr_conv).compressed_form);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1broadcaster_1delayed_1payment_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
LDKTxCreationKeys obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = TxCreationKeys_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = TxCreationKeys_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKChannelPublicKeys this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 33);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 33, ChannelPublicKeys_get_funding_pubkey(&this_ptr_conv).compressed_form);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_funding_pubkey(&this_ptr_conv).compressed_form);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
LDKChannelPublicKeys this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 33);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 33, ChannelPublicKeys_get_revocation_basepoint(&this_ptr_conv).compressed_form);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_revocation_basepoint(&this_ptr_conv).compressed_form);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
LDKChannelPublicKeys this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 33);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 33, ChannelPublicKeys_get_payment_point(&this_ptr_conv).compressed_form);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_payment_point(&this_ptr_conv).compressed_form);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1payment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
LDKChannelPublicKeys this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 33);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 33, ChannelPublicKeys_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1delayed_1payment_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
LDKChannelPublicKeys this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 33);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 33, ChannelPublicKeys_get_htlc_basepoint(&this_ptr_conv).compressed_form);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_htlc_basepoint(&this_ptr_conv).compressed_form);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1htlc_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
LDKChannelPublicKeys obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = ChannelPublicKeys_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = ChannelPublicKeys_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKPublicKey broadcaster_delayed_payment_key_ref;
CHECK((*env)->GetArrayLength(env, broadcaster_delayed_payment_key) == 33);
(*env)->GetByteArrayRegion(env, broadcaster_delayed_payment_key, 0, 33, broadcaster_delayed_payment_key_ref.compressed_form);
- LDKCVec_u8Z arg_var = get_revokeable_redeemscript(revocation_key_ref, contest_delay, broadcaster_delayed_payment_key_ref);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = get_revokeable_redeemscript(revocation_key_ref, contest_delay, broadcaster_delayed_payment_key_ref);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
LDKHTLCOutputInCommitment obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = HTLCOutputInCommitment_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = HTLCOutputInCommitment_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKTxCreationKeys keys_conv;
keys_conv.inner = (void*)(keys & (~1));
keys_conv.is_owned = false;
- LDKCVec_u8Z arg_var = get_htlc_redeemscript(&htlc_conv, &keys_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = get_htlc_redeemscript(&htlc_conv, &keys_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_make_1funding_1redeemscript(JNIEnv *env, jclass clz, int8_tArray broadcaster, int8_tArray countersignatory) {
LDKPublicKey countersignatory_ref;
CHECK((*env)->GetArrayLength(env, countersignatory) == 33);
(*env)->GetByteArrayRegion(env, countersignatory, 0, 33, countersignatory_ref.compressed_form);
- LDKCVec_u8Z arg_var = make_funding_redeemscript(broadcaster_ref, countersignatory_ref);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = make_funding_redeemscript(broadcaster_ref, countersignatory_ref);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_build_1htlc_1transaction(JNIEnv *env, jclass clz, int8_tArray prev_hash, int32_t feerate_per_kw, int16_t contest_delay, int64_t htlc, int8_tArray broadcaster_delayed_payment_key, int8_tArray revocation_key) {
LDKPublicKey revocation_key_ref;
CHECK((*env)->GetArrayLength(env, revocation_key) == 33);
(*env)->GetByteArrayRegion(env, revocation_key, 0, 33, revocation_key_ref.compressed_form);
- LDKTransaction arg_var = build_htlc_transaction(prev_hash_ref, feerate_per_kw, contest_delay, &htlc_conv, broadcaster_delayed_payment_key_ref, revocation_key_ref);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- Transaction_free(arg_var);
- return arg_arr;
+ LDKTransaction ret_var = build_htlc_transaction(prev_hash_ref, feerate_per_kw, contest_delay, &htlc_conv, broadcaster_delayed_payment_key_ref, revocation_key_ref);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ Transaction_free(ret_var);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
LDKCounterpartyChannelTransactionParameters obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = CounterpartyChannelTransactionParameters_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = CounterpartyChannelTransactionParameters_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKChannelTransactionParameters obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = ChannelTransactionParameters_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = ChannelTransactionParameters_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKHolderCommitmentTransaction this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 64);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 64, HolderCommitmentTransaction_get_counterparty_sig(&this_ptr_conv).compact_form);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, HolderCommitmentTransaction_get_counterparty_sig(&this_ptr_conv).compact_form);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1counterparty_1sig(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
else
val_constr.data = NULL;
for (size_t i = 0; i < val_constr.datalen; i++) {
- int8_tArray arr_conv_8 = (*env)->GetObjectArrayElement(env, val, i);
- LDKSignature arr_conv_8_ref;
- CHECK((*env)->GetArrayLength(env, arr_conv_8) == 64);
- (*env)->GetByteArrayRegion(env, arr_conv_8, 0, 64, arr_conv_8_ref.compact_form);
- val_constr.data[i] = arr_conv_8_ref;
+ int8_tArray val_conv_8 = (*env)->GetObjectArrayElement(env, val, i);
+ LDKSignature val_conv_8_ref;
+ CHECK((*env)->GetArrayLength(env, val_conv_8) == 64);
+ (*env)->GetByteArrayRegion(env, val_conv_8, 0, 64, val_conv_8_ref.compact_form);
+ val_constr.data[i] = val_conv_8_ref;
}
HolderCommitmentTransaction_set_counterparty_htlc_sigs(&this_ptr_conv, val_constr);
}
LDKHolderCommitmentTransaction obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = HolderCommitmentTransaction_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = HolderCommitmentTransaction_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
else
counterparty_htlc_sigs_constr.data = NULL;
for (size_t i = 0; i < counterparty_htlc_sigs_constr.datalen; i++) {
- int8_tArray arr_conv_8 = (*env)->GetObjectArrayElement(env, counterparty_htlc_sigs, i);
- LDKSignature arr_conv_8_ref;
- CHECK((*env)->GetArrayLength(env, arr_conv_8) == 64);
- (*env)->GetByteArrayRegion(env, arr_conv_8, 0, 64, arr_conv_8_ref.compact_form);
- counterparty_htlc_sigs_constr.data[i] = arr_conv_8_ref;
+ int8_tArray counterparty_htlc_sigs_conv_8 = (*env)->GetObjectArrayElement(env, counterparty_htlc_sigs, i);
+ LDKSignature counterparty_htlc_sigs_conv_8_ref;
+ CHECK((*env)->GetArrayLength(env, counterparty_htlc_sigs_conv_8) == 64);
+ (*env)->GetByteArrayRegion(env, counterparty_htlc_sigs_conv_8, 0, 64, counterparty_htlc_sigs_conv_8_ref.compact_form);
+ counterparty_htlc_sigs_constr.data[i] = counterparty_htlc_sigs_conv_8_ref;
}
LDKPublicKey holder_funding_key_ref;
CHECK((*env)->GetArrayLength(env, holder_funding_key) == 33);
LDKBuiltCommitmentTransaction this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKTransaction arg_var = BuiltCommitmentTransaction_get_transaction(&this_ptr_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- Transaction_free(arg_var);
- return arg_arr;
+ LDKTransaction ret_var = BuiltCommitmentTransaction_get_transaction(&this_ptr_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ Transaction_free(ret_var);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1set_1transaction(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
LDKBuiltCommitmentTransaction obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = BuiltCommitmentTransaction_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = BuiltCommitmentTransaction_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKu8slice funding_redeemscript_ref;
funding_redeemscript_ref.datalen = (*env)->GetArrayLength(env, funding_redeemscript);
funding_redeemscript_ref.data = (*env)->GetByteArrayElements (env, funding_redeemscript, NULL);
- int8_tArray arg_arr = (*env)->NewByteArray(env, 32);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 32, BuiltCommitmentTransaction_get_sighash_all(&this_arg_conv, funding_redeemscript_ref, channel_value_satoshis).data);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, BuiltCommitmentTransaction_get_sighash_all(&this_arg_conv, funding_redeemscript_ref, channel_value_satoshis).data);
(*env)->ReleaseByteArrayElements(env, funding_redeemscript, (int8_t*)funding_redeemscript_ref.data, 0);
- return arg_arr;
+ return ret_arr;
}
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1sign(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray funding_key, int8_tArray funding_redeemscript, int64_t channel_value_satoshis) {
LDKu8slice funding_redeemscript_ref;
funding_redeemscript_ref.datalen = (*env)->GetArrayLength(env, funding_redeemscript);
funding_redeemscript_ref.data = (*env)->GetByteArrayElements (env, funding_redeemscript, NULL);
- int8_tArray arg_arr = (*env)->NewByteArray(env, 64);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 64, BuiltCommitmentTransaction_sign(&this_arg_conv, funding_key_ref, funding_redeemscript_ref, channel_value_satoshis).compact_form);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, BuiltCommitmentTransaction_sign(&this_arg_conv, funding_key_ref, funding_redeemscript_ref, channel_value_satoshis).compact_form);
(*env)->ReleaseByteArrayElements(env, funding_redeemscript, (int8_t*)funding_redeemscript_ref.data, 0);
- return arg_arr;
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
LDKCommitmentTransaction obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = CommitmentTransaction_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = CommitmentTransaction_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKTrustedCommitmentTransaction this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 32);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 32, TrustedCommitmentTransaction_txid(&this_arg_conv).data);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, TrustedCommitmentTransaction_txid(&this_arg_conv).data);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1built_1transaction(JNIEnv *env, jclass clz, int64_t this_arg) {
LDKInitFeatures obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = InitFeatures_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = InitFeatures_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) {
LDKNodeFeatures obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = NodeFeatures_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = NodeFeatures_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) {
LDKChannelFeatures obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = ChannelFeatures_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = ChannelFeatures_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKRouteHop this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 33);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 33, RouteHop_get_pubkey(&this_ptr_conv).compressed_form);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, RouteHop_get_pubkey(&this_ptr_conv).compressed_form);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
else
val_constr.data = NULL;
for (size_t m = 0; m < val_constr.datalen; m++) {
- int64_tArray arr_conv_12 = (*env)->GetObjectArrayElement(env, val, m);
- LDKCVec_RouteHopZ arr_conv_12_constr;
- arr_conv_12_constr.datalen = (*env)->GetArrayLength(env, arr_conv_12);
- if (arr_conv_12_constr.datalen > 0)
- arr_conv_12_constr.data = MALLOC(arr_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
+ int64_tArray val_conv_12 = (*env)->GetObjectArrayElement(env, val, m);
+ LDKCVec_RouteHopZ val_conv_12_constr;
+ val_conv_12_constr.datalen = (*env)->GetArrayLength(env, val_conv_12);
+ if (val_conv_12_constr.datalen > 0)
+ val_conv_12_constr.data = MALLOC(val_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
else
- arr_conv_12_constr.data = NULL;
- int64_t* arr_conv_12_vals = (*env)->GetLongArrayElements (env, arr_conv_12, NULL);
- for (size_t k = 0; k < arr_conv_12_constr.datalen; k++) {
- int64_t arr_conv_10 = arr_conv_12_vals[k];
- LDKRouteHop arr_conv_10_conv;
- arr_conv_10_conv.inner = (void*)(arr_conv_10 & (~1));
- arr_conv_10_conv.is_owned = (arr_conv_10 & 1) || (arr_conv_10 == 0);
- arr_conv_10_conv = RouteHop_clone(&arr_conv_10_conv);
- arr_conv_12_constr.data[k] = arr_conv_10_conv;
+ val_conv_12_constr.data = NULL;
+ int64_t* val_conv_12_vals = (*env)->GetLongArrayElements (env, val_conv_12, NULL);
+ for (size_t k = 0; k < val_conv_12_constr.datalen; k++) {
+ int64_t val_conv_12_conv_10 = val_conv_12_vals[k];
+ LDKRouteHop val_conv_12_conv_10_conv;
+ val_conv_12_conv_10_conv.inner = (void*)(val_conv_12_conv_10 & (~1));
+ val_conv_12_conv_10_conv.is_owned = (val_conv_12_conv_10 & 1) || (val_conv_12_conv_10 == 0);
+ val_conv_12_conv_10_conv = RouteHop_clone(&val_conv_12_conv_10_conv);
+ val_conv_12_constr.data[k] = val_conv_12_conv_10_conv;
}
- (*env)->ReleaseLongArrayElements(env, arr_conv_12, arr_conv_12_vals, 0);
- val_constr.data[m] = arr_conv_12_constr;
+ (*env)->ReleaseLongArrayElements(env, val_conv_12, val_conv_12_vals, 0);
+ val_constr.data[m] = val_conv_12_constr;
}
Route_set_paths(&this_ptr_conv, val_constr);
}
else
paths_arg_constr.data = NULL;
for (size_t m = 0; m < paths_arg_constr.datalen; m++) {
- int64_tArray arr_conv_12 = (*env)->GetObjectArrayElement(env, paths_arg, m);
- LDKCVec_RouteHopZ arr_conv_12_constr;
- arr_conv_12_constr.datalen = (*env)->GetArrayLength(env, arr_conv_12);
- if (arr_conv_12_constr.datalen > 0)
- arr_conv_12_constr.data = MALLOC(arr_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
+ int64_tArray paths_arg_conv_12 = (*env)->GetObjectArrayElement(env, paths_arg, m);
+ LDKCVec_RouteHopZ paths_arg_conv_12_constr;
+ paths_arg_conv_12_constr.datalen = (*env)->GetArrayLength(env, paths_arg_conv_12);
+ if (paths_arg_conv_12_constr.datalen > 0)
+ paths_arg_conv_12_constr.data = MALLOC(paths_arg_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
else
- arr_conv_12_constr.data = NULL;
- int64_t* arr_conv_12_vals = (*env)->GetLongArrayElements (env, arr_conv_12, NULL);
- for (size_t k = 0; k < arr_conv_12_constr.datalen; k++) {
- int64_t arr_conv_10 = arr_conv_12_vals[k];
- LDKRouteHop arr_conv_10_conv;
- arr_conv_10_conv.inner = (void*)(arr_conv_10 & (~1));
- arr_conv_10_conv.is_owned = (arr_conv_10 & 1) || (arr_conv_10 == 0);
- arr_conv_10_conv = RouteHop_clone(&arr_conv_10_conv);
- arr_conv_12_constr.data[k] = arr_conv_10_conv;
+ paths_arg_conv_12_constr.data = NULL;
+ int64_t* paths_arg_conv_12_vals = (*env)->GetLongArrayElements (env, paths_arg_conv_12, NULL);
+ for (size_t k = 0; k < paths_arg_conv_12_constr.datalen; k++) {
+ int64_t paths_arg_conv_12_conv_10 = paths_arg_conv_12_vals[k];
+ LDKRouteHop paths_arg_conv_12_conv_10_conv;
+ paths_arg_conv_12_conv_10_conv.inner = (void*)(paths_arg_conv_12_conv_10 & (~1));
+ paths_arg_conv_12_conv_10_conv.is_owned = (paths_arg_conv_12_conv_10 & 1) || (paths_arg_conv_12_conv_10 == 0);
+ paths_arg_conv_12_conv_10_conv = RouteHop_clone(&paths_arg_conv_12_conv_10_conv);
+ paths_arg_conv_12_constr.data[k] = paths_arg_conv_12_conv_10_conv;
}
- (*env)->ReleaseLongArrayElements(env, arr_conv_12, arr_conv_12_vals, 0);
- paths_arg_constr.data[m] = arr_conv_12_constr;
+ (*env)->ReleaseLongArrayElements(env, paths_arg_conv_12, paths_arg_conv_12_vals, 0);
+ paths_arg_constr.data[m] = paths_arg_conv_12_constr;
}
LDKRoute ret_var = Route_new(paths_arg_constr);
CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
LDKRoute obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = Route_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = Route_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKRouteHint this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 33);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 33, RouteHint_get_src_node_id(&this_ptr_conv).compressed_form);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, RouteHint_get_src_node_id(&this_ptr_conv).compressed_form);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1src_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
first_hops_constr.data = NULL;
int64_t* first_hops_vals = (*env)->GetLongArrayElements (env, first_hops, NULL);
for (size_t q = 0; q < first_hops_constr.datalen; q++) {
- int64_t arr_conv_16 = first_hops_vals[q];
- LDKChannelDetails arr_conv_16_conv;
- arr_conv_16_conv.inner = (void*)(arr_conv_16 & (~1));
- arr_conv_16_conv.is_owned = (arr_conv_16 & 1) || (arr_conv_16 == 0);
- first_hops_constr.data[q] = arr_conv_16_conv;
+ int64_t first_hops_conv_16 = first_hops_vals[q];
+ LDKChannelDetails first_hops_conv_16_conv;
+ first_hops_conv_16_conv.inner = (void*)(first_hops_conv_16 & (~1));
+ first_hops_conv_16_conv.is_owned = (first_hops_conv_16 & 1) || (first_hops_conv_16 == 0);
+ first_hops_constr.data[q] = first_hops_conv_16_conv;
}
(*env)->ReleaseLongArrayElements(env, first_hops, first_hops_vals, 0);
LDKCVec_RouteHintZ last_hops_constr;
last_hops_constr.data = NULL;
int64_t* last_hops_vals = (*env)->GetLongArrayElements (env, last_hops, NULL);
for (size_t l = 0; l < last_hops_constr.datalen; l++) {
- int64_t arr_conv_11 = last_hops_vals[l];
- LDKRouteHint arr_conv_11_conv;
- arr_conv_11_conv.inner = (void*)(arr_conv_11 & (~1));
- arr_conv_11_conv.is_owned = (arr_conv_11 & 1) || (arr_conv_11 == 0);
- arr_conv_11_conv = RouteHint_clone(&arr_conv_11_conv);
- last_hops_constr.data[l] = arr_conv_11_conv;
+ int64_t last_hops_conv_11 = last_hops_vals[l];
+ LDKRouteHint last_hops_conv_11_conv;
+ last_hops_conv_11_conv.inner = (void*)(last_hops_conv_11 & (~1));
+ last_hops_conv_11_conv.is_owned = (last_hops_conv_11 & 1) || (last_hops_conv_11 == 0);
+ last_hops_conv_11_conv = RouteHint_clone(&last_hops_conv_11_conv);
+ last_hops_constr.data[l] = last_hops_conv_11_conv;
}
(*env)->ReleaseLongArrayElements(env, last_hops, last_hops_vals, 0);
LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
NetworkGraph_free(this_ptr_conv);
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKNetworkGraph orig_conv;
+ orig_conv.inner = (void*)(orig & (~1));
+ orig_conv.is_owned = false;
+ LDKNetworkGraph ret_var = NetworkGraph_clone(&orig_conv);
+ 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;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LockedNetworkGraph_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
LDKLockedNetworkGraph this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
LDKNetworkGraph network_graph_conv;
network_graph_conv.inner = (void*)(network_graph & (~1));
network_graph_conv.is_owned = (network_graph & 1) || (network_graph == 0);
- // Warning: we need a move here but no clone is available for LDKNetworkGraph
+ network_graph_conv = NetworkGraph_clone(&network_graph_conv);
LDKNetGraphMsgHandler ret_var = NetGraphMsgHandler_from_net_graph(chain_access_conv, logger_conv, network_graph_conv);
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.
LDKDirectionalChannelInfo obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = DirectionalChannelInfo_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = DirectionalChannelInfo_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKChannelInfo this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 33);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 33, ChannelInfo_get_node_one(&this_ptr_conv).compressed_form);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelInfo_get_node_one(&this_ptr_conv).compressed_form);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1one(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
LDKChannelInfo this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = (*env)->NewByteArray(env, 33);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, 33, ChannelInfo_get_node_two(&this_ptr_conv).compressed_form);
- return arg_arr;
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelInfo_get_node_two(&this_ptr_conv).compressed_form);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1two(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
ChannelInfo_set_announcement_message(&this_ptr_conv, val_conv);
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKChannelInfo orig_conv;
+ orig_conv.inner = (void*)(orig & (~1));
+ orig_conv.is_owned = false;
+ LDKChannelInfo ret_var = ChannelInfo_clone(&orig_conv);
+ 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;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1write(JNIEnv *env, jclass clz, int64_t obj) {
LDKChannelInfo obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = ChannelInfo_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = ChannelInfo_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKRoutingFees obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = RoutingFees_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = RoutingFees_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
val_constr.data = NULL;
int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
for (size_t m = 0; m < val_constr.datalen; m++) {
- int64_t arr_conv_12 = val_vals[m];
- LDKNetAddress arr_conv_12_conv = *(LDKNetAddress*)(((uint64_t)arr_conv_12) & ~1);
- FREE((void*)arr_conv_12);
- val_constr.data[m] = arr_conv_12_conv;
+ int64_t val_conv_12 = val_vals[m];
+ LDKNetAddress val_conv_12_conv = *(LDKNetAddress*)(((uint64_t)val_conv_12) & ~1);
+ FREE((void*)val_conv_12);
+ val_constr.data[m] = val_conv_12_conv;
}
(*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
NodeAnnouncementInfo_set_addresses(&this_ptr_conv, val_constr);
addresses_arg_constr.data = NULL;
int64_t* addresses_arg_vals = (*env)->GetLongArrayElements (env, addresses_arg, NULL);
for (size_t m = 0; m < addresses_arg_constr.datalen; m++) {
- int64_t arr_conv_12 = addresses_arg_vals[m];
- LDKNetAddress arr_conv_12_conv = *(LDKNetAddress*)(((uint64_t)arr_conv_12) & ~1);
- FREE((void*)arr_conv_12);
- addresses_arg_constr.data[m] = arr_conv_12_conv;
+ int64_t addresses_arg_conv_12 = addresses_arg_vals[m];
+ LDKNetAddress addresses_arg_conv_12_conv = *(LDKNetAddress*)(((uint64_t)addresses_arg_conv_12) & ~1);
+ FREE((void*)addresses_arg_conv_12);
+ addresses_arg_constr.data[m] = addresses_arg_conv_12_conv;
}
(*env)->ReleaseLongArrayElements(env, addresses_arg, addresses_arg_vals, 0);
LDKNodeAnnouncement announcement_message_arg_conv;
LDKNodeAnnouncementInfo obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = NodeAnnouncementInfo_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = NodeAnnouncementInfo_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
val_constr.data = NULL;
int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
for (size_t g = 0; g < val_constr.datalen; g++) {
- int64_t arr_conv_6 = val_vals[g];
- val_constr.data[g] = arr_conv_6;
+ int64_t val_conv_6 = val_vals[g];
+ val_constr.data[g] = val_conv_6;
}
(*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
NodeInfo_set_channels(&this_ptr_conv, val_constr);
channels_arg_constr.data = NULL;
int64_t* channels_arg_vals = (*env)->GetLongArrayElements (env, channels_arg, NULL);
for (size_t g = 0; g < channels_arg_constr.datalen; g++) {
- int64_t arr_conv_6 = channels_arg_vals[g];
- channels_arg_constr.data[g] = arr_conv_6;
+ int64_t channels_arg_conv_6 = channels_arg_vals[g];
+ channels_arg_constr.data[g] = channels_arg_conv_6;
}
(*env)->ReleaseLongArrayElements(env, channels_arg, channels_arg_vals, 0);
LDKRoutingFees lowest_inbound_channel_fees_arg_conv;
LDKNodeInfo obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = NodeInfo_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = NodeInfo_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
LDKNetworkGraph obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = NetworkGraph_write(&obj_conv);
- int8_tArray arg_arr = (*env)->NewByteArray(env, arg_var.datalen);
- (*env)->SetByteArrayRegion(env, arg_arr, 0, arg_var.datalen, arg_var.data);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = NetworkGraph_write(&obj_conv);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
/*
* Class: org_ldk_impl_bindings
- * Method: LDKCVec_MonitorEventZ_new
- * Signature: ([J)J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1MonitorEventZ_1new
- (JNIEnv *, jclass, jlongArray);
-
-/*
- * Class: org_ldk_impl_bindings
- * Method: LDKC2Tuple_u64u64Z_new
- * Signature: (JJ)J
+ * Method: LDKMonitorEvent_ref_from_ptr
+ * Signature: (J)Lorg/ldk/impl/bindings/LDKMonitorEvent;
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1u64u64Z_1new
- (JNIEnv *, jclass, jlong, jlong);
-
-/*
- * Class: org_ldk_impl_bindings
- * Method: LDKC2Tuple_u64u64Z_get_a
- * Signature: (J)J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1u64u64Z_1get_1a
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMonitorEvent_1ref_1from_1ptr
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: LDKC2Tuple_u64u64Z_get_b
- * Signature: (J)J
+ * Method: LDKCVec_MonitorEventZ_new
+ * Signature: ([J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1u64u64Z_1get_1b
- (JNIEnv *, jclass, jlong);
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1MonitorEventZ_1new
+ (JNIEnv *, jclass, jlongArray);
/*
* Class: org_ldk_impl_bindings
/*
* Class: org_ldk_impl_bindings
- * Method: LDKChannelKeys_new
- * Signature: (Lorg/ldk/impl/bindings/LDKChannelKeys;J)J
+ * Method: LDKSign_new
+ * Signature: (Lorg/ldk/impl/bindings/LDKSign;J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1new
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKSign_1new
(JNIEnv *, jclass, jobject, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: ChannelKeys_get_per_commitment_point
+ * Method: Sign_get_per_commitment_point
* Signature: (JJ)[B
*/
-JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1get_1per_1commitment_1point
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Sign_1get_1per_1commitment_1point
(JNIEnv *, jclass, jlong, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: ChannelKeys_release_commitment_secret
+ * Method: Sign_release_commitment_secret
* Signature: (JJ)[B
*/
-JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1release_1commitment_1secret
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Sign_1release_1commitment_1secret
(JNIEnv *, jclass, jlong, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: ChannelKeys_key_derivation_params
- * Signature: (J)J
+ * Method: Sign_channel_keys_id
+ * Signature: (J)[B
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1key_1derivation_1params
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Sign_1channel_1keys_1id
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: ChannelKeys_sign_counterparty_commitment
+ * Method: Sign_sign_counterparty_commitment
* Signature: (JJ)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1sign_1counterparty_1commitment
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Sign_1sign_1counterparty_1commitment
(JNIEnv *, jclass, jlong, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: ChannelKeys_sign_holder_commitment_and_htlcs
+ * Method: Sign_sign_holder_commitment_and_htlcs
* Signature: (JJ)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1sign_1holder_1commitment_1and_1htlcs
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Sign_1sign_1holder_1commitment_1and_1htlcs
(JNIEnv *, jclass, jlong, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: ChannelKeys_sign_justice_transaction
+ * Method: Sign_sign_justice_transaction
* Signature: (J[BJJ[BJ)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1sign_1justice_1transaction
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Sign_1sign_1justice_1transaction
(JNIEnv *, jclass, jlong, jbyteArray, jlong, jlong, jbyteArray, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: ChannelKeys_sign_counterparty_htlc_transaction
+ * Method: Sign_sign_counterparty_htlc_transaction
* Signature: (J[BJJ[BJ)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1sign_1counterparty_1htlc_1transaction
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Sign_1sign_1counterparty_1htlc_1transaction
(JNIEnv *, jclass, jlong, jbyteArray, jlong, jlong, jbyteArray, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: ChannelKeys_sign_closing_transaction
+ * Method: Sign_sign_closing_transaction
* Signature: (J[B)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1sign_1closing_1transaction
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Sign_1sign_1closing_1transaction
(JNIEnv *, jclass, jlong, jbyteArray);
/*
* Class: org_ldk_impl_bindings
- * Method: ChannelKeys_sign_channel_announcement
+ * Method: Sign_sign_channel_announcement
* Signature: (JJ)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1sign_1channel_1announcement
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Sign_1sign_1channel_1announcement
(JNIEnv *, jclass, jlong, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: ChannelKeys_ready_channel
+ * Method: Sign_ready_channel
* Signature: (JJ)V
*/
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1ready_1channel
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Sign_1ready_1channel
(JNIEnv *, jclass, jlong, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: ChannelKeys_write
+ * Method: Sign_write
* Signature: (J)[B
*/
-JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1write
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Sign_1write
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: ChannelKeys_get_pubkeys
+ * Method: Sign_get_pubkeys
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1get_1pubkeys
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Sign_1get_1pubkeys
(JNIEnv *, jclass, jlong);
/*
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneAPIErrorZ_1get_1err
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKCVec_CResult_NoneAPIErrorZZ_new
+ * Signature: ([J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1CResult_1NoneAPIErrorZZ_1new
+ (JNIEnv *, jclass, jlongArray);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKCVec_APIErrorZ_new
+ * Signature: ([J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1APIErrorZ_1new
+ (JNIEnv *, jclass, jlongArray);
+
/*
* Class: org_ldk_impl_bindings
* Method: LDKCVec_ChannelDetailsZ_new
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1ChannelDetailsZ_1new
(JNIEnv *, jclass, jlongArray);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKPaymentSendFailure_ref_from_ptr
+ * Signature: (J)Lorg/ldk/impl/bindings/LDKPaymentSendFailure;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentSendFailure_1ref_1from_1ptr
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: LDKCResult_NonePaymentSendFailureZ_result_ok
/*
* Class: org_ldk_impl_bindings
- * Method: LDKCResult_ChannelKeysDecodeErrorZ_result_ok
+ * Method: LDKCResult_SignDecodeErrorZ_result_ok
* Signature: (J)Z
*/
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelKeysDecodeErrorZ_1result_1ok
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignDecodeErrorZ_1result_1ok
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: LDKCResult_ChannelKeysDecodeErrorZ_get_ok
+ * Method: LDKCResult_SignDecodeErrorZ_get_ok
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelKeysDecodeErrorZ_1get_1ok
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignDecodeErrorZ_1get_1ok
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: LDKCResult_ChannelKeysDecodeErrorZ_get_err
+ * Method: LDKCResult_SignDecodeErrorZ_get_err
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelKeysDecodeErrorZ_1get_1err
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignDecodeErrorZ_1get_1err
(JNIEnv *, jclass, jlong);
/*
/*
* Class: org_ldk_impl_bindings
- * Method: KeysInterface_get_channel_keys
+ * Method: KeysInterface_get_channel_signer
* Signature: (JZJ)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1channel_1keys
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1channel_1signer
(JNIEnv *, jclass, jlong, jboolean, jlong);
/*
/*
* Class: org_ldk_impl_bindings
- * Method: LDKCResult_InMemoryChannelKeysDecodeErrorZ_result_ok
+ * Method: LDKCResult_CVec_CVec_u8ZZNoneZ_result_ok
* Signature: (J)Z
*/
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InMemoryChannelKeysDecodeErrorZ_1result_1ok
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1CVec_1u8ZZNoneZ_1result_1ok
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: LDKCResult_InMemoryChannelKeysDecodeErrorZ_get_ok
+ * Method: LDKCResult_CVec_CVec_u8ZZNoneZ_get_ok
+ * Signature: (J)[[B
+ */
+JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1CVec_1u8ZZNoneZ_1get_1ok
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKCResult_CVec_CVec_u8ZZNoneZ_get_err
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1CVec_1u8ZZNoneZ_1get_1err
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKCResult_InMemorySignerDecodeErrorZ_result_ok
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InMemorySignerDecodeErrorZ_1result_1ok
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKCResult_InMemorySignerDecodeErrorZ_get_ok
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InMemoryChannelKeysDecodeErrorZ_1get_1ok
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InMemorySignerDecodeErrorZ_1get_1ok
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: LDKCResult_InMemoryChannelKeysDecodeErrorZ_get_err
+ * Method: LDKCResult_InMemorySignerDecodeErrorZ_get_err
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InMemoryChannelKeysDecodeErrorZ_1get_1err
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InMemorySignerDecodeErrorZ_1get_1err
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKCVec_TxOutZ_new
+ * Signature: ([J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1TxOutZ_1new
+ (JNIEnv *, jclass, jlongArray);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKCResult_TransactionNoneZ_result_ok
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TransactionNoneZ_1result_1ok
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKCResult_TransactionNoneZ_get_ok
+ * Signature: (J)[B
+ */
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TransactionNoneZ_1get_1ok
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKCResult_TransactionNoneZ_get_err
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TransactionNoneZ_1get_1err
(JNIEnv *, jclass, jlong);
/*
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Access_1get_1utxo
(JNIEnv *, jclass, jlong, jbyteArray, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKListen_new
+ * Signature: (Lorg/ldk/impl/bindings/LDKListen;)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKListen_1new
+ (JNIEnv *, jclass, jobject);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: Listen_block_connected
+ * Signature: (J[BI)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Listen_1block_1connected
+ (JNIEnv *, jclass, jlong, jbyteArray, jint);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: Listen_block_disconnected
+ * Signature: (J[BI)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Listen_1block_1disconnected
+ (JNIEnv *, jclass, jlong, jbyteArray, jint);
+
/*
* Class: org_ldk_impl_bindings
* Method: LDKFilter_new
/*
* Class: org_ldk_impl_bindings
* Method: ChannelMessageHandler_handle_shutdown
- * Signature: (J[BJ)V
+ * Signature: (J[BJJ)V
*/
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1shutdown
- (JNIEnv *, jclass, jlong, jbyteArray, jlong);
+ (JNIEnv *, jclass, jlong, jbyteArray, jlong, jlong);
/*
* Class: org_ldk_impl_bindings
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1free
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_ChannelInfoDecodeErrorZ_clone
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1clone
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: CResult_RoutingFeesDecodeErrorZ_ok
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1free
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_NetworkGraphDecodeErrorZ_clone
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1clone
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: C2Tuple_usizeTransactionZ_new
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CVec_CResult_NoneAPIErrorZZ_free
+ * Signature: ([J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1CResult_1NoneAPIErrorZZ_1free
+ (JNIEnv *, jclass, jlongArray);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CVec_APIErrorZ_free
+ * Signature: ([J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1APIErrorZ_1free
+ (JNIEnv *, jclass, jlongArray);
+
/*
* Class: org_ldk_impl_bindings
* Method: CVec_ChannelDetailsZ_free
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1free
(JNIEnv *, jclass, jlong);
-/*
- * Class: org_ldk_impl_bindings
- * Method: C2Tuple_u64u64Z_clone
- * Signature: (J)J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1clone
- (JNIEnv *, jclass, jlong);
-
-/*
- * Class: org_ldk_impl_bindings
- * Method: C2Tuple_u64u64Z_new
- * Signature: (JJ)J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1new
- (JNIEnv *, jclass, jlong, jlong);
-
-/*
- * Class: org_ldk_impl_bindings
- * Method: C2Tuple_u64u64Z_free
- * Signature: (J)V
- */
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1free
- (JNIEnv *, jclass, jlong);
-
/*
* Class: org_ldk_impl_bindings
* Method: CResult_SpendableOutputDescriptorDecodeErrorZ_ok
/*
* Class: org_ldk_impl_bindings
- * Method: CResult_ChannelKeysDecodeErrorZ_ok
+ * Method: CResult_SignDecodeErrorZ_ok
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1ok
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_SignDecodeErrorZ_err
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelKeysDecodeErrorZ_1ok
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1err
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_SignDecodeErrorZ_free
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1free
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: CResult_ChannelKeysDecodeErrorZ_err
+ * Method: CResult_SignDecodeErrorZ_clone
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelKeysDecodeErrorZ_1err
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1clone
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: CResult_ChannelKeysDecodeErrorZ_free
+ * Method: CVec_CVec_u8ZZ_free
+ * Signature: ([[B)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1CVec_1u8ZZ_1free
+ (JNIEnv *, jclass, jobjectArray);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_CVec_CVec_u8ZZNoneZ_ok
+ * Signature: ([[B)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1ok
+ (JNIEnv *, jclass, jobjectArray);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_CVec_CVec_u8ZZNoneZ_err
+ * Signature: ()J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1err
+ (JNIEnv *, jclass);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_CVec_CVec_u8ZZNoneZ_free
* Signature: (J)V
*/
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelKeysDecodeErrorZ_1free
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1free
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: CResult_ChannelKeysDecodeErrorZ_clone
+ * Method: CResult_CVec_CVec_u8ZZNoneZ_clone
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelKeysDecodeErrorZ_1clone
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1clone
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: CResult_InMemoryChannelKeysDecodeErrorZ_ok
+ * Method: CResult_InMemorySignerDecodeErrorZ_ok
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InMemoryChannelKeysDecodeErrorZ_1ok
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1ok
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: CResult_InMemoryChannelKeysDecodeErrorZ_err
+ * Method: CResult_InMemorySignerDecodeErrorZ_err
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InMemoryChannelKeysDecodeErrorZ_1err
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1err
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: CResult_InMemoryChannelKeysDecodeErrorZ_free
+ * Method: CResult_InMemorySignerDecodeErrorZ_free
* Signature: (J)V
*/
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InMemoryChannelKeysDecodeErrorZ_1free
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1free
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: CResult_InMemoryChannelKeysDecodeErrorZ_clone
+ * Method: CResult_InMemorySignerDecodeErrorZ_clone
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InMemoryChannelKeysDecodeErrorZ_1clone
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1clone
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CVec_TxOutZ_free
+ * Signature: ([J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TxOutZ_1free
+ (JNIEnv *, jclass, jlongArray);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_TransactionNoneZ_ok
+ * Signature: ([B)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1ok
+ (JNIEnv *, jclass, jbyteArray);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_TransactionNoneZ_err
+ * Signature: ()J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1err
+ (JNIEnv *, jclass);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_TransactionNoneZ_free
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1free
(JNIEnv *, jclass, jlong);
/*
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Access_1free
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: Listen_free
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Listen_1free
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: Watch_free
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OutPoint_1read
(JNIEnv *, jclass, jbyteArray);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: DelayedPaymentOutputDescriptor_free
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1free
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: DelayedPaymentOutputDescriptor_get_outpoint
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1outpoint
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: DelayedPaymentOutputDescriptor_set_outpoint
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1outpoint
+ (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: DelayedPaymentOutputDescriptor_get_per_commitment_point
+ * Signature: (J)[B
+ */
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1per_1commitment_1point
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: DelayedPaymentOutputDescriptor_set_per_commitment_point
+ * Signature: (J[B)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1per_1commitment_1point
+ (JNIEnv *, jclass, jlong, jbyteArray);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: DelayedPaymentOutputDescriptor_get_to_self_delay
+ * Signature: (J)S
+ */
+JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1to_1self_1delay
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: DelayedPaymentOutputDescriptor_set_to_self_delay
+ * Signature: (JS)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1to_1self_1delay
+ (JNIEnv *, jclass, jlong, jshort);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: DelayedPaymentOutputDescriptor_set_output
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1output
+ (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: DelayedPaymentOutputDescriptor_get_revocation_pubkey
+ * Signature: (J)[B
+ */
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1revocation_1pubkey
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: DelayedPaymentOutputDescriptor_set_revocation_pubkey
+ * Signature: (J[B)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1revocation_1pubkey
+ (JNIEnv *, jclass, jlong, jbyteArray);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: DelayedPaymentOutputDescriptor_get_channel_keys_id
+ * Signature: (J)[B
+ */
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1channel_1keys_1id
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: DelayedPaymentOutputDescriptor_set_channel_keys_id
+ * Signature: (J[B)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1channel_1keys_1id
+ (JNIEnv *, jclass, jlong, jbyteArray);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: DelayedPaymentOutputDescriptor_get_channel_value_satoshis
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1channel_1value_1satoshis
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: DelayedPaymentOutputDescriptor_set_channel_value_satoshis
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1channel_1value_1satoshis
+ (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: DelayedPaymentOutputDescriptor_new
+ * Signature: (J[BSJ[B[BJ)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1new
+ (JNIEnv *, jclass, jlong, jbyteArray, jshort, jlong, jbyteArray, jbyteArray, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: DelayedPaymentOutputDescriptor_clone
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1clone
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: StaticPaymentOutputDescriptor_free
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1free
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: StaticPaymentOutputDescriptor_get_outpoint
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1outpoint
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: StaticPaymentOutputDescriptor_set_outpoint
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1outpoint
+ (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: StaticPaymentOutputDescriptor_set_output
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1output
+ (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: StaticPaymentOutputDescriptor_get_channel_keys_id
+ * Signature: (J)[B
+ */
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1channel_1keys_1id
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: StaticPaymentOutputDescriptor_set_channel_keys_id
+ * Signature: (J[B)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1channel_1keys_1id
+ (JNIEnv *, jclass, jlong, jbyteArray);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: StaticPaymentOutputDescriptor_get_channel_value_satoshis
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1channel_1value_1satoshis
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: StaticPaymentOutputDescriptor_set_channel_value_satoshis
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1channel_1value_1satoshis
+ (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: StaticPaymentOutputDescriptor_new
+ * Signature: (JJ[BJ)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1new
+ (JNIEnv *, jclass, jlong, jlong, jbyteArray, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: StaticPaymentOutputDescriptor_clone
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1clone
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: SpendableOutputDescriptor_free
/*
* Class: org_ldk_impl_bindings
- * Method: ChannelKeys_clone
+ * Method: Sign_clone
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1clone
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Sign_1clone
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: ChannelKeys_free
+ * Method: Sign_free
* Signature: (J)V
*/
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1free
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Sign_1free
(JNIEnv *, jclass, jlong);
/*
/*
* Class: org_ldk_impl_bindings
- * Method: InMemoryChannelKeys_free
+ * Method: InMemorySigner_free
* Signature: (J)V
*/
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1free
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1free
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: InMemoryChannelKeys_get_funding_key
+ * Method: InMemorySigner_get_funding_key
* Signature: (J)[B
*/
-JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1funding_1key
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1funding_1key
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: InMemoryChannelKeys_set_funding_key
+ * Method: InMemorySigner_set_funding_key
* Signature: (J[B)V
*/
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1funding_1key
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1funding_1key
(JNIEnv *, jclass, jlong, jbyteArray);
/*
* Class: org_ldk_impl_bindings
- * Method: InMemoryChannelKeys_get_revocation_base_key
+ * Method: InMemorySigner_get_revocation_base_key
* Signature: (J)[B
*/
-JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1revocation_1base_1key
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1revocation_1base_1key
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: InMemoryChannelKeys_set_revocation_base_key
+ * Method: InMemorySigner_set_revocation_base_key
* Signature: (J[B)V
*/
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1revocation_1base_1key
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1revocation_1base_1key
(JNIEnv *, jclass, jlong, jbyteArray);
/*
* Class: org_ldk_impl_bindings
- * Method: InMemoryChannelKeys_get_payment_key
+ * Method: InMemorySigner_get_payment_key
* Signature: (J)[B
*/
-JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1payment_1key
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1payment_1key
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: InMemoryChannelKeys_set_payment_key
+ * Method: InMemorySigner_set_payment_key
* Signature: (J[B)V
*/
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1payment_1key
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1payment_1key
(JNIEnv *, jclass, jlong, jbyteArray);
/*
* Class: org_ldk_impl_bindings
- * Method: InMemoryChannelKeys_get_delayed_payment_base_key
+ * Method: InMemorySigner_get_delayed_payment_base_key
* Signature: (J)[B
*/
-JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1delayed_1payment_1base_1key
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1delayed_1payment_1base_1key
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: InMemoryChannelKeys_set_delayed_payment_base_key
+ * Method: InMemorySigner_set_delayed_payment_base_key
* Signature: (J[B)V
*/
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1delayed_1payment_1base_1key
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1delayed_1payment_1base_1key
(JNIEnv *, jclass, jlong, jbyteArray);
/*
* Class: org_ldk_impl_bindings
- * Method: InMemoryChannelKeys_get_htlc_base_key
+ * Method: InMemorySigner_get_htlc_base_key
* Signature: (J)[B
*/
-JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1htlc_1base_1key
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1htlc_1base_1key
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: InMemoryChannelKeys_set_htlc_base_key
+ * Method: InMemorySigner_set_htlc_base_key
* Signature: (J[B)V
*/
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1htlc_1base_1key
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1htlc_1base_1key
(JNIEnv *, jclass, jlong, jbyteArray);
/*
* Class: org_ldk_impl_bindings
- * Method: InMemoryChannelKeys_get_commitment_seed
+ * Method: InMemorySigner_get_commitment_seed
* Signature: (J)[B
*/
-JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1commitment_1seed
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1commitment_1seed
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: InMemoryChannelKeys_set_commitment_seed
+ * Method: InMemorySigner_set_commitment_seed
* Signature: (J[B)V
*/
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1commitment_1seed
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1commitment_1seed
(JNIEnv *, jclass, jlong, jbyteArray);
/*
* Class: org_ldk_impl_bindings
- * Method: InMemoryChannelKeys_clone
+ * Method: InMemorySigner_clone
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1clone
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1clone
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: InMemoryChannelKeys_new
- * Signature: ([B[B[B[B[B[BJJ)J
+ * Method: InMemorySigner_new
+ * Signature: ([B[B[B[B[B[BJ[B)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1new
- (JNIEnv *, jclass, jbyteArray, jbyteArray, jbyteArray, jbyteArray, jbyteArray, jbyteArray, jlong, jlong);
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1new
+ (JNIEnv *, jclass, jbyteArray, jbyteArray, jbyteArray, jbyteArray, jbyteArray, jbyteArray, jlong, jbyteArray);
/*
* Class: org_ldk_impl_bindings
- * Method: InMemoryChannelKeys_counterparty_pubkeys
+ * Method: InMemorySigner_counterparty_pubkeys
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1counterparty_1pubkeys
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1counterparty_1pubkeys
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: InMemoryChannelKeys_counterparty_selected_contest_delay
+ * Method: InMemorySigner_counterparty_selected_contest_delay
* Signature: (J)S
*/
-JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1counterparty_1selected_1contest_1delay
+JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1counterparty_1selected_1contest_1delay
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: InMemoryChannelKeys_holder_selected_contest_delay
+ * Method: InMemorySigner_holder_selected_contest_delay
* Signature: (J)S
*/
-JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1holder_1selected_1contest_1delay
+JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1holder_1selected_1contest_1delay
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: InMemoryChannelKeys_is_outbound
+ * Method: InMemorySigner_is_outbound
* Signature: (J)Z
*/
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1is_1outbound
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1is_1outbound
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: InMemoryChannelKeys_funding_outpoint
+ * Method: InMemorySigner_funding_outpoint
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1funding_1outpoint
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1funding_1outpoint
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: InMemoryChannelKeys_get_channel_parameters
+ * Method: InMemorySigner_get_channel_parameters
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1channel_1parameters
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1channel_1parameters
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: InMemoryChannelKeys_as_ChannelKeys
+ * Method: InMemorySigner_sign_counterparty_payment_input
+ * Signature: (J[BJJ)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1sign_1counterparty_1payment_1input
+ (JNIEnv *, jclass, jlong, jbyteArray, jlong, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: InMemorySigner_sign_dynamic_p2wsh_input
+ * Signature: (J[BJJ)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1sign_1dynamic_1p2wsh_1input
+ (JNIEnv *, jclass, jlong, jbyteArray, jlong, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: InMemorySigner_as_Sign
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1as_1ChannelKeys
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1as_1Sign
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: InMemoryChannelKeys_write
+ * Method: InMemorySigner_write
* Signature: (J)[B
*/
-JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1write
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1write
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: InMemoryChannelKeys_read
+ * Method: InMemorySigner_read
* Signature: ([B)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1read
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1read
(JNIEnv *, jclass, jbyteArray);
/*
/*
* Class: org_ldk_impl_bindings
* Method: KeysManager_new
- * Signature: ([BLorg/ldk/enums/LDKNetwork;JI)J
+ * Signature: ([BJI)J
*/
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysManager_1new
- (JNIEnv *, jclass, jbyteArray, jobject, jlong, jint);
+ (JNIEnv *, jclass, jbyteArray, jlong, jint);
/*
* Class: org_ldk_impl_bindings
* Method: KeysManager_derive_channel_keys
- * Signature: (JJJJ)J
+ * Signature: (JJ[B)J
*/
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysManager_1derive_1channel_1keys
- (JNIEnv *, jclass, jlong, jlong, jlong, jlong);
+ (JNIEnv *, jclass, jlong, jlong, jbyteArray);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: KeysManager_spend_spendable_outputs
+ * Signature: (J[J[J[BI)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysManager_1spend_1spendable_1outputs
+ (JNIEnv *, jclass, jlong, jlongArray, jlongArray, jbyteArray, jint);
/*
* Class: org_ldk_impl_bindings
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1EventsProvider
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ChannelManager_as_Listen
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1Listen
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: ChannelManager_block_connected
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1block_1disconnected
(JNIEnv *, jclass, jlong, jbyteArray);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ChannelManager_await_persistable_update
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1await_1persistable_1update
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: ChannelManager_as_ChannelMessageHandler
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Init_1free
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: Init_get_features
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Init_1get_1features
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: Init_set_features
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Init_1set_1features
+ (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: Init_new
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Init_1new
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: Init_clone
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1free
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: NetworkGraph_clone
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1clone
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: LockedNetworkGraph_free
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1announcement_1message
(JNIEnv *, jclass, jlong, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ChannelInfo_clone
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1clone
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: ChannelInfo_write
--- /dev/null
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class org_ldk_impl_bindings_LDKMonitorEvent */
+
+#ifndef _Included_org_ldk_impl_bindings_LDKMonitorEvent
+#define _Included_org_ldk_impl_bindings_LDKMonitorEvent
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class: org_ldk_impl_bindings_LDKMonitorEvent
+ * Method: init
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMonitorEvent_init
+ (JNIEnv *, jclass);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
--- /dev/null
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class org_ldk_impl_bindings_LDKPaymentSendFailure */
+
+#ifndef _Included_org_ldk_impl_bindings_LDKPaymentSendFailure
+#define _Included_org_ldk_impl_bindings_LDKPaymentSendFailure
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class: org_ldk_impl_bindings_LDKPaymentSendFailure
+ * Method: init
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPaymentSendFailure_init
+ (JNIEnv *, jclass);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
if (!expression) { abort(); }
}
-void *malloc(size_t size);
-void free(void *ptr);
+// Always run a, then assert it is true:
+#define DO_ASSERT(a) do { bool _assert_val = (a); assert(_assert_val); } while(0)
+// Assert a is true or do nothing
+#define CHECK(a) DO_ASSERT(a)
+
+// Running a leak check across all the allocations and frees of the JDK is a mess,
+// so instead we implement our own naive leak checker here, relying on the -wrap
+// linker option to wrap malloc/calloc/realloc/free, tracking everyhing allocated
+// and free'd in Rust or C across the generated bindings shared library.
+
+#define BT_MAX 128
+typedef struct allocation {
+ struct allocation* next;
+ void* ptr;
+ const char* struct_name;
+} allocation;
+static allocation* allocation_ll = NULL;
+
+void* __real_malloc(size_t len);
+void* __real_calloc(size_t nmemb, size_t len);
+static void new_allocation(void* res, const char* struct_name) {
+ allocation* new_alloc = __real_malloc(sizeof(allocation));
+ new_alloc->ptr = res;
+ new_alloc->struct_name = struct_name;
+ new_alloc->next = allocation_ll;
+ allocation_ll = new_alloc;
+}
+static void* MALLOC(size_t len, const char* struct_name) {
+ void* res = __real_malloc(len);
+ new_allocation(res, struct_name);
+ return res;
+}
+void __real_free(void* ptr);
+static void alloc_freed(void* ptr) {
+ allocation* p = NULL;
+ allocation* it = allocation_ll;
+ while (it->ptr != ptr) {
+ p = it; it = it->next;
+ if (it == NULL) {
+ //XXX: fprintf(stderr, "Tried to free unknown pointer %p\n", ptr);
+ return; // addrsan should catch malloc-unknown and print more info than we have
+ }
+ }
+ if (p) { p->next = it->next; } else { allocation_ll = it->next; }
+ DO_ASSERT(it->ptr == ptr);
+ __real_free(it);
+}
+static void FREE(void* ptr) {
+ if ((long)ptr < 1024) return; // Rust loves to create pointers to the NULL page for dummys
+ alloc_freed(ptr);
+ __real_free(ptr);
+}
+
+void* __wrap_malloc(size_t len) {
+ void* res = __real_malloc(len);
+ new_allocation(res, "malloc call");
+ return res;
+}
+void* __wrap_calloc(size_t nmemb, size_t len) {
+ void* res = __real_calloc(nmemb, len);
+ new_allocation(res, "calloc call");
+ return res;
+}
+void __wrap_free(void* ptr) {
+ if (ptr == NULL) return;
+ alloc_freed(ptr);
+ __real_free(ptr);
+}
-#define MALLOC(a, _) malloc(a)
-#define FREE(p) if ((long)(p) > 1024) { free(p); }
-#define DO_ASSERT(a) (void)(a)
-#define CHECK(a)
+void* __real_realloc(void* ptr, size_t newlen);
+void* __wrap_realloc(void* ptr, size_t len) {
+ if (ptr != NULL) alloc_freed(ptr);
+ void* res = __real_realloc(ptr, len);
+ new_allocation(res, "realloc call");
+ return res;
+}
+void __wrap_reallocarray(void* ptr, size_t new_sz) {
+ // Rust doesn't seem to use reallocarray currently
+ DO_ASSERT(false);
+}
+
+void __attribute__((destructor)) check_leaks() {
+ for (allocation* a = allocation_ll; a != NULL; a = a->next) {
+ //XXX: fprintf(stderr, "%s %p remains\n", a->struct_name, a->ptr);
+ }
+ DO_ASSERT(allocation_ll == NULL);
+}
// We assume that CVec_u8Z and u8slice are the same size and layout (and thus pointers to the two can be mixed)
_Static_assert(sizeof(LDKCVec_u8Z) == sizeof(LDKu8slice), "Vec<u8> and [u8] need to have been mapped identically");
case 4: return LDKSecp256k1Error_InvalidSecretKey;
case 5: return LDKSecp256k1Error_InvalidRecoveryId;
case 6: return LDKSecp256k1Error_InvalidTweak;
- case 7: return LDKSecp256k1Error_NotEnoughMemory;
- case 8: return LDKSecp256k1Error_CallbackPanicked;
+ case 7: return LDKSecp256k1Error_TweakCheckFailed;
+ case 8: return LDKSecp256k1Error_NotEnoughMemory;
}
abort();
}
case LDKSecp256k1Error_InvalidSecretKey: return 4;
case LDKSecp256k1Error_InvalidRecoveryId: return 5;
case LDKSecp256k1Error_InvalidTweak: return 6;
- case LDKSecp256k1Error_NotEnoughMemory: return 7;
- case LDKSecp256k1Error_CallbackPanicked: return 8;
+ case LDKSecp256k1Error_TweakCheckFailed: return 7;
+ case LDKSecp256k1Error_NotEnoughMemory: return 8;
default: abort();
}
}
ptrArray res_arr = init_arr(res_var.datalen, sizeof(uint32_t), "Native ptrArray Bytes");
int8_tArray *res_arr_ptr = (int8_tArray*)(res_arr + 4);
for (size_t m = 0; m < res_var.datalen; m++) {
- int8_tArray arr_conv_12_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arr_conv_12_arr + 4), res_var.data[m].compact_form, 64);
- res_arr_ptr[m] = arr_conv_12_arr;
+ int8_tArray res_conv_12_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(res_conv_12_arr + 4), res_var.data[m].compact_form, 64);
+ res_arr_ptr[m] = res_conv_12_arr;
}
return res_arr;
}
uint32_t err_conv = LDKChannelMonitorUpdateErr_to_js((*val->contents.err));
return err_conv;
}
+uint32_t __attribute__((visibility("default"))) TS_LDKMonitorEvent_ref_from_ptr(uint32_t ptr) {
+ LDKMonitorEvent *obj = (LDKMonitorEvent*)ptr;
+ switch(obj->tag) {
+ case LDKMonitorEvent_HTLCEvent: {
+ return 0 /* LDKMonitorEvent - HTLCEvent */;
+ }
+ case LDKMonitorEvent_CommitmentTxBroadcasted: {
+ return 0 /* LDKMonitorEvent - CommitmentTxBroadcasted */;
+ }
+ default: abort();
+ }
+}
uint32_t __attribute__((visibility("default"))) TS_LDKCVec_MonitorEventZ_new(uint32_tArray elems) {
LDKCVec_MonitorEventZ *ret = MALLOC(sizeof(LDKCVec_MonitorEventZ), "LDKCVec_MonitorEventZ");
ret->datalen = *((uint32_t*)elems);
uint32_t *java_elems = (uint32_t*)(elems + 4);
for (size_t i = 0; i < ret->datalen; i++) {
uint32_t arr_elem = java_elems[i];
- LDKMonitorEvent arr_elem_conv;
- arr_elem_conv.inner = (void*)(arr_elem & (~1));
- arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0);
- arr_elem_conv = MonitorEvent_clone(&arr_elem_conv);
+ LDKMonitorEvent arr_elem_conv = *(LDKMonitorEvent*)(((uint64_t)arr_elem) & ~1);
+ FREE((void*)arr_elem);
ret->data[i] = arr_elem_conv;
}
}
}
return ret;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKC2Tuple_u64u64Z_new(int64_t a, int64_t b) {
- LDKC2Tuple_u64u64Z* ret = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
- ret->a = a;
- ret->b = b;
- return (long)ret;
-}
-int64_t __attribute__((visibility("default"))) TS_LDKC2Tuple_u64u64Z_get_a(uint32_t ptr) {
- LDKC2Tuple_u64u64Z *tuple = (LDKC2Tuple_u64u64Z*)(ptr & ~1);
- return tuple->a;
-}
-int64_t __attribute__((visibility("default"))) TS_LDKC2Tuple_u64u64Z_get_b(uint32_t ptr) {
- LDKC2Tuple_u64u64Z *tuple = (LDKC2Tuple_u64u64Z*)(ptr & ~1);
- return tuple->b;
-}
uint32_t __attribute__((visibility("default"))) TS_LDKSpendableOutputDescriptor_ref_from_ptr(uint32_t ptr) {
LDKSpendableOutputDescriptor *obj = (LDKSpendableOutputDescriptor*)ptr;
switch(obj->tag) {
long output_ref = ((long)&obj->static_output.output) | 1;
return 0 /* LDKSpendableOutputDescriptor - StaticOutput */; (void) outpoint_ref; (void) (long)output_ref;
}
- case LDKSpendableOutputDescriptor_DynamicOutputP2WSH: {
- LDKOutPoint outpoint_var = obj->dynamic_output_p2wsh.outpoint;
- CHECK((((long)outpoint_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
- CHECK((((long)&outpoint_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- long outpoint_ref = (long)outpoint_var.inner & ~1;
- int8_tArray per_commitment_point_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(per_commitment_point_arr + 4), obj->dynamic_output_p2wsh.per_commitment_point.compressed_form, 33);
- long output_ref = ((long)&obj->dynamic_output_p2wsh.output) | 1;
- long key_derivation_params_ref = (long)(&obj->dynamic_output_p2wsh.key_derivation_params) | 1;
- int8_tArray revocation_pubkey_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(revocation_pubkey_arr + 4), obj->dynamic_output_p2wsh.revocation_pubkey.compressed_form, 33);
- return 0 /* LDKSpendableOutputDescriptor - DynamicOutputP2WSH */; (void) outpoint_ref; (void) per_commitment_point_arr; (void) obj->dynamic_output_p2wsh.to_self_delay; (void) (long)output_ref; (void) key_derivation_params_ref; (void) revocation_pubkey_arr;
+ case LDKSpendableOutputDescriptor_DelayedPaymentOutput: {
+ return 0 /* LDKSpendableOutputDescriptor - DelayedPaymentOutput */;
}
- case LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment: {
- LDKOutPoint outpoint_var = obj->static_output_counterparty_payment.outpoint;
- CHECK((((long)outpoint_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
- CHECK((((long)&outpoint_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- long outpoint_ref = (long)outpoint_var.inner & ~1;
- long output_ref = ((long)&obj->static_output_counterparty_payment.output) | 1;
- long key_derivation_params_ref = (long)(&obj->static_output_counterparty_payment.key_derivation_params) | 1;
- return 0 /* LDKSpendableOutputDescriptor - StaticOutputCounterpartyPayment */; (void) outpoint_ref; (void) (long)output_ref; (void) key_derivation_params_ref;
+ case LDKSpendableOutputDescriptor_StaticPaymentOutput: {
+ return 0 /* LDKSpendableOutputDescriptor - StaticPaymentOutput */;
}
default: abort();
}
uint32_tArray outputs_arr = init_arr(outputs_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *outputs_arr_ptr = (uint32_t*)(outputs_arr + 4);
for (size_t b = 0; b < outputs_var.datalen; b++) {
- long arr_conv_27_ref = ((long)&outputs_var.data[b]) | 1;
- outputs_arr_ptr[b] = arr_conv_27_ref;
+ long outputs_conv_27_ref = ((long)&outputs_var.data[b]) | 1;
+ outputs_arr_ptr[b] = outputs_conv_27_ref;
}
return 0 /* LDKEvent - SpendableOutputs */; (void) outputs_arr;
}
b_constr.data = NULL;
uint32_t* b_vals = (uint32_t*)(b + 4);
for (size_t z = 0; z < b_constr.datalen; z++) {
- uint32_t arr_conv_25 = b_vals[z];
- LDKC2Tuple_u32TxOutZ arr_conv_25_conv = *(LDKC2Tuple_u32TxOutZ*)(((uint64_t)arr_conv_25) & ~1);
- FREE((void*)arr_conv_25);
- b_constr.data[z] = arr_conv_25_conv;
+ uint32_t b_conv_25 = b_vals[z];
+ LDKC2Tuple_u32TxOutZ b_conv_25_conv = *(LDKC2Tuple_u32TxOutZ*)(((uint64_t)b_conv_25) & ~1);
+ FREE((void*)b_conv_25);
+ b_constr.data[z] = b_conv_25_conv;
}
ret->b = b_constr;
return (long)ret;
uint32_tArray b_arr = init_arr(b_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *b_arr_ptr = (uint32_t*)(b_arr + 4);
for (size_t z = 0; z < b_var.datalen; z++) {
- long arr_conv_25_ref = (long)(&b_var.data[z]) | 1;
- b_arr_ptr[z] = arr_conv_25_ref;
+ long b_conv_25_ref = (long)(&b_var.data[z]) | 1;
+ b_arr_ptr[z] = b_conv_25_ref;
}
return b_arr;
}
b_constr.data = NULL;
int8_tArray* b_vals = (int8_tArray*)(b + 4);
for (size_t m = 0; m < b_constr.datalen; m++) {
- int8_tArray arr_conv_12 = b_vals[m];
- LDKSignature arr_conv_12_ref;
- CHECK(*((uint32_t*)arr_conv_12) == 64);
- memcpy(arr_conv_12_ref.compact_form, (uint8_t*)(arr_conv_12 + 4), 64);
- b_constr.data[m] = arr_conv_12_ref;
+ int8_tArray b_conv_12 = b_vals[m];
+ LDKSignature b_conv_12_ref;
+ CHECK(*((uint32_t*)b_conv_12) == 64);
+ memcpy(b_conv_12_ref.compact_form, (uint8_t*)(b_conv_12 + 4), 64);
+ b_constr.data[m] = b_conv_12_ref;
}
ret->b = b_constr;
return (long)ret;
ptrArray b_arr = init_arr(b_var.datalen, sizeof(uint32_t), "Native ptrArray Bytes");
int8_tArray *b_arr_ptr = (int8_tArray*)(b_arr + 4);
for (size_t m = 0; m < b_var.datalen; m++) {
- int8_tArray arr_conv_12_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arr_conv_12_arr + 4), b_var.data[m].compact_form, 64);
- b_arr_ptr[m] = arr_conv_12_arr;
+ int8_tArray b_conv_12_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(b_conv_12_arr + 4), b_var.data[m].compact_form, 64);
+ b_arr_ptr[m] = b_conv_12_arr;
}
return b_arr;
}
CHECK(!val->result_ok);
return *val->contents.err;
}
-typedef struct LDKChannelKeys_JCalls {
+typedef struct LDKSign_JCalls {
atomic_size_t refcnt;
uint32_t get_per_commitment_point_meth;
uint32_t release_commitment_secret_meth;
- uint32_t key_derivation_params_meth;
+ uint32_t channel_keys_id_meth;
uint32_t sign_counterparty_commitment_meth;
uint32_t sign_holder_commitment_and_htlcs_meth;
uint32_t sign_justice_transaction_meth;
uint32_t sign_channel_announcement_meth;
uint32_t ready_channel_meth;
uint32_t write_meth;
-} LDKChannelKeys_JCalls;
-static void LDKChannelKeys_JCalls_free(void* this_arg) {
- LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
+} LDKSign_JCalls;
+static void LDKSign_JCalls_free(void* this_arg) {
+ LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
js_free(j_calls->get_per_commitment_point_meth);
js_free(j_calls->release_commitment_secret_meth);
- js_free(j_calls->key_derivation_params_meth);
+ js_free(j_calls->channel_keys_id_meth);
js_free(j_calls->sign_counterparty_commitment_meth);
js_free(j_calls->sign_holder_commitment_and_htlcs_meth);
js_free(j_calls->sign_justice_transaction_meth);
}
}
LDKPublicKey get_per_commitment_point_jcall(const void* this_arg, uint64_t idx) {
- LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
- int8_tArray arg = js_invoke_function_1(j_calls->get_per_commitment_point_meth, idx);
- LDKPublicKey arg_ref;
- CHECK(*((uint32_t*)arg) == 33);
- memcpy(arg_ref.compressed_form, (uint8_t*)(arg + 4), 33);
- return arg_ref;
+ 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;
+ CHECK(*((uint32_t*)ret) == 33);
+ 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) {
- LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
- int8_tArray arg = js_invoke_function_1(j_calls->release_commitment_secret_meth, idx);
- LDKThirtyTwoBytes arg_ref;
- CHECK(*((uint32_t*)arg) == 32);
- memcpy(arg_ref.data, (uint8_t*)(arg + 4), 32);
- return arg_ref;
-}
-LDKC2Tuple_u64u64Z key_derivation_params_jcall(const void* this_arg) {
- LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
- LDKC2Tuple_u64u64Z* ret = (LDKC2Tuple_u64u64Z*)js_invoke_function_0(j_calls->key_derivation_params_meth);
- LDKC2Tuple_u64u64Z ret_conv = *(LDKC2Tuple_u64u64Z*)(((uint64_t)ret) & ~1);
- ret_conv = C2Tuple_u64u64Z_clone((LDKC2Tuple_u64u64Z*)ret);
- return ret_conv;
+ 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;
+ CHECK(*((uint32_t*)ret) == 32);
+ memcpy(ret_ref.data, (uint8_t*)(ret + 4), 32);
+ return ret_ref;
+}
+LDKThirtyTwoBytes channel_keys_id_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;
+ CHECK(*((uint32_t*)ret) == 32);
+ 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) {
- LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
+ LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
LDKCommitmentTransaction commitment_tx_var = *commitment_tx;
commitment_tx_var = CommitmentTransaction_clone(commitment_tx);
CHECK((((long)commitment_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
return ret_conv;
}
LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htlcs_jcall(const void* this_arg, const LDKHolderCommitmentTransaction * commitment_tx) {
- LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
+ LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
LDKHolderCommitmentTransaction commitment_tx_var = *commitment_tx;
commitment_tx_var = HolderCommitmentTransaction_clone(commitment_tx);
CHECK((((long)commitment_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
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) {
- LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
+ 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");
memcpy((uint8_t*)(justice_tx_arr + 4), justice_tx_var.data, justice_tx_var.datalen);
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) {
- LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
+ 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");
memcpy((uint8_t*)(htlc_tx_arr + 4), htlc_tx_var.data, htlc_tx_var.datalen);
return ret_conv;
}
LDKCResult_SignatureNoneZ sign_closing_transaction_jcall(const void* this_arg, LDKTransaction closing_tx) {
- LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
+ 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");
memcpy((uint8_t*)(closing_tx_arr + 4), closing_tx_var.data, closing_tx_var.datalen);
return ret_conv;
}
LDKCResult_SignatureNoneZ sign_channel_announcement_jcall(const void* this_arg, const LDKUnsignedChannelAnnouncement * msg) {
- LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
+ LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
LDKUnsignedChannelAnnouncement msg_var = *msg;
msg_var = UnsignedChannelAnnouncement_clone(msg);
CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
return ret_conv;
}
void ready_channel_jcall(void* this_arg, const LDKChannelTransactionParameters * channel_parameters) {
- LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
+ LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
LDKChannelTransactionParameters channel_parameters_var = *channel_parameters;
channel_parameters_var = ChannelTransactionParameters_clone(channel_parameters);
CHECK((((long)channel_parameters_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
js_invoke_function_1(j_calls->ready_channel_meth, channel_parameters_ref);
}
LDKCVec_u8Z write_jcall(const void* this_arg) {
- LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
- int8_tArray arg = js_invoke_function_0(j_calls->write_meth);
- LDKCVec_u8Z arg_ref;
- arg_ref.datalen = *((uint32_t*)arg);
- arg_ref.data = MALLOC(arg_ref.datalen, "LDKCVec_u8Z Bytes");
- memcpy(arg_ref.data, (uint8_t*)(arg + 4), arg_ref.datalen);
- return arg_ref;
-}
-static void* LDKChannelKeys_JCalls_clone(const void* this_arg) {
- LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) 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;
+ ret_ref.datalen = *((uint32_t*)ret);
+ ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
+ memcpy(ret_ref.data, (uint8_t*)(ret + 4), ret_ref.datalen);
+ return ret_ref;
+}
+static void* LDKSign_JCalls_clone(const void* this_arg) {
+ LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
return (void*) this_arg;
}
-static inline LDKChannelKeys LDKChannelKeys_init (/*TODO: JS Object Reference */void* o, uint32_t pubkeys) {
- LDKChannelKeys_JCalls *calls = MALLOC(sizeof(LDKChannelKeys_JCalls), "LDKChannelKeys_JCalls");
+static inline LDKSign LDKSign_init (/*TODO: JS Object Reference */void* o, uint32_t pubkeys) {
+ LDKSign_JCalls *calls = MALLOC(sizeof(LDKSign_JCalls), "LDKSign_JCalls");
atomic_init(&calls->refcnt, 1);
//TODO: Assign calls->o from o
pubkeys_conv.is_owned = (pubkeys & 1) || (pubkeys == 0);
pubkeys_conv = ChannelPublicKeys_clone(&pubkeys_conv);
- LDKChannelKeys ret = {
+ LDKSign ret = {
.this_arg = (void*) calls,
.get_per_commitment_point = get_per_commitment_point_jcall,
.release_commitment_secret = release_commitment_secret_jcall,
- .key_derivation_params = key_derivation_params_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_closing_transaction = sign_closing_transaction_jcall,
.sign_channel_announcement = sign_channel_announcement_jcall,
.ready_channel = ready_channel_jcall,
- .clone = LDKChannelKeys_JCalls_clone,
+ .clone = LDKSign_JCalls_clone,
.write = write_jcall,
- .free = LDKChannelKeys_JCalls_free,
+ .free = LDKSign_JCalls_free,
.pubkeys = pubkeys_conv,
.set_pubkeys = NULL,
};
return ret;
}
-long __attribute__((visibility("default"))) TS_LDKChannelKeys_new(/*TODO: JS Object Reference */void* o, uint32_t pubkeys) {
- LDKChannelKeys *res_ptr = MALLOC(sizeof(LDKChannelKeys), "LDKChannelKeys");
- *res_ptr = LDKChannelKeys_init(o, pubkeys);
+long __attribute__((visibility("default"))) TS_LDKSign_new(/*TODO: JS Object Reference */void* o, uint32_t pubkeys) {
+ LDKSign *res_ptr = MALLOC(sizeof(LDKSign), "LDKSign");
+ *res_ptr = LDKSign_init(o, pubkeys);
return (long)res_ptr;
}
-int8_tArray __attribute__((visibility("default"))) TS_ChannelKeys_get_per_commitment_point(uint32_t this_arg, int64_t idx) {
- LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg;
- int8_tArray arg_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), (this_arg_conv->get_per_commitment_point)(this_arg_conv->this_arg, idx).compressed_form, 33);
- return arg_arr;
+int8_tArray __attribute__((visibility("default"))) TS_Sign_get_per_commitment_point(uint32_t this_arg, int64_t idx) {
+ LDKSign* this_arg_conv = (LDKSign*)this_arg;
+ int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), (this_arg_conv->get_per_commitment_point)(this_arg_conv->this_arg, idx).compressed_form, 33);
+ return ret_arr;
}
-int8_tArray __attribute__((visibility("default"))) TS_ChannelKeys_release_commitment_secret(uint32_t this_arg, int64_t idx) {
- LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg;
- int8_tArray arg_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), (this_arg_conv->release_commitment_secret)(this_arg_conv->this_arg, idx).data, 32);
- return arg_arr;
+int8_tArray __attribute__((visibility("default"))) TS_Sign_release_commitment_secret(uint32_t this_arg, int64_t idx) {
+ LDKSign* this_arg_conv = (LDKSign*)this_arg;
+ int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), (this_arg_conv->release_commitment_secret)(this_arg_conv->this_arg, idx).data, 32);
+ return ret_arr;
}
-uint32_t __attribute__((visibility("default"))) TS_ChannelKeys_key_derivation_params(uint32_t this_arg) {
- LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg;
- LDKC2Tuple_u64u64Z* ret_ref = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
- *ret_ref = (this_arg_conv->key_derivation_params)(this_arg_conv->this_arg);
- return (long)ret_ref;
+int8_tArray __attribute__((visibility("default"))) TS_Sign_channel_keys_id(uint32_t this_arg) {
+ LDKSign* this_arg_conv = (LDKSign*)this_arg;
+ int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), (this_arg_conv->channel_keys_id)(this_arg_conv->this_arg).data, 32);
+ return ret_arr;
}
-uint32_t __attribute__((visibility("default"))) TS_ChannelKeys_sign_counterparty_commitment(uint32_t this_arg, uint32_t commitment_tx) {
- LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg;
+uint32_t __attribute__((visibility("default"))) TS_Sign_sign_counterparty_commitment(uint32_t this_arg, uint32_t commitment_tx) {
+ LDKSign* this_arg_conv = (LDKSign*)this_arg;
LDKCommitmentTransaction commitment_tx_conv;
commitment_tx_conv.inner = (void*)(commitment_tx & (~1));
commitment_tx_conv.is_owned = false;
return (long)ret_conv;
}
-uint32_t __attribute__((visibility("default"))) TS_ChannelKeys_sign_holder_commitment_and_htlcs(uint32_t this_arg, uint32_t commitment_tx) {
- LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg;
+uint32_t __attribute__((visibility("default"))) TS_Sign_sign_holder_commitment_and_htlcs(uint32_t this_arg, uint32_t commitment_tx) {
+ LDKSign* this_arg_conv = (LDKSign*)this_arg;
LDKHolderCommitmentTransaction commitment_tx_conv;
commitment_tx_conv.inner = (void*)(commitment_tx & (~1));
commitment_tx_conv.is_owned = false;
return (long)ret_conv;
}
-uint32_t __attribute__((visibility("default"))) TS_ChannelKeys_sign_justice_transaction(uint32_t this_arg, int8_tArray justice_tx, int64_t input, int64_t amount, int8_tArray per_commitment_key, uint32_t htlc) {
- LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg;
+uint32_t __attribute__((visibility("default"))) TS_Sign_sign_justice_transaction(uint32_t this_arg, int8_tArray justice_tx, int64_t input, int64_t amount, int8_tArray per_commitment_key, uint32_t htlc) {
+ LDKSign* this_arg_conv = (LDKSign*)this_arg;
LDKTransaction justice_tx_ref;
justice_tx_ref.datalen = *((uint32_t*)justice_tx);
justice_tx_ref.data = MALLOC(justice_tx_ref.datalen, "LDKTransaction Bytes");
return (long)ret_conv;
}
-uint32_t __attribute__((visibility("default"))) TS_ChannelKeys_sign_counterparty_htlc_transaction(uint32_t this_arg, int8_tArray htlc_tx, int64_t input, int64_t amount, int8_tArray per_commitment_point, uint32_t htlc) {
- LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg;
+uint32_t __attribute__((visibility("default"))) TS_Sign_sign_counterparty_htlc_transaction(uint32_t this_arg, int8_tArray htlc_tx, int64_t input, int64_t amount, int8_tArray per_commitment_point, uint32_t htlc) {
+ LDKSign* this_arg_conv = (LDKSign*)this_arg;
LDKTransaction htlc_tx_ref;
htlc_tx_ref.datalen = *((uint32_t*)htlc_tx);
htlc_tx_ref.data = MALLOC(htlc_tx_ref.datalen, "LDKTransaction Bytes");
return (long)ret_conv;
}
-uint32_t __attribute__((visibility("default"))) TS_ChannelKeys_sign_closing_transaction(uint32_t this_arg, int8_tArray closing_tx) {
- LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg;
+uint32_t __attribute__((visibility("default"))) TS_Sign_sign_closing_transaction(uint32_t this_arg, int8_tArray closing_tx) {
+ LDKSign* this_arg_conv = (LDKSign*)this_arg;
LDKTransaction closing_tx_ref;
closing_tx_ref.datalen = *((uint32_t*)closing_tx);
closing_tx_ref.data = MALLOC(closing_tx_ref.datalen, "LDKTransaction Bytes");
return (long)ret_conv;
}
-uint32_t __attribute__((visibility("default"))) TS_ChannelKeys_sign_channel_announcement(uint32_t this_arg, uint32_t msg) {
- LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg;
+uint32_t __attribute__((visibility("default"))) TS_Sign_sign_channel_announcement(uint32_t this_arg, uint32_t msg) {
+ LDKSign* this_arg_conv = (LDKSign*)this_arg;
LDKUnsignedChannelAnnouncement msg_conv;
msg_conv.inner = (void*)(msg & (~1));
msg_conv.is_owned = false;
return (long)ret_conv;
}
-void __attribute__((visibility("default"))) TS_ChannelKeys_ready_channel(uint32_t this_arg, uint32_t channel_parameters) {
- LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg;
+void __attribute__((visibility("default"))) TS_Sign_ready_channel(uint32_t this_arg, uint32_t channel_parameters) {
+ LDKSign* this_arg_conv = (LDKSign*)this_arg;
LDKChannelTransactionParameters channel_parameters_conv;
channel_parameters_conv.inner = (void*)(channel_parameters & (~1));
channel_parameters_conv.is_owned = false;
(this_arg_conv->ready_channel)(this_arg_conv->this_arg, &channel_parameters_conv);
}
-int8_tArray __attribute__((visibility("default"))) TS_ChannelKeys_write(uint32_t this_arg) {
- LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg;
- LDKCVec_u8Z arg_var = (this_arg_conv->write)(this_arg_conv->this_arg);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+int8_tArray __attribute__((visibility("default"))) TS_Sign_write(uint32_t this_arg) {
+ LDKSign* this_arg_conv = (LDKSign*)this_arg;
+ LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
-LDKChannelPublicKeys LDKChannelKeys_set_get_pubkeys(LDKChannelKeys* this_arg) {
+LDKChannelPublicKeys LDKSign_set_get_pubkeys(LDKSign* this_arg) {
if (this_arg->set_pubkeys != NULL)
this_arg->set_pubkeys(this_arg);
return this_arg->pubkeys;
}
-uint32_t __attribute__((visibility("default"))) TS_ChannelKeys_get_pubkeys(uint32_t this_arg) {
- LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg;
- LDKChannelPublicKeys ret_var = LDKChannelKeys_set_get_pubkeys(this_arg_conv);
+uint32_t __attribute__((visibility("default"))) TS_Sign_get_pubkeys(uint32_t this_arg) {
+ LDKSign* this_arg_conv = (LDKSign*)this_arg;
+ LDKChannelPublicKeys ret_var = LDKSign_set_get_pubkeys(this_arg_conv);
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;
long err_ref = ((long)&(*val->contents.err)) | 1;
return err_ref;
}
+uint32_t __attribute__((visibility("default"))) TS_LDKCVec_CResult_NoneAPIErrorZZ_new(uint32_tArray elems) {
+ LDKCVec_CResult_NoneAPIErrorZZ *ret = MALLOC(sizeof(LDKCVec_CResult_NoneAPIErrorZZ), "LDKCVec_CResult_NoneAPIErrorZZ");
+ ret->datalen = *((uint32_t*)elems);
+ if (ret->datalen == 0) {
+ ret->data = NULL;
+ } else {
+ ret->data = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ) * ret->datalen, "LDKCVec_CResult_NoneAPIErrorZZ Data");
+ uint32_t *java_elems = (uint32_t*)(elems + 4);
+ for (size_t i = 0; i < ret->datalen; i++) {
+ uint32_t arr_elem = java_elems[i];
+ LDKCResult_NoneAPIErrorZ arr_elem_conv = *(LDKCResult_NoneAPIErrorZ*)(((uint64_t)arr_elem) & ~1);
+ FREE((void*)arr_elem);
+ ret->data[i] = arr_elem_conv;
+ }
+ }
+ return (long)ret;
+}
+static inline LDKCVec_CResult_NoneAPIErrorZZ CVec_CResult_NoneAPIErrorZZ_clone(const LDKCVec_CResult_NoneAPIErrorZZ *orig) {
+ LDKCVec_CResult_NoneAPIErrorZZ ret = { .data = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ) * orig->datalen, "LDKCVec_CResult_NoneAPIErrorZZ clone bytes"), .datalen = orig->datalen };
+ for (size_t i = 0; i < ret.datalen; i++) {
+ ret.data[i] = CResult_NoneAPIErrorZ_clone(&orig->data[i]);
+ }
+ return ret;
+}
+uint32_t __attribute__((visibility("default"))) TS_LDKCVec_APIErrorZ_new(uint32_tArray elems) {
+ LDKCVec_APIErrorZ *ret = MALLOC(sizeof(LDKCVec_APIErrorZ), "LDKCVec_APIErrorZ");
+ ret->datalen = *((uint32_t*)elems);
+ if (ret->datalen == 0) {
+ ret->data = NULL;
+ } else {
+ ret->data = MALLOC(sizeof(LDKAPIError) * ret->datalen, "LDKCVec_APIErrorZ Data");
+ uint32_t *java_elems = (uint32_t*)(elems + 4);
+ for (size_t i = 0; i < ret->datalen; i++) {
+ uint32_t arr_elem = java_elems[i];
+ LDKAPIError arr_elem_conv = *(LDKAPIError*)(((uint64_t)arr_elem) & ~1);
+ FREE((void*)arr_elem);
+ ret->data[i] = arr_elem_conv;
+ }
+ }
+ return (long)ret;
+}
+static inline LDKCVec_APIErrorZ CVec_APIErrorZ_clone(const LDKCVec_APIErrorZ *orig) {
+ LDKCVec_APIErrorZ ret = { .data = MALLOC(sizeof(LDKAPIError) * orig->datalen, "LDKCVec_APIErrorZ clone bytes"), .datalen = orig->datalen };
+ for (size_t i = 0; i < ret.datalen; i++) {
+ ret.data[i] = APIError_clone(&orig->data[i]);
+ }
+ return ret;
+}
uint32_t __attribute__((visibility("default"))) TS_LDKCVec_ChannelDetailsZ_new(uint32_tArray elems) {
LDKCVec_ChannelDetailsZ *ret = MALLOC(sizeof(LDKCVec_ChannelDetailsZ), "LDKCVec_ChannelDetailsZ");
ret->datalen = *((uint32_t*)elems);
}
return ret;
}
+uint32_t __attribute__((visibility("default"))) TS_LDKPaymentSendFailure_ref_from_ptr(uint32_t ptr) {
+ LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)ptr;
+ switch(obj->tag) {
+ case LDKPaymentSendFailure_ParameterError: {
+ return 0 /* LDKPaymentSendFailure - ParameterError */;
+ }
+ case LDKPaymentSendFailure_PathParameterError: {
+ return 0 /* LDKPaymentSendFailure - PathParameterError */;
+ }
+ case LDKPaymentSendFailure_AllFailedRetrySafe: {
+ return 0 /* LDKPaymentSendFailure - AllFailedRetrySafe */;
+ }
+ case LDKPaymentSendFailure_PartialFailure: {
+ return 0 /* LDKPaymentSendFailure - PartialFailure */;
+ }
+ default: abort();
+ }
+}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_NonePaymentSendFailureZ_result_ok(uint32_t arg) {
return ((LDKCResult_NonePaymentSendFailureZ*)arg)->result_ok;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_NonePaymentSendFailureZ_get_err(uint32_t arg) {
LDKCResult_NonePaymentSendFailureZ *val = (LDKCResult_NonePaymentSendFailureZ*)(arg & ~1);
CHECK(!val->result_ok);
- LDKPaymentSendFailure err_var = (*val->contents.err);
- CHECK((((long)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
- CHECK((((long)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- long err_ref = (long)err_var.inner & ~1;
+ long err_ref = ((long)&(*val->contents.err)) | 1;
return err_ref;
}
uint32_t __attribute__((visibility("default"))) TS_LDKCVec_ChannelMonitorZ_new(uint32_tArray elems) {
}
LDKCVec_MonitorEventZ release_pending_monitor_events_jcall(const void* this_arg) {
LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
- uint32_tArray arg = js_invoke_function_0(j_calls->release_pending_monitor_events_meth);
- LDKCVec_MonitorEventZ arg_constr;
- arg_constr.datalen = *((uint32_t*)arg);
- if (arg_constr.datalen > 0)
- arg_constr.data = MALLOC(arg_constr.datalen * sizeof(LDKMonitorEvent), "LDKCVec_MonitorEventZ Elements");
+ uint32_tArray ret = js_invoke_function_0(j_calls->release_pending_monitor_events_meth);
+ LDKCVec_MonitorEventZ ret_constr;
+ ret_constr.datalen = *((uint32_t*)ret);
+ if (ret_constr.datalen > 0)
+ ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKMonitorEvent), "LDKCVec_MonitorEventZ Elements");
else
- arg_constr.data = NULL;
- uint32_t* arg_vals = (uint32_t*)(arg + 4);
- for (size_t o = 0; o < arg_constr.datalen; o++) {
- uint32_t arr_conv_14 = arg_vals[o];
- LDKMonitorEvent arr_conv_14_conv;
- arr_conv_14_conv.inner = (void*)(arr_conv_14 & (~1));
- arr_conv_14_conv.is_owned = (arr_conv_14 & 1) || (arr_conv_14 == 0);
- arr_conv_14_conv = MonitorEvent_clone(&arr_conv_14_conv);
- arg_constr.data[o] = arr_conv_14_conv;
- }
- return arg_constr;
+ ret_constr.data = NULL;
+ uint32_t* ret_vals = (uint32_t*)(ret + 4);
+ for (size_t o = 0; o < ret_constr.datalen; o++) {
+ uint32_t ret_conv_14 = ret_vals[o];
+ LDKMonitorEvent ret_conv_14_conv = *(LDKMonitorEvent*)(((uint64_t)ret_conv_14) & ~1);
+ ret_conv_14_conv = MonitorEvent_clone((LDKMonitorEvent*)ret_conv_14);
+ ret_constr.data[o] = ret_conv_14_conv;
+ }
+ return ret_constr;
}
static void* LDKWatch_JCalls_clone(const void* this_arg) {
LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t o = 0; o < ret_var.datalen; o++) {
- LDKMonitorEvent arr_conv_14_var = ret_var.data[o];
- CHECK((((long)arr_conv_14_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
- CHECK((((long)&arr_conv_14_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- long arr_conv_14_ref = (long)arr_conv_14_var.inner;
- if (arr_conv_14_var.is_owned) {
- arr_conv_14_ref |= 1;
- }
- ret_arr_ptr[o] = arr_conv_14_ref;
+ LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
+ *ret_conv_14_copy = MonitorEvent_clone(&ret_var.data[o]);
+ long ret_conv_14_ref = (long)ret_conv_14_copy;
+ ret_arr_ptr[o] = ret_conv_14_ref;
}
FREE(ret_var.data);
return ret_arr;
(this_arg_conv->broadcast_transaction)(this_arg_conv->this_arg, tx_ref);
}
-jboolean __attribute__((visibility("default"))) TS_LDKCResult_ChannelKeysDecodeErrorZ_result_ok(uint32_t arg) {
- return ((LDKCResult_ChannelKeysDecodeErrorZ*)arg)->result_ok;
+jboolean __attribute__((visibility("default"))) TS_LDKCResult_SignDecodeErrorZ_result_ok(uint32_t arg) {
+ return ((LDKCResult_SignDecodeErrorZ*)arg)->result_ok;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelKeysDecodeErrorZ_get_ok(uint32_t arg) {
- LDKCResult_ChannelKeysDecodeErrorZ *val = (LDKCResult_ChannelKeysDecodeErrorZ*)(arg & ~1);
+uint32_t __attribute__((visibility("default"))) TS_LDKCResult_SignDecodeErrorZ_get_ok(uint32_t arg) {
+ LDKCResult_SignDecodeErrorZ *val = (LDKCResult_SignDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
- LDKChannelKeys* ret = MALLOC(sizeof(LDKChannelKeys), "LDKChannelKeys");
- *ret = ChannelKeys_clone(&(*val->contents.result));
+ LDKSign* ret = MALLOC(sizeof(LDKSign), "LDKSign");
+ *ret = Sign_clone(&(*val->contents.result));
return (long)ret;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKCResult_ChannelKeysDecodeErrorZ_get_err(uint32_t arg) {
- LDKCResult_ChannelKeysDecodeErrorZ *val = (LDKCResult_ChannelKeysDecodeErrorZ*)(arg & ~1);
+uint32_t __attribute__((visibility("default"))) TS_LDKCResult_SignDecodeErrorZ_get_err(uint32_t arg) {
+ LDKCResult_SignDecodeErrorZ *val = (LDKCResult_SignDecodeErrorZ*)(arg & ~1);
CHECK(!val->result_ok);
LDKDecodeError err_var = (*val->contents.err);
CHECK((((long)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
uint32_t get_node_secret_meth;
uint32_t get_destination_script_meth;
uint32_t get_shutdown_pubkey_meth;
- uint32_t get_channel_keys_meth;
+ uint32_t get_channel_signer_meth;
uint32_t get_secure_random_bytes_meth;
uint32_t read_chan_signer_meth;
} LDKKeysInterface_JCalls;
js_free(j_calls->get_node_secret_meth);
js_free(j_calls->get_destination_script_meth);
js_free(j_calls->get_shutdown_pubkey_meth);
- js_free(j_calls->get_channel_keys_meth);
+ js_free(j_calls->get_channel_signer_meth);
js_free(j_calls->get_secure_random_bytes_meth);
js_free(j_calls->read_chan_signer_meth);
FREE(j_calls);
}
LDKSecretKey get_node_secret_jcall(const void* this_arg) {
LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
- int8_tArray arg = js_invoke_function_0(j_calls->get_node_secret_meth);
- LDKSecretKey arg_ref;
- CHECK(*((uint32_t*)arg) == 32);
- memcpy(arg_ref.bytes, (uint8_t*)(arg + 4), 32);
- return arg_ref;
+ int8_tArray ret = js_invoke_function_0(j_calls->get_node_secret_meth);
+ LDKSecretKey ret_ref;
+ CHECK(*((uint32_t*)ret) == 32);
+ memcpy(ret_ref.bytes, (uint8_t*)(ret + 4), 32);
+ return ret_ref;
}
LDKCVec_u8Z get_destination_script_jcall(const void* this_arg) {
LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
- int8_tArray arg = js_invoke_function_0(j_calls->get_destination_script_meth);
- LDKCVec_u8Z arg_ref;
- arg_ref.datalen = *((uint32_t*)arg);
- arg_ref.data = MALLOC(arg_ref.datalen, "LDKCVec_u8Z Bytes");
- memcpy(arg_ref.data, (uint8_t*)(arg + 4), arg_ref.datalen);
- return arg_ref;
+ int8_tArray ret = js_invoke_function_0(j_calls->get_destination_script_meth);
+ LDKCVec_u8Z ret_ref;
+ ret_ref.datalen = *((uint32_t*)ret);
+ ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
+ memcpy(ret_ref.data, (uint8_t*)(ret + 4), ret_ref.datalen);
+ return ret_ref;
}
LDKPublicKey get_shutdown_pubkey_jcall(const void* this_arg) {
LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
- int8_tArray arg = js_invoke_function_0(j_calls->get_shutdown_pubkey_meth);
- LDKPublicKey arg_ref;
- CHECK(*((uint32_t*)arg) == 33);
- memcpy(arg_ref.compressed_form, (uint8_t*)(arg + 4), 33);
- return arg_ref;
+ int8_tArray ret = js_invoke_function_0(j_calls->get_shutdown_pubkey_meth);
+ LDKPublicKey ret_ref;
+ CHECK(*((uint32_t*)ret) == 33);
+ memcpy(ret_ref.compressed_form, (uint8_t*)(ret + 4), 33);
+ return ret_ref;
}
-LDKChannelKeys get_channel_keys_jcall(const void* this_arg, bool inbound, uint64_t channel_value_satoshis) {
+LDKSign get_channel_signer_jcall(const void* this_arg, bool inbound, uint64_t channel_value_satoshis) {
LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
- LDKChannelKeys* ret = (LDKChannelKeys*)js_invoke_function_2(j_calls->get_channel_keys_meth, inbound, channel_value_satoshis);
- LDKChannelKeys ret_conv = *(LDKChannelKeys*)(((uint64_t)ret) & ~1);
- ret_conv = ChannelKeys_clone(ret);
+ 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) {
LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
- int8_tArray arg = js_invoke_function_0(j_calls->get_secure_random_bytes_meth);
- LDKThirtyTwoBytes arg_ref;
- CHECK(*((uint32_t*)arg) == 32);
- memcpy(arg_ref.data, (uint8_t*)(arg + 4), 32);
- return arg_ref;
+ int8_tArray ret = js_invoke_function_0(j_calls->get_secure_random_bytes_meth);
+ LDKThirtyTwoBytes ret_ref;
+ CHECK(*((uint32_t*)ret) == 32);
+ memcpy(ret_ref.data, (uint8_t*)(ret + 4), 32);
+ return ret_ref;
}
-LDKCResult_ChannelKeysDecodeErrorZ read_chan_signer_jcall(const void* this_arg, LDKu8slice reader) {
+LDKCResult_SignDecodeErrorZ read_chan_signer_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");
memcpy((uint8_t*)(reader_arr + 4), reader_var.data, reader_var.datalen);
- LDKCResult_ChannelKeysDecodeErrorZ* ret = (LDKCResult_ChannelKeysDecodeErrorZ*)js_invoke_function_1(j_calls->read_chan_signer_meth, reader_arr);
- LDKCResult_ChannelKeysDecodeErrorZ ret_conv = *(LDKCResult_ChannelKeysDecodeErrorZ*)(((uint64_t)ret) & ~1);
- ret_conv = CResult_ChannelKeysDecodeErrorZ_clone((LDKCResult_ChannelKeysDecodeErrorZ*)ret);
+ LDKCResult_SignDecodeErrorZ* ret = (LDKCResult_SignDecodeErrorZ*)js_invoke_function_1(j_calls->read_chan_signer_meth, reader_arr);
+ LDKCResult_SignDecodeErrorZ ret_conv = *(LDKCResult_SignDecodeErrorZ*)(((uint64_t)ret) & ~1);
+ ret_conv = CResult_SignDecodeErrorZ_clone((LDKCResult_SignDecodeErrorZ*)ret);
return ret_conv;
}
static void* LDKKeysInterface_JCalls_clone(const void* this_arg) {
.get_node_secret = get_node_secret_jcall,
.get_destination_script = get_destination_script_jcall,
.get_shutdown_pubkey = get_shutdown_pubkey_jcall,
- .get_channel_keys = get_channel_keys_jcall,
+ .get_channel_signer = get_channel_signer_jcall,
.get_secure_random_bytes = get_secure_random_bytes_jcall,
.read_chan_signer = read_chan_signer_jcall,
.free = LDKKeysInterface_JCalls_free,
}
int8_tArray __attribute__((visibility("default"))) TS_KeysInterface_get_node_secret(uint32_t this_arg) {
LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg;
- int8_tArray arg_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), (this_arg_conv->get_node_secret)(this_arg_conv->this_arg).bytes, 32);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), (this_arg_conv->get_node_secret)(this_arg_conv->this_arg).bytes, 32);
+ return ret_arr;
}
int8_tArray __attribute__((visibility("default"))) TS_KeysInterface_get_destination_script(uint32_t this_arg) {
LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg;
- LDKCVec_u8Z arg_var = (this_arg_conv->get_destination_script)(this_arg_conv->this_arg);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = (this_arg_conv->get_destination_script)(this_arg_conv->this_arg);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
int8_tArray __attribute__((visibility("default"))) TS_KeysInterface_get_shutdown_pubkey(uint32_t this_arg) {
LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg;
- int8_tArray arg_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), (this_arg_conv->get_shutdown_pubkey)(this_arg_conv->this_arg).compressed_form, 33);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), (this_arg_conv->get_shutdown_pubkey)(this_arg_conv->this_arg).compressed_form, 33);
+ return ret_arr;
}
-uint32_t __attribute__((visibility("default"))) TS_KeysInterface_get_channel_keys(uint32_t this_arg, jboolean inbound, int64_t channel_value_satoshis) {
+uint32_t __attribute__((visibility("default"))) TS_KeysInterface_get_channel_signer(uint32_t this_arg, jboolean inbound, int64_t channel_value_satoshis) {
LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg;
- LDKChannelKeys* ret = MALLOC(sizeof(LDKChannelKeys), "LDKChannelKeys");
- *ret = (this_arg_conv->get_channel_keys)(this_arg_conv->this_arg, inbound, channel_value_satoshis);
+ LDKSign* ret = MALLOC(sizeof(LDKSign), "LDKSign");
+ *ret = (this_arg_conv->get_channel_signer)(this_arg_conv->this_arg, inbound, channel_value_satoshis);
return (long)ret;
}
int8_tArray __attribute__((visibility("default"))) TS_KeysInterface_get_secure_random_bytes(uint32_t this_arg) {
LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg;
- int8_tArray arg_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), (this_arg_conv->get_secure_random_bytes)(this_arg_conv->this_arg).data, 32);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), (this_arg_conv->get_secure_random_bytes)(this_arg_conv->this_arg).data, 32);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_KeysInterface_read_chan_signer(uint32_t this_arg, int8_tArray reader) {
LDKu8slice reader_ref;
reader_ref.datalen = *((uint32_t*)reader);
reader_ref.data = (int8_t*)(reader + 4);
- LDKCResult_ChannelKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelKeysDecodeErrorZ), "LDKCResult_ChannelKeysDecodeErrorZ");
+ LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
*ret_conv = (this_arg_conv->read_chan_signer)(this_arg_conv->this_arg, reader_ref);
return (long)ret_conv;
}
long err_ref = (long)err_var.inner & ~1;
return err_ref;
}
-jboolean __attribute__((visibility("default"))) TS_LDKCResult_InMemoryChannelKeysDecodeErrorZ_result_ok(uint32_t arg) {
- return ((LDKCResult_InMemoryChannelKeysDecodeErrorZ*)arg)->result_ok;
+static inline LDKCVec_CVec_u8ZZ CVec_CVec_u8ZZ_clone(const LDKCVec_CVec_u8ZZ *orig) {
+ LDKCVec_CVec_u8ZZ ret = { .data = MALLOC(sizeof(LDKCVec_u8Z) * orig->datalen, "LDKCVec_CVec_u8ZZ clone bytes"), .datalen = orig->datalen };
+ for (size_t i = 0; i < ret.datalen; i++) {
+ ret.data[i] = CVec_u8Z_clone(&orig->data[i]);
+ }
+ return ret;
+}
+jboolean __attribute__((visibility("default"))) TS_LDKCResult_CVec_CVec_u8ZZNoneZ_result_ok(uint32_t arg) {
+ return ((LDKCResult_CVec_CVec_u8ZZNoneZ*)arg)->result_ok;
+}
+ptrArray __attribute__((visibility("default"))) TS_LDKCResult_CVec_CVec_u8ZZNoneZ_get_ok(uint32_t arg) {
+ LDKCResult_CVec_CVec_u8ZZNoneZ *val = (LDKCResult_CVec_CVec_u8ZZNoneZ*)(arg & ~1);
+ CHECK(val->result_ok);
+ LDKCVec_CVec_u8ZZ res_var = (*val->contents.result);
+ ptrArray res_arr = init_arr(res_var.datalen, sizeof(uint32_t), "Native ptrArray Bytes");
+ int8_tArray *res_arr_ptr = (int8_tArray*)(res_arr + 4);
+ for (size_t m = 0; m < res_var.datalen; m++) {
+ LDKCVec_u8Z res_conv_12_var = res_var.data[m];
+ int8_tArray res_conv_12_arr = init_arr(res_conv_12_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(res_conv_12_arr + 4), res_conv_12_var.data, res_conv_12_var.datalen);
+ res_arr_ptr[m] = res_conv_12_arr;
+ }
+ return res_arr;
+}
+void __attribute__((visibility("default"))) TS_LDKCResult_CVec_CVec_u8ZZNoneZ_get_err(uint32_t arg) {
+ LDKCResult_CVec_CVec_u8ZZNoneZ *val = (LDKCResult_CVec_CVec_u8ZZNoneZ*)(arg & ~1);
+ CHECK(!val->result_ok);
+ return *val->contents.err;
+}
+jboolean __attribute__((visibility("default"))) TS_LDKCResult_InMemorySignerDecodeErrorZ_result_ok(uint32_t arg) {
+ return ((LDKCResult_InMemorySignerDecodeErrorZ*)arg)->result_ok;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InMemoryChannelKeysDecodeErrorZ_get_ok(uint32_t arg) {
- LDKCResult_InMemoryChannelKeysDecodeErrorZ *val = (LDKCResult_InMemoryChannelKeysDecodeErrorZ*)(arg & ~1);
+uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InMemorySignerDecodeErrorZ_get_ok(uint32_t arg) {
+ LDKCResult_InMemorySignerDecodeErrorZ *val = (LDKCResult_InMemorySignerDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
- LDKInMemoryChannelKeys res_var = (*val->contents.result);
+ LDKInMemorySigner res_var = (*val->contents.result);
CHECK((((long)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((long)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
long res_ref = (long)res_var.inner & ~1;
return res_ref;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InMemoryChannelKeysDecodeErrorZ_get_err(uint32_t arg) {
- LDKCResult_InMemoryChannelKeysDecodeErrorZ *val = (LDKCResult_InMemoryChannelKeysDecodeErrorZ*)(arg & ~1);
+uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InMemorySignerDecodeErrorZ_get_err(uint32_t arg) {
+ LDKCResult_InMemorySignerDecodeErrorZ *val = (LDKCResult_InMemorySignerDecodeErrorZ*)(arg & ~1);
CHECK(!val->result_ok);
LDKDecodeError err_var = (*val->contents.err);
CHECK((((long)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
long err_ref = (long)err_var.inner & ~1;
return err_ref;
}
+uint32_t __attribute__((visibility("default"))) TS_LDKCVec_TxOutZ_new(uint32_tArray elems) {
+ LDKCVec_TxOutZ *ret = MALLOC(sizeof(LDKCVec_TxOutZ), "LDKCVec_TxOutZ");
+ ret->datalen = *((uint32_t*)elems);
+ if (ret->datalen == 0) {
+ ret->data = NULL;
+ } else {
+ ret->data = MALLOC(sizeof(LDKTxOut) * ret->datalen, "LDKCVec_TxOutZ Data");
+ uint32_t *java_elems = (uint32_t*)(elems + 4);
+ for (size_t i = 0; i < ret->datalen; i++) {
+ uint32_t arr_elem = java_elems[i];
+ LDKTxOut arr_elem_conv = *(LDKTxOut*)(((uint64_t)arr_elem) & ~1);
+ FREE((void*)arr_elem);
+ ret->data[i] = arr_elem_conv;
+ }
+ }
+ return (long)ret;
+}
+static inline LDKCVec_TxOutZ CVec_TxOutZ_clone(const LDKCVec_TxOutZ *orig) {
+ LDKCVec_TxOutZ ret = { .data = MALLOC(sizeof(LDKTxOut) * orig->datalen, "LDKCVec_TxOutZ clone bytes"), .datalen = orig->datalen };
+ for (size_t i = 0; i < ret.datalen; i++) {
+ ret.data[i] = TxOut_clone(&orig->data[i]);
+ }
+ return ret;
+}
+jboolean __attribute__((visibility("default"))) TS_LDKCResult_TransactionNoneZ_result_ok(uint32_t arg) {
+ return ((LDKCResult_TransactionNoneZ*)arg)->result_ok;
+}
+int8_tArray __attribute__((visibility("default"))) TS_LDKCResult_TransactionNoneZ_get_ok(uint32_t arg) {
+ LDKCResult_TransactionNoneZ *val = (LDKCResult_TransactionNoneZ*)(arg & ~1);
+ CHECK(val->result_ok);
+ LDKTransaction res_var = (*val->contents.result);
+ int8_tArray res_arr = init_arr(res_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(res_arr + 4), res_var.data, res_var.datalen);
+ return res_arr;
+}
+void __attribute__((visibility("default"))) TS_LDKCResult_TransactionNoneZ_get_err(uint32_t arg) {
+ LDKCResult_TransactionNoneZ *val = (LDKCResult_TransactionNoneZ*)(arg & ~1);
+ CHECK(!val->result_ok);
+ return *val->contents.err;
+}
uint32_t __attribute__((visibility("default"))) TS_LDKCVec_RouteHopZ_new(uint32_tArray elems) {
LDKCVec_RouteHopZ *ret = MALLOC(sizeof(LDKCVec_RouteHopZ), "LDKCVec_RouteHopZ");
ret->datalen = *((uint32_t*)elems);
}
LDKCVec_MessageSendEventZ get_and_clear_pending_msg_events_jcall(const void* this_arg) {
LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
- uint32_tArray arg = js_invoke_function_0(j_calls->get_and_clear_pending_msg_events_meth);
- LDKCVec_MessageSendEventZ arg_constr;
- arg_constr.datalen = *((uint32_t*)arg);
- if (arg_constr.datalen > 0)
- arg_constr.data = MALLOC(arg_constr.datalen * sizeof(LDKMessageSendEvent), "LDKCVec_MessageSendEventZ Elements");
+ uint32_tArray ret = js_invoke_function_0(j_calls->get_and_clear_pending_msg_events_meth);
+ LDKCVec_MessageSendEventZ ret_constr;
+ ret_constr.datalen = *((uint32_t*)ret);
+ if (ret_constr.datalen > 0)
+ ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKMessageSendEvent), "LDKCVec_MessageSendEventZ Elements");
else
- arg_constr.data = NULL;
- uint32_t* arg_vals = (uint32_t*)(arg + 4);
- for (size_t s = 0; s < arg_constr.datalen; s++) {
- uint32_t arr_conv_18 = arg_vals[s];
- LDKMessageSendEvent arr_conv_18_conv = *(LDKMessageSendEvent*)(((uint64_t)arr_conv_18) & ~1);
- FREE((void*)arr_conv_18);
- arg_constr.data[s] = arr_conv_18_conv;
+ ret_constr.data = NULL;
+ uint32_t* ret_vals = (uint32_t*)(ret + 4);
+ for (size_t s = 0; s < ret_constr.datalen; s++) {
+ uint32_t ret_conv_18 = ret_vals[s];
+ LDKMessageSendEvent ret_conv_18_conv = *(LDKMessageSendEvent*)(((uint64_t)ret_conv_18) & ~1);
+ ret_conv_18_conv = MessageSendEvent_clone((LDKMessageSendEvent*)ret_conv_18);
+ ret_constr.data[s] = ret_conv_18_conv;
}
- return arg_constr;
+ return ret_constr;
}
static void* LDKMessageSendEventsProvider_JCalls_clone(const void* this_arg) {
LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t s = 0; s < ret_var.datalen; s++) {
- LDKMessageSendEvent *arr_conv_18_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
- *arr_conv_18_copy = MessageSendEvent_clone(&ret_var.data[s]);
- long arr_conv_18_ref = (long)arr_conv_18_copy;
- ret_arr_ptr[s] = arr_conv_18_ref;
+ LDKMessageSendEvent *ret_conv_18_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+ *ret_conv_18_copy = MessageSendEvent_clone(&ret_var.data[s]);
+ long ret_conv_18_ref = (long)ret_conv_18_copy;
+ ret_arr_ptr[s] = ret_conv_18_ref;
}
FREE(ret_var.data);
return ret_arr;
}
LDKCVec_EventZ get_and_clear_pending_events_jcall(const void* this_arg) {
LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
- uint32_tArray arg = js_invoke_function_0(j_calls->get_and_clear_pending_events_meth);
- LDKCVec_EventZ arg_constr;
- arg_constr.datalen = *((uint32_t*)arg);
- if (arg_constr.datalen > 0)
- arg_constr.data = MALLOC(arg_constr.datalen * sizeof(LDKEvent), "LDKCVec_EventZ Elements");
+ uint32_tArray ret = js_invoke_function_0(j_calls->get_and_clear_pending_events_meth);
+ LDKCVec_EventZ ret_constr;
+ ret_constr.datalen = *((uint32_t*)ret);
+ if (ret_constr.datalen > 0)
+ ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKEvent), "LDKCVec_EventZ Elements");
else
- arg_constr.data = NULL;
- uint32_t* arg_vals = (uint32_t*)(arg + 4);
- for (size_t h = 0; h < arg_constr.datalen; h++) {
- uint32_t arr_conv_7 = arg_vals[h];
- LDKEvent arr_conv_7_conv = *(LDKEvent*)(((uint64_t)arr_conv_7) & ~1);
- FREE((void*)arr_conv_7);
- arg_constr.data[h] = arr_conv_7_conv;
+ ret_constr.data = NULL;
+ uint32_t* ret_vals = (uint32_t*)(ret + 4);
+ for (size_t h = 0; h < ret_constr.datalen; h++) {
+ uint32_t ret_conv_7 = ret_vals[h];
+ LDKEvent ret_conv_7_conv = *(LDKEvent*)(((uint64_t)ret_conv_7) & ~1);
+ ret_conv_7_conv = Event_clone((LDKEvent*)ret_conv_7);
+ ret_constr.data[h] = ret_conv_7_conv;
}
- return arg_constr;
+ return ret_constr;
}
static void* LDKEventsProvider_JCalls_clone(const void* this_arg) {
LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t h = 0; h < ret_var.datalen; h++) {
- LDKEvent *arr_conv_7_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
- *arr_conv_7_copy = Event_clone(&ret_var.data[h]);
- long arr_conv_7_ref = (long)arr_conv_7_copy;
- ret_arr_ptr[h] = arr_conv_7_ref;
+ LDKEvent *ret_conv_7_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
+ *ret_conv_7_copy = Event_clone(&ret_var.data[h]);
+ long ret_conv_7_ref = (long)ret_conv_7_copy;
+ ret_arr_ptr[h] = ret_conv_7_ref;
}
FREE(ret_var.data);
return ret_arr;
return (long)ret_conv;
}
+typedef struct LDKListen_JCalls {
+ atomic_size_t refcnt;
+ uint32_t block_connected_meth;
+ uint32_t block_disconnected_meth;
+} LDKListen_JCalls;
+static void LDKListen_JCalls_free(void* this_arg) {
+ LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
+ if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
+ js_free(j_calls->block_connected_meth);
+ js_free(j_calls->block_disconnected_meth);
+ FREE(j_calls);
+ }
+}
+void block_connected_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) {
+ 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);
+ js_invoke_function_2(j_calls->block_disconnected_meth, header_arr, height);
+}
+static void* LDKListen_JCalls_clone(const void* this_arg) {
+ LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
+ atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
+ return (void*) this_arg;
+}
+static inline LDKListen LDKListen_init (/*TODO: JS Object Reference */void* o) {
+ LDKListen_JCalls *calls = MALLOC(sizeof(LDKListen_JCalls), "LDKListen_JCalls");
+ atomic_init(&calls->refcnt, 1);
+ //TODO: Assign calls->o from o
+
+ LDKListen ret = {
+ .this_arg = (void*) calls,
+ .block_connected = block_connected_jcall,
+ .block_disconnected = block_disconnected_jcall,
+ .free = LDKListen_JCalls_free,
+ };
+ return ret;
+}
+long __attribute__((visibility("default"))) TS_LDKListen_new(/*TODO: JS Object Reference */void* o) {
+ LDKListen *res_ptr = MALLOC(sizeof(LDKListen), "LDKListen");
+ *res_ptr = LDKListen_init(o);
+ return (long)res_ptr;
+}
+void __attribute__((visibility("default"))) TS_Listen_block_connected(uint32_t this_arg, int8_tArray block, int32_t height) {
+ LDKListen* this_arg_conv = (LDKListen*)this_arg;
+ LDKu8slice block_ref;
+ block_ref.datalen = *((uint32_t*)block);
+ block_ref.data = (int8_t*)(block + 4);
+ (this_arg_conv->block_connected)(this_arg_conv->this_arg, block_ref, height);
+}
+
+void __attribute__((visibility("default"))) TS_Listen_block_disconnected(uint32_t this_arg, int8_tArray header, int32_t height) {
+ LDKListen* this_arg_conv = (LDKListen*)this_arg;
+ unsigned char header_arr[80];
+ CHECK(*((uint32_t*)header) == 80);
+ memcpy(header_arr, (uint8_t*)(header + 4), 80);
+ unsigned char (*header_ref)[80] = &header_arr;
+ (this_arg_conv->block_disconnected)(this_arg_conv->this_arg, header_ref, height);
+}
+
typedef struct LDKFilter_JCalls {
atomic_size_t refcnt;
uint32_t register_tx_meth;
}
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 LDKShutdown * msg) {
+void handle_shutdown_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);
+ LDKInitFeatures their_features_var = *their_features;
+ their_features_var = InitFeatures_clone(their_features);
+ CHECK((((long)their_features_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&their_features_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long their_features_ref = (long)their_features_var.inner;
+ if (their_features_var.is_owned) {
+ their_features_ref |= 1;
+ }
LDKShutdown msg_var = *msg;
msg_var = Shutdown_clone(msg);
CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
if (msg_var.is_owned) {
msg_ref |= 1;
}
- js_invoke_function_2(j_calls->handle_shutdown_meth, their_node_id_arr, msg_ref);
+ 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) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
(this_arg_conv->handle_funding_locked)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
}
-void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_shutdown(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) {
+void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_shutdown(uint32_t this_arg, int8_tArray their_node_id, uint32_t their_features, uint32_t msg) {
LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg;
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);
+ LDKInitFeatures their_features_conv;
+ their_features_conv.inner = (void*)(their_features & (~1));
+ their_features_conv.is_owned = false;
LDKShutdown msg_conv;
msg_conv.inner = (void*)(msg & (~1));
msg_conv.is_owned = false;
- (this_arg_conv->handle_shutdown)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
+ (this_arg_conv->handle_shutdown)(this_arg_conv->this_arg, their_node_id_ref, &their_features_conv, &msg_conv);
}
void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_closing_signed(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) {
}
LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ get_next_channel_announcements_jcall(const void* this_arg, uint64_t starting_point, uint8_t batch_amount) {
LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
- uint32_tArray arg = js_invoke_function_2(j_calls->get_next_channel_announcements_meth, starting_point, batch_amount);
- LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ arg_constr;
- arg_constr.datalen = *((uint32_t*)arg);
- if (arg_constr.datalen > 0)
- arg_constr.data = MALLOC(arg_constr.datalen * sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ Elements");
+ uint32_tArray ret = js_invoke_function_2(j_calls->get_next_channel_announcements_meth, starting_point, batch_amount);
+ LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret_constr;
+ ret_constr.datalen = *((uint32_t*)ret);
+ if (ret_constr.datalen > 0)
+ ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ Elements");
else
- arg_constr.data = NULL;
- uint32_t* arg_vals = (uint32_t*)(arg + 4);
- for (size_t l = 0; l < arg_constr.datalen; l++) {
- uint32_t arr_conv_63 = arg_vals[l];
- LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ arr_conv_63_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(((uint64_t)arr_conv_63) & ~1);
- FREE((void*)arr_conv_63);
- arg_constr.data[l] = arr_conv_63_conv;
+ ret_constr.data = NULL;
+ uint32_t* ret_vals = (uint32_t*)(ret + 4);
+ for (size_t l = 0; l < ret_constr.datalen; l++) {
+ uint32_t ret_conv_63 = ret_vals[l];
+ LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ ret_conv_63_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(((uint64_t)ret_conv_63) & ~1);
+ ret_conv_63_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone((LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)ret_conv_63);
+ ret_constr.data[l] = ret_conv_63_conv;
}
- return arg_constr;
+ return ret_constr;
}
LDKCVec_NodeAnnouncementZ get_next_node_announcements_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);
- uint32_tArray arg = js_invoke_function_2(j_calls->get_next_node_announcements_meth, starting_point_arr, batch_amount);
- LDKCVec_NodeAnnouncementZ arg_constr;
- arg_constr.datalen = *((uint32_t*)arg);
- if (arg_constr.datalen > 0)
- arg_constr.data = MALLOC(arg_constr.datalen * sizeof(LDKNodeAnnouncement), "LDKCVec_NodeAnnouncementZ Elements");
+ uint32_tArray ret = js_invoke_function_2(j_calls->get_next_node_announcements_meth, starting_point_arr, batch_amount);
+ LDKCVec_NodeAnnouncementZ ret_constr;
+ ret_constr.datalen = *((uint32_t*)ret);
+ if (ret_constr.datalen > 0)
+ ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKNodeAnnouncement), "LDKCVec_NodeAnnouncementZ Elements");
else
- arg_constr.data = NULL;
- uint32_t* arg_vals = (uint32_t*)(arg + 4);
- for (size_t s = 0; s < arg_constr.datalen; s++) {
- uint32_t arr_conv_18 = arg_vals[s];
- LDKNodeAnnouncement arr_conv_18_conv;
- arr_conv_18_conv.inner = (void*)(arr_conv_18 & (~1));
- arr_conv_18_conv.is_owned = (arr_conv_18 & 1) || (arr_conv_18 == 0);
- arr_conv_18_conv = NodeAnnouncement_clone(&arr_conv_18_conv);
- arg_constr.data[s] = arr_conv_18_conv;
- }
- return arg_constr;
+ ret_constr.data = NULL;
+ uint32_t* ret_vals = (uint32_t*)(ret + 4);
+ for (size_t s = 0; s < ret_constr.datalen; s++) {
+ uint32_t ret_conv_18 = ret_vals[s];
+ LDKNodeAnnouncement ret_conv_18_conv;
+ ret_conv_18_conv.inner = (void*)(ret_conv_18 & (~1));
+ ret_conv_18_conv.is_owned = (ret_conv_18 & 1) || (ret_conv_18 == 0);
+ ret_conv_18_conv = NodeAnnouncement_clone(&ret_conv_18_conv);
+ ret_constr.data[s] = ret_conv_18_conv;
+ }
+ return ret_constr;
}
void sync_routing_table_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * init) {
LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t l = 0; l < ret_var.datalen; l++) {
- LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* arr_conv_63_ref = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
- *arr_conv_63_ref = ret_var.data[l];
- ret_arr_ptr[l] = (long)arr_conv_63_ref;
+ LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv_63_ref = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
+ *ret_conv_63_ref = ret_var.data[l];
+ ret_arr_ptr[l] = (long)ret_conv_63_ref;
}
FREE(ret_var.data);
return ret_arr;
uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t s = 0; s < ret_var.datalen; s++) {
- LDKNodeAnnouncement arr_conv_18_var = ret_var.data[s];
- CHECK((((long)arr_conv_18_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
- CHECK((((long)&arr_conv_18_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- long arr_conv_18_ref = (long)arr_conv_18_var.inner;
- if (arr_conv_18_var.is_owned) {
- arr_conv_18_ref |= 1;
+ LDKNodeAnnouncement ret_conv_18_var = ret_var.data[s];
+ CHECK((((long)ret_conv_18_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_conv_18_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_conv_18_ref = (long)ret_conv_18_var.inner;
+ if (ret_conv_18_var.is_owned) {
+ ret_conv_18_ref |= 1;
}
- ret_arr_ptr[s] = arr_conv_18_ref;
+ ret_arr_ptr[s] = ret_conv_18_ref;
}
FREE(ret_var.data);
return ret_arr;
_res_constr.data = NULL;
int8_tArray* _res_vals = (int8_tArray*)(_res + 4);
for (size_t m = 0; m < _res_constr.datalen; m++) {
- int8_tArray arr_conv_12 = _res_vals[m];
- LDKSignature arr_conv_12_ref;
- CHECK(*((uint32_t*)arr_conv_12) == 64);
- memcpy(arr_conv_12_ref.compact_form, (uint8_t*)(arr_conv_12 + 4), 64);
- _res_constr.data[m] = arr_conv_12_ref;
+ int8_tArray _res_conv_12 = _res_vals[m];
+ LDKSignature _res_conv_12_ref;
+ CHECK(*((uint32_t*)_res_conv_12) == 64);
+ memcpy(_res_conv_12_ref.compact_form, (uint8_t*)(_res_conv_12 + 4), 64);
+ _res_constr.data[m] = _res_conv_12_ref;
}
CVec_SignatureZ_free(_res_constr);
}
o_constr.data = NULL;
int8_tArray* o_vals = (int8_tArray*)(o + 4);
for (size_t m = 0; m < o_constr.datalen; m++) {
- int8_tArray arr_conv_12 = o_vals[m];
- LDKSignature arr_conv_12_ref;
- CHECK(*((uint32_t*)arr_conv_12) == 64);
- memcpy(arr_conv_12_ref.compact_form, (uint8_t*)(arr_conv_12 + 4), 64);
- o_constr.data[m] = arr_conv_12_ref;
+ int8_tArray o_conv_12 = o_vals[m];
+ LDKSignature o_conv_12_ref;
+ CHECK(*((uint32_t*)o_conv_12) == 64);
+ memcpy(o_conv_12_ref.compact_form, (uint8_t*)(o_conv_12 + 4), 64);
+ o_constr.data[m] = o_conv_12_ref;
}
LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
*ret_conv = CResult_CVec_SignatureZNoneZ_ok(o_constr);
_res_constr.data = NULL;
int8_tArray* _res_vals = (int8_tArray*)(_res + 4);
for (size_t m = 0; m < _res_constr.datalen; m++) {
- int8_tArray arr_conv_12 = _res_vals[m];
- LDKPublicKey arr_conv_12_ref;
- CHECK(*((uint32_t*)arr_conv_12) == 33);
- memcpy(arr_conv_12_ref.compressed_form, (uint8_t*)(arr_conv_12 + 4), 33);
- _res_constr.data[m] = arr_conv_12_ref;
+ int8_tArray _res_conv_12 = _res_vals[m];
+ LDKPublicKey _res_conv_12_ref;
+ CHECK(*((uint32_t*)_res_conv_12) == 33);
+ memcpy(_res_conv_12_ref.compressed_form, (uint8_t*)(_res_conv_12 + 4), 33);
+ _res_constr.data[m] = _res_conv_12_ref;
}
CVec_PublicKeyZ_free(_res_constr);
}
_res_constr.data = NULL;
uint32_t* _res_vals = (uint32_t*)(_res + 4);
for (size_t l = 0; l < _res_constr.datalen; l++) {
- uint32_t arr_conv_63 = _res_vals[l];
- LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ arr_conv_63_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(((uint64_t)arr_conv_63) & ~1);
- FREE((void*)arr_conv_63);
- _res_constr.data[l] = arr_conv_63_conv;
+ uint32_t _res_conv_63 = _res_vals[l];
+ LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res_conv_63_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(((uint64_t)_res_conv_63) & ~1);
+ FREE((void*)_res_conv_63);
+ _res_constr.data[l] = _res_conv_63_conv;
}
CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(_res_constr);
}
_res_constr.data = NULL;
uint32_t* _res_vals = (uint32_t*)(_res + 4);
for (size_t s = 0; s < _res_constr.datalen; s++) {
- uint32_t arr_conv_18 = _res_vals[s];
- LDKNodeAnnouncement arr_conv_18_conv;
- arr_conv_18_conv.inner = (void*)(arr_conv_18 & (~1));
- arr_conv_18_conv.is_owned = (arr_conv_18 & 1) || (arr_conv_18 == 0);
- _res_constr.data[s] = arr_conv_18_conv;
+ uint32_t _res_conv_18 = _res_vals[s];
+ LDKNodeAnnouncement _res_conv_18_conv;
+ _res_conv_18_conv.inner = (void*)(_res_conv_18 & (~1));
+ _res_conv_18_conv.is_owned = (_res_conv_18 & 1) || (_res_conv_18 == 0);
+ _res_constr.data[s] = _res_conv_18_conv;
}
CVec_NodeAnnouncementZ_free(_res_constr);
}
_res_constr.data = NULL;
uint32_t* _res_vals = (uint32_t*)(_res + 4);
for (size_t s = 0; s < _res_constr.datalen; s++) {
- uint32_t arr_conv_18 = _res_vals[s];
- LDKMessageSendEvent arr_conv_18_conv = *(LDKMessageSendEvent*)(((uint64_t)arr_conv_18) & ~1);
- FREE((void*)arr_conv_18);
- _res_constr.data[s] = arr_conv_18_conv;
+ uint32_t _res_conv_18 = _res_vals[s];
+ LDKMessageSendEvent _res_conv_18_conv = *(LDKMessageSendEvent*)(((uint64_t)_res_conv_18) & ~1);
+ FREE((void*)_res_conv_18);
+ _res_constr.data[s] = _res_conv_18_conv;
}
CVec_MessageSendEventZ_free(_res_constr);
}
LDKChannelInfo o_conv;
o_conv.inner = (void*)(o & (~1));
o_conv.is_owned = (o & 1) || (o == 0);
- // Warning: we need a move here but no clone is available for LDKChannelInfo
+ o_conv = ChannelInfo_clone(&o_conv);
LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
*ret_conv = CResult_ChannelInfoDecodeErrorZ_ok(o_conv);
return (long)ret_conv;
CResult_ChannelInfoDecodeErrorZ_free(_res_conv);
}
+uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelInfoDecodeErrorZ_clone(uint32_t orig) {
+ LDKCResult_ChannelInfoDecodeErrorZ* orig_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)(orig & ~1);
+ LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
+ *ret_conv = CResult_ChannelInfoDecodeErrorZ_clone(orig_conv);
+ return (long)ret_conv;
+}
+
uint32_t __attribute__((visibility("default"))) TS_CResult_RoutingFeesDecodeErrorZ_ok(uint32_t o) {
LDKRoutingFees o_conv;
o_conv.inner = (void*)(o & (~1));
_res_constr.data = NULL;
uint32_t* _res_vals = (uint32_t*)(_res + 4);
for (size_t m = 0; m < _res_constr.datalen; m++) {
- uint32_t arr_conv_12 = _res_vals[m];
- LDKNetAddress arr_conv_12_conv = *(LDKNetAddress*)(((uint64_t)arr_conv_12) & ~1);
- FREE((void*)arr_conv_12);
- _res_constr.data[m] = arr_conv_12_conv;
+ uint32_t _res_conv_12 = _res_vals[m];
+ LDKNetAddress _res_conv_12_conv = *(LDKNetAddress*)(((uint64_t)_res_conv_12) & ~1);
+ FREE((void*)_res_conv_12);
+ _res_constr.data[m] = _res_conv_12_conv;
}
CVec_NetAddressZ_free(_res_constr);
}
_res_constr.data = NULL;
int64_t* _res_vals = (int64_t*)(_res + 4);
for (size_t i = 0; i < _res_constr.datalen; i++) {
- int64_t arr_conv_8 = _res_vals[i];
- _res_constr.data[i] = arr_conv_8;
+ int64_t _res_conv_8 = _res_vals[i];
+ _res_constr.data[i] = _res_conv_8;
}
CVec_u64Z_free(_res_constr);
}
LDKNetworkGraph o_conv;
o_conv.inner = (void*)(o & (~1));
o_conv.is_owned = (o & 1) || (o == 0);
- // Warning: we need a move here but no clone is available for LDKNetworkGraph
+ o_conv = NetworkGraph_clone(&o_conv);
LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ");
*ret_conv = CResult_NetworkGraphDecodeErrorZ_ok(o_conv);
return (long)ret_conv;
CResult_NetworkGraphDecodeErrorZ_free(_res_conv);
}
+uint32_t __attribute__((visibility("default"))) TS_CResult_NetworkGraphDecodeErrorZ_clone(uint32_t orig) {
+ LDKCResult_NetworkGraphDecodeErrorZ* orig_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)(orig & ~1);
+ LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ");
+ *ret_conv = CResult_NetworkGraphDecodeErrorZ_clone(orig_conv);
+ return (long)ret_conv;
+}
+
uint32_t __attribute__((visibility("default"))) TS_C2Tuple_usizeTransactionZ_new(int64_t a, int8_tArray b) {
LDKTransaction b_ref;
b_ref.datalen = *((uint32_t*)b);
_res_constr.data = NULL;
uint32_t* _res_vals = (uint32_t*)(_res + 4);
for (size_t e = 0; e < _res_constr.datalen; e++) {
- uint32_t arr_conv_30 = _res_vals[e];
- LDKC2Tuple_usizeTransactionZ arr_conv_30_conv = *(LDKC2Tuple_usizeTransactionZ*)(((uint64_t)arr_conv_30) & ~1);
- FREE((void*)arr_conv_30);
- _res_constr.data[e] = arr_conv_30_conv;
+ uint32_t _res_conv_30 = _res_vals[e];
+ LDKC2Tuple_usizeTransactionZ _res_conv_30_conv = *(LDKC2Tuple_usizeTransactionZ*)(((uint64_t)_res_conv_30) & ~1);
+ FREE((void*)_res_conv_30);
+ _res_constr.data[e] = _res_conv_30_conv;
}
CVec_C2Tuple_usizeTransactionZZ_free(_res_constr);
}
_res_constr.data = NULL;
uint32_t* _res_vals = (uint32_t*)(_res + 4);
for (size_t o = 0; o < _res_constr.datalen; o++) {
- uint32_t arr_conv_14 = _res_vals[o];
- LDKMonitorEvent arr_conv_14_conv;
- arr_conv_14_conv.inner = (void*)(arr_conv_14 & (~1));
- arr_conv_14_conv.is_owned = (arr_conv_14 & 1) || (arr_conv_14 == 0);
- _res_constr.data[o] = arr_conv_14_conv;
+ uint32_t _res_conv_14 = _res_vals[o];
+ LDKMonitorEvent _res_conv_14_conv = *(LDKMonitorEvent*)(((uint64_t)_res_conv_14) & ~1);
+ FREE((void*)_res_conv_14);
+ _res_constr.data[o] = _res_conv_14_conv;
}
CVec_MonitorEventZ_free(_res_constr);
}
_res_constr.data = NULL;
uint32_t* _res_vals = (uint32_t*)(_res + 4);
for (size_t h = 0; h < _res_constr.datalen; h++) {
- uint32_t arr_conv_7 = _res_vals[h];
- LDKEvent arr_conv_7_conv = *(LDKEvent*)(((uint64_t)arr_conv_7) & ~1);
- FREE((void*)arr_conv_7);
- _res_constr.data[h] = arr_conv_7_conv;
+ uint32_t _res_conv_7 = _res_vals[h];
+ LDKEvent _res_conv_7_conv = *(LDKEvent*)(((uint64_t)_res_conv_7) & ~1);
+ FREE((void*)_res_conv_7);
+ _res_constr.data[h] = _res_conv_7_conv;
}
CVec_EventZ_free(_res_constr);
}
_res_constr.data = NULL;
int8_tArray* _res_vals = (int8_tArray*)(_res + 4);
for (size_t m = 0; m < _res_constr.datalen; m++) {
- int8_tArray arr_conv_12 = _res_vals[m];
- LDKTransaction arr_conv_12_ref;
- arr_conv_12_ref.datalen = *((uint32_t*)arr_conv_12);
- arr_conv_12_ref.data = MALLOC(arr_conv_12_ref.datalen, "LDKTransaction Bytes");
- memcpy(arr_conv_12_ref.data, (uint8_t*)(arr_conv_12 + 4), arr_conv_12_ref.datalen);
- arr_conv_12_ref.data_is_owned = true;
- _res_constr.data[m] = arr_conv_12_ref;
+ int8_tArray _res_conv_12 = _res_vals[m];
+ LDKTransaction _res_conv_12_ref;
+ _res_conv_12_ref.datalen = *((uint32_t*)_res_conv_12);
+ _res_conv_12_ref.data = MALLOC(_res_conv_12_ref.datalen, "LDKTransaction Bytes");
+ memcpy(_res_conv_12_ref.data, (uint8_t*)(_res_conv_12 + 4), _res_conv_12_ref.datalen);
+ _res_conv_12_ref.data_is_owned = true;
+ _res_constr.data[m] = _res_conv_12_ref;
}
CVec_TransactionZ_free(_res_constr);
}
_res_constr.data = NULL;
uint32_t* _res_vals = (uint32_t*)(_res + 4);
for (size_t z = 0; z < _res_constr.datalen; z++) {
- uint32_t arr_conv_25 = _res_vals[z];
- LDKC2Tuple_u32TxOutZ arr_conv_25_conv = *(LDKC2Tuple_u32TxOutZ*)(((uint64_t)arr_conv_25) & ~1);
- FREE((void*)arr_conv_25);
- _res_constr.data[z] = arr_conv_25_conv;
+ uint32_t _res_conv_25 = _res_vals[z];
+ LDKC2Tuple_u32TxOutZ _res_conv_25_conv = *(LDKC2Tuple_u32TxOutZ*)(((uint64_t)_res_conv_25) & ~1);
+ FREE((void*)_res_conv_25);
+ _res_constr.data[z] = _res_conv_25_conv;
}
CVec_C2Tuple_u32TxOutZZ_free(_res_constr);
}
b_constr.data = NULL;
uint32_t* b_vals = (uint32_t*)(b + 4);
for (size_t z = 0; z < b_constr.datalen; z++) {
- uint32_t arr_conv_25 = b_vals[z];
- LDKC2Tuple_u32TxOutZ arr_conv_25_conv = *(LDKC2Tuple_u32TxOutZ*)(((uint64_t)arr_conv_25) & ~1);
- FREE((void*)arr_conv_25);
- b_constr.data[z] = arr_conv_25_conv;
+ uint32_t b_conv_25 = b_vals[z];
+ LDKC2Tuple_u32TxOutZ b_conv_25_conv = *(LDKC2Tuple_u32TxOutZ*)(((uint64_t)b_conv_25) & ~1);
+ FREE((void*)b_conv_25);
+ b_constr.data[z] = b_conv_25_conv;
}
LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_ref = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
*ret_ref = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(a_ref, b_constr);
_res_constr.data = NULL;
uint32_t* _res_vals = (uint32_t*)(_res + 4);
for (size_t x = 0; x < _res_constr.datalen; x++) {
- uint32_t arr_conv_49 = _res_vals[x];
- LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ arr_conv_49_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(((uint64_t)arr_conv_49) & ~1);
- FREE((void*)arr_conv_49);
- _res_constr.data[x] = arr_conv_49_conv;
+ uint32_t _res_conv_49 = _res_vals[x];
+ LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res_conv_49_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(((uint64_t)_res_conv_49) & ~1);
+ FREE((void*)_res_conv_49);
+ _res_constr.data[x] = _res_conv_49_conv;
}
CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free(_res_constr);
}
_res_constr.data = NULL;
uint32_t* _res_vals = (uint32_t*)(_res + 4);
for (size_t b = 0; b < _res_constr.datalen; b++) {
- uint32_t arr_conv_27 = _res_vals[b];
- LDKSpendableOutputDescriptor arr_conv_27_conv = *(LDKSpendableOutputDescriptor*)(((uint64_t)arr_conv_27) & ~1);
- FREE((void*)arr_conv_27);
- _res_constr.data[b] = arr_conv_27_conv;
+ uint32_t _res_conv_27 = _res_vals[b];
+ LDKSpendableOutputDescriptor _res_conv_27_conv = *(LDKSpendableOutputDescriptor*)(((uint64_t)_res_conv_27) & ~1);
+ FREE((void*)_res_conv_27);
+ _res_constr.data[b] = _res_conv_27_conv;
}
CVec_SpendableOutputDescriptorZ_free(_res_constr);
}
return (long)ret_conv;
}
+void __attribute__((visibility("default"))) TS_CVec_CResult_NoneAPIErrorZZ_free(uint32_tArray _res) {
+ LDKCVec_CResult_NoneAPIErrorZZ _res_constr;
+ _res_constr.datalen = *((uint32_t*)_res);
+ if (_res_constr.datalen > 0)
+ _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
+ else
+ _res_constr.data = NULL;
+ uint32_t* _res_vals = (uint32_t*)(_res + 4);
+ for (size_t w = 0; w < _res_constr.datalen; w++) {
+ uint32_t _res_conv_22 = _res_vals[w];
+ LDKCResult_NoneAPIErrorZ _res_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(((uint64_t)_res_conv_22) & ~1);
+ FREE((void*)_res_conv_22);
+ _res_constr.data[w] = _res_conv_22_conv;
+ }
+ CVec_CResult_NoneAPIErrorZZ_free(_res_constr);
+}
+
+void __attribute__((visibility("default"))) TS_CVec_APIErrorZ_free(uint32_tArray _res) {
+ LDKCVec_APIErrorZ _res_constr;
+ _res_constr.datalen = *((uint32_t*)_res);
+ if (_res_constr.datalen > 0)
+ _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKAPIError), "LDKCVec_APIErrorZ Elements");
+ else
+ _res_constr.data = NULL;
+ uint32_t* _res_vals = (uint32_t*)(_res + 4);
+ for (size_t k = 0; k < _res_constr.datalen; k++) {
+ uint32_t _res_conv_10 = _res_vals[k];
+ LDKAPIError _res_conv_10_conv = *(LDKAPIError*)(((uint64_t)_res_conv_10) & ~1);
+ FREE((void*)_res_conv_10);
+ _res_constr.data[k] = _res_conv_10_conv;
+ }
+ CVec_APIErrorZ_free(_res_constr);
+}
+
void __attribute__((visibility("default"))) TS_CVec_ChannelDetailsZ_free(uint32_tArray _res) {
LDKCVec_ChannelDetailsZ _res_constr;
_res_constr.datalen = *((uint32_t*)_res);
_res_constr.data = NULL;
uint32_t* _res_vals = (uint32_t*)(_res + 4);
for (size_t q = 0; q < _res_constr.datalen; q++) {
- uint32_t arr_conv_16 = _res_vals[q];
- LDKChannelDetails arr_conv_16_conv;
- arr_conv_16_conv.inner = (void*)(arr_conv_16 & (~1));
- arr_conv_16_conv.is_owned = (arr_conv_16 & 1) || (arr_conv_16 == 0);
- _res_constr.data[q] = arr_conv_16_conv;
+ uint32_t _res_conv_16 = _res_vals[q];
+ LDKChannelDetails _res_conv_16_conv;
+ _res_conv_16_conv.inner = (void*)(_res_conv_16 & (~1));
+ _res_conv_16_conv.is_owned = (_res_conv_16 & 1) || (_res_conv_16 == 0);
+ _res_constr.data[q] = _res_conv_16_conv;
}
CVec_ChannelDetailsZ_free(_res_constr);
}
}
uint32_t __attribute__((visibility("default"))) TS_CResult_NonePaymentSendFailureZ_err(uint32_t e) {
- LDKPaymentSendFailure e_conv;
- e_conv.inner = (void*)(e & (~1));
- e_conv.is_owned = (e & 1) || (e == 0);
- e_conv = PaymentSendFailure_clone(&e_conv);
+ LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(((uint64_t)e) & ~1);
+ FREE((void*)e);
LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
*ret_conv = CResult_NonePaymentSendFailureZ_err(e_conv);
return (long)ret_conv;
_res_constr.data = NULL;
uint32_t* _res_vals = (uint32_t*)(_res + 4);
for (size_t q = 0; q < _res_constr.datalen; q++) {
- uint32_t arr_conv_16 = _res_vals[q];
- LDKChannelMonitor arr_conv_16_conv;
- arr_conv_16_conv.inner = (void*)(arr_conv_16 & (~1));
- arr_conv_16_conv.is_owned = (arr_conv_16 & 1) || (arr_conv_16 == 0);
- _res_constr.data[q] = arr_conv_16_conv;
+ uint32_t _res_conv_16 = _res_vals[q];
+ LDKChannelMonitor _res_conv_16_conv;
+ _res_conv_16_conv.inner = (void*)(_res_conv_16 & (~1));
+ _res_conv_16_conv.is_owned = (_res_conv_16 & 1) || (_res_conv_16 == 0);
+ _res_constr.data[q] = _res_conv_16_conv;
}
CVec_ChannelMonitorZ_free(_res_constr);
}
CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(_res_conv);
}
-uint32_t __attribute__((visibility("default"))) TS_C2Tuple_u64u64Z_clone(uint32_t orig) {
- LDKC2Tuple_u64u64Z* orig_conv = (LDKC2Tuple_u64u64Z*)(orig & ~1);
- LDKC2Tuple_u64u64Z* ret_ref = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
- *ret_ref = C2Tuple_u64u64Z_clone(orig_conv);
- return (long)ret_ref;
-}
-
-uint32_t __attribute__((visibility("default"))) TS_C2Tuple_u64u64Z_new(int64_t a, int64_t b) {
- LDKC2Tuple_u64u64Z* ret_ref = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
- *ret_ref = C2Tuple_u64u64Z_new(a, b);
- return (long)ret_ref;
-}
-
-void __attribute__((visibility("default"))) TS_C2Tuple_u64u64Z_free(uint32_t _res) {
- if ((_res & 1) != 0) return;
- LDKC2Tuple_u64u64Z _res_conv = *(LDKC2Tuple_u64u64Z*)(((uint64_t)_res) & ~1);
- FREE((void*)_res);
- C2Tuple_u64u64Z_free(_res_conv);
-}
-
uint32_t __attribute__((visibility("default"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_ok(uint32_t o) {
LDKSpendableOutputDescriptor o_conv = *(LDKSpendableOutputDescriptor*)(((uint64_t)o) & ~1);
FREE((void*)o);
b_constr.data = NULL;
int8_tArray* b_vals = (int8_tArray*)(b + 4);
for (size_t m = 0; m < b_constr.datalen; m++) {
- int8_tArray arr_conv_12 = b_vals[m];
- LDKSignature arr_conv_12_ref;
- CHECK(*((uint32_t*)arr_conv_12) == 64);
- memcpy(arr_conv_12_ref.compact_form, (uint8_t*)(arr_conv_12 + 4), 64);
- b_constr.data[m] = arr_conv_12_ref;
+ int8_tArray b_conv_12 = b_vals[m];
+ LDKSignature b_conv_12_ref;
+ CHECK(*((uint32_t*)b_conv_12) == 64);
+ memcpy(b_conv_12_ref.compact_form, (uint8_t*)(b_conv_12 + 4), 64);
+ b_constr.data[m] = b_conv_12_ref;
}
LDKC2Tuple_SignatureCVec_SignatureZZ* ret_ref = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
*ret_ref = C2Tuple_SignatureCVec_SignatureZZ_new(a_ref, b_constr);
return (long)ret_conv;
}
-uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelKeysDecodeErrorZ_ok(uint32_t o) {
- LDKChannelKeys o_conv = *(LDKChannelKeys*)(((uint64_t)o) & ~1);
- LDKCResult_ChannelKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelKeysDecodeErrorZ), "LDKCResult_ChannelKeysDecodeErrorZ");
- *ret_conv = CResult_ChannelKeysDecodeErrorZ_ok(o_conv);
+uint32_t __attribute__((visibility("default"))) TS_CResult_SignDecodeErrorZ_ok(uint32_t o) {
+ LDKSign o_conv = *(LDKSign*)(((uint64_t)o) & ~1);
+ LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
+ *ret_conv = CResult_SignDecodeErrorZ_ok(o_conv);
return (long)ret_conv;
}
-uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelKeysDecodeErrorZ_err(uint32_t e) {
+uint32_t __attribute__((visibility("default"))) TS_CResult_SignDecodeErrorZ_err(uint32_t e) {
LDKDecodeError e_conv;
e_conv.inner = (void*)(e & (~1));
e_conv.is_owned = (e & 1) || (e == 0);
e_conv = DecodeError_clone(&e_conv);
- LDKCResult_ChannelKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelKeysDecodeErrorZ), "LDKCResult_ChannelKeysDecodeErrorZ");
- *ret_conv = CResult_ChannelKeysDecodeErrorZ_err(e_conv);
+ LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
+ *ret_conv = CResult_SignDecodeErrorZ_err(e_conv);
+ return (long)ret_conv;
+}
+
+void __attribute__((visibility("default"))) TS_CResult_SignDecodeErrorZ_free(uint32_t _res) {
+ if ((_res & 1) != 0) return;
+ LDKCResult_SignDecodeErrorZ _res_conv = *(LDKCResult_SignDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ FREE((void*)_res);
+ CResult_SignDecodeErrorZ_free(_res_conv);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_CResult_SignDecodeErrorZ_clone(uint32_t orig) {
+ LDKCResult_SignDecodeErrorZ* orig_conv = (LDKCResult_SignDecodeErrorZ*)(orig & ~1);
+ LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
+ *ret_conv = CResult_SignDecodeErrorZ_clone(orig_conv);
+ return (long)ret_conv;
+}
+
+void __attribute__((visibility("default"))) TS_CVec_CVec_u8ZZ_free(ptrArray _res) {
+ LDKCVec_CVec_u8ZZ _res_constr;
+ _res_constr.datalen = *((uint32_t*)_res);
+ if (_res_constr.datalen > 0)
+ _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKCVec_u8Z), "LDKCVec_CVec_u8ZZ Elements");
+ else
+ _res_constr.data = NULL;
+ int8_tArray* _res_vals = (int8_tArray*)(_res + 4);
+ for (size_t m = 0; m < _res_constr.datalen; m++) {
+ int8_tArray _res_conv_12 = _res_vals[m];
+ LDKCVec_u8Z _res_conv_12_ref;
+ _res_conv_12_ref.datalen = *((uint32_t*)_res_conv_12);
+ _res_conv_12_ref.data = MALLOC(_res_conv_12_ref.datalen, "LDKCVec_u8Z Bytes");
+ memcpy(_res_conv_12_ref.data, (uint8_t*)(_res_conv_12 + 4), _res_conv_12_ref.datalen);
+ _res_constr.data[m] = _res_conv_12_ref;
+ }
+ CVec_CVec_u8ZZ_free(_res_constr);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_CResult_CVec_CVec_u8ZZNoneZ_ok(ptrArray o) {
+ LDKCVec_CVec_u8ZZ o_constr;
+ o_constr.datalen = *((uint32_t*)o);
+ if (o_constr.datalen > 0)
+ o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKCVec_u8Z), "LDKCVec_CVec_u8ZZ Elements");
+ else
+ o_constr.data = NULL;
+ int8_tArray* o_vals = (int8_tArray*)(o + 4);
+ for (size_t m = 0; m < o_constr.datalen; m++) {
+ int8_tArray o_conv_12 = o_vals[m];
+ LDKCVec_u8Z o_conv_12_ref;
+ o_conv_12_ref.datalen = *((uint32_t*)o_conv_12);
+ o_conv_12_ref.data = MALLOC(o_conv_12_ref.datalen, "LDKCVec_u8Z Bytes");
+ memcpy(o_conv_12_ref.data, (uint8_t*)(o_conv_12 + 4), o_conv_12_ref.datalen);
+ o_constr.data[m] = o_conv_12_ref;
+ }
+ LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
+ *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_ok(o_constr);
+ return (long)ret_conv;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_CResult_CVec_CVec_u8ZZNoneZ_err() {
+ LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
+ *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_err();
return (long)ret_conv;
}
-void __attribute__((visibility("default"))) TS_CResult_ChannelKeysDecodeErrorZ_free(uint32_t _res) {
+void __attribute__((visibility("default"))) TS_CResult_CVec_CVec_u8ZZNoneZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ChannelKeysDecodeErrorZ _res_conv = *(LDKCResult_ChannelKeysDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ LDKCResult_CVec_CVec_u8ZZNoneZ _res_conv = *(LDKCResult_CVec_CVec_u8ZZNoneZ*)(((uint64_t)_res) & ~1);
FREE((void*)_res);
- CResult_ChannelKeysDecodeErrorZ_free(_res_conv);
+ CResult_CVec_CVec_u8ZZNoneZ_free(_res_conv);
}
-uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelKeysDecodeErrorZ_clone(uint32_t orig) {
- LDKCResult_ChannelKeysDecodeErrorZ* orig_conv = (LDKCResult_ChannelKeysDecodeErrorZ*)(orig & ~1);
- LDKCResult_ChannelKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelKeysDecodeErrorZ), "LDKCResult_ChannelKeysDecodeErrorZ");
- *ret_conv = CResult_ChannelKeysDecodeErrorZ_clone(orig_conv);
+uint32_t __attribute__((visibility("default"))) TS_CResult_CVec_CVec_u8ZZNoneZ_clone(uint32_t orig) {
+ LDKCResult_CVec_CVec_u8ZZNoneZ* orig_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)(orig & ~1);
+ LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
+ *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone(orig_conv);
return (long)ret_conv;
}
-uint32_t __attribute__((visibility("default"))) TS_CResult_InMemoryChannelKeysDecodeErrorZ_ok(uint32_t o) {
- LDKInMemoryChannelKeys o_conv;
+uint32_t __attribute__((visibility("default"))) TS_CResult_InMemorySignerDecodeErrorZ_ok(uint32_t o) {
+ LDKInMemorySigner o_conv;
o_conv.inner = (void*)(o & (~1));
o_conv.is_owned = (o & 1) || (o == 0);
- o_conv = InMemoryChannelKeys_clone(&o_conv);
- LDKCResult_InMemoryChannelKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemoryChannelKeysDecodeErrorZ), "LDKCResult_InMemoryChannelKeysDecodeErrorZ");
- *ret_conv = CResult_InMemoryChannelKeysDecodeErrorZ_ok(o_conv);
+ o_conv = InMemorySigner_clone(&o_conv);
+ LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
+ *ret_conv = CResult_InMemorySignerDecodeErrorZ_ok(o_conv);
return (long)ret_conv;
}
-uint32_t __attribute__((visibility("default"))) TS_CResult_InMemoryChannelKeysDecodeErrorZ_err(uint32_t e) {
+uint32_t __attribute__((visibility("default"))) TS_CResult_InMemorySignerDecodeErrorZ_err(uint32_t e) {
LDKDecodeError e_conv;
e_conv.inner = (void*)(e & (~1));
e_conv.is_owned = (e & 1) || (e == 0);
e_conv = DecodeError_clone(&e_conv);
- LDKCResult_InMemoryChannelKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemoryChannelKeysDecodeErrorZ), "LDKCResult_InMemoryChannelKeysDecodeErrorZ");
- *ret_conv = CResult_InMemoryChannelKeysDecodeErrorZ_err(e_conv);
+ LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
+ *ret_conv = CResult_InMemorySignerDecodeErrorZ_err(e_conv);
return (long)ret_conv;
}
-void __attribute__((visibility("default"))) TS_CResult_InMemoryChannelKeysDecodeErrorZ_free(uint32_t _res) {
+void __attribute__((visibility("default"))) TS_CResult_InMemorySignerDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_InMemoryChannelKeysDecodeErrorZ _res_conv = *(LDKCResult_InMemoryChannelKeysDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ LDKCResult_InMemorySignerDecodeErrorZ _res_conv = *(LDKCResult_InMemorySignerDecodeErrorZ*)(((uint64_t)_res) & ~1);
FREE((void*)_res);
- CResult_InMemoryChannelKeysDecodeErrorZ_free(_res_conv);
+ CResult_InMemorySignerDecodeErrorZ_free(_res_conv);
}
-uint32_t __attribute__((visibility("default"))) TS_CResult_InMemoryChannelKeysDecodeErrorZ_clone(uint32_t orig) {
- LDKCResult_InMemoryChannelKeysDecodeErrorZ* orig_conv = (LDKCResult_InMemoryChannelKeysDecodeErrorZ*)(orig & ~1);
- LDKCResult_InMemoryChannelKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemoryChannelKeysDecodeErrorZ), "LDKCResult_InMemoryChannelKeysDecodeErrorZ");
- *ret_conv = CResult_InMemoryChannelKeysDecodeErrorZ_clone(orig_conv);
+uint32_t __attribute__((visibility("default"))) TS_CResult_InMemorySignerDecodeErrorZ_clone(uint32_t orig) {
+ LDKCResult_InMemorySignerDecodeErrorZ* orig_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)(orig & ~1);
+ LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
+ *ret_conv = CResult_InMemorySignerDecodeErrorZ_clone(orig_conv);
return (long)ret_conv;
}
+void __attribute__((visibility("default"))) TS_CVec_TxOutZ_free(uint32_tArray _res) {
+ LDKCVec_TxOutZ _res_constr;
+ _res_constr.datalen = *((uint32_t*)_res);
+ if (_res_constr.datalen > 0)
+ _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements");
+ else
+ _res_constr.data = NULL;
+ uint32_t* _res_vals = (uint32_t*)(_res + 4);
+ for (size_t h = 0; h < _res_constr.datalen; h++) {
+ uint32_t _res_conv_7 = _res_vals[h];
+ LDKTxOut _res_conv_7_conv = *(LDKTxOut*)(((uint64_t)_res_conv_7) & ~1);
+ FREE((void*)_res_conv_7);
+ _res_constr.data[h] = _res_conv_7_conv;
+ }
+ CVec_TxOutZ_free(_res_constr);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_CResult_TransactionNoneZ_ok(int8_tArray o) {
+ LDKTransaction o_ref;
+ o_ref.datalen = *((uint32_t*)o);
+ o_ref.data = MALLOC(o_ref.datalen, "LDKTransaction Bytes");
+ memcpy(o_ref.data, (uint8_t*)(o + 4), o_ref.datalen);
+ o_ref.data_is_owned = true;
+ LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
+ *ret_conv = CResult_TransactionNoneZ_ok(o_ref);
+ return (long)ret_conv;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_CResult_TransactionNoneZ_err() {
+ LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
+ *ret_conv = CResult_TransactionNoneZ_err();
+ return (long)ret_conv;
+}
+
+void __attribute__((visibility("default"))) TS_CResult_TransactionNoneZ_free(uint32_t _res) {
+ if ((_res & 1) != 0) return;
+ LDKCResult_TransactionNoneZ _res_conv = *(LDKCResult_TransactionNoneZ*)(((uint64_t)_res) & ~1);
+ FREE((void*)_res);
+ CResult_TransactionNoneZ_free(_res_conv);
+}
+
void __attribute__((visibility("default"))) TS_CVec_RouteHopZ_free(uint32_tArray _res) {
LDKCVec_RouteHopZ _res_constr;
_res_constr.datalen = *((uint32_t*)_res);
_res_constr.data = NULL;
uint32_t* _res_vals = (uint32_t*)(_res + 4);
for (size_t k = 0; k < _res_constr.datalen; k++) {
- uint32_t arr_conv_10 = _res_vals[k];
- LDKRouteHop arr_conv_10_conv;
- arr_conv_10_conv.inner = (void*)(arr_conv_10 & (~1));
- arr_conv_10_conv.is_owned = (arr_conv_10 & 1) || (arr_conv_10 == 0);
- _res_constr.data[k] = arr_conv_10_conv;
+ uint32_t _res_conv_10 = _res_vals[k];
+ LDKRouteHop _res_conv_10_conv;
+ _res_conv_10_conv.inner = (void*)(_res_conv_10 & (~1));
+ _res_conv_10_conv.is_owned = (_res_conv_10 & 1) || (_res_conv_10 == 0);
+ _res_constr.data[k] = _res_conv_10_conv;
}
CVec_RouteHopZ_free(_res_constr);
}
_res_constr.data = NULL;
uint32_tArray* _res_vals = (uint32_tArray*)(_res + 4);
for (size_t m = 0; m < _res_constr.datalen; m++) {
- uint32_tArray arr_conv_12 = _res_vals[m];
- LDKCVec_RouteHopZ arr_conv_12_constr;
- arr_conv_12_constr.datalen = *((uint32_t*)arr_conv_12);
- if (arr_conv_12_constr.datalen > 0)
- arr_conv_12_constr.data = MALLOC(arr_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
+ uint32_tArray _res_conv_12 = _res_vals[m];
+ LDKCVec_RouteHopZ _res_conv_12_constr;
+ _res_conv_12_constr.datalen = *((uint32_t*)_res_conv_12);
+ if (_res_conv_12_constr.datalen > 0)
+ _res_conv_12_constr.data = MALLOC(_res_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
else
- arr_conv_12_constr.data = NULL;
- uint32_t* arr_conv_12_vals = (uint32_t*)(arr_conv_12 + 4);
- for (size_t k = 0; k < arr_conv_12_constr.datalen; k++) {
- uint32_t arr_conv_10 = arr_conv_12_vals[k];
- LDKRouteHop arr_conv_10_conv;
- arr_conv_10_conv.inner = (void*)(arr_conv_10 & (~1));
- arr_conv_10_conv.is_owned = (arr_conv_10 & 1) || (arr_conv_10 == 0);
- arr_conv_12_constr.data[k] = arr_conv_10_conv;
+ _res_conv_12_constr.data = NULL;
+ uint32_t* _res_conv_12_vals = (uint32_t*)(_res_conv_12 + 4);
+ for (size_t k = 0; k < _res_conv_12_constr.datalen; k++) {
+ uint32_t _res_conv_12_conv_10 = _res_conv_12_vals[k];
+ LDKRouteHop _res_conv_12_conv_10_conv;
+ _res_conv_12_conv_10_conv.inner = (void*)(_res_conv_12_conv_10 & (~1));
+ _res_conv_12_conv_10_conv.is_owned = (_res_conv_12_conv_10 & 1) || (_res_conv_12_conv_10 == 0);
+ _res_conv_12_constr.data[k] = _res_conv_12_conv_10_conv;
}
- _res_constr.data[m] = arr_conv_12_constr;
+ _res_constr.data[m] = _res_conv_12_constr;
}
CVec_CVec_RouteHopZZ_free(_res_constr);
}
_res_constr.data = NULL;
uint32_t* _res_vals = (uint32_t*)(_res + 4);
for (size_t l = 0; l < _res_constr.datalen; l++) {
- uint32_t arr_conv_11 = _res_vals[l];
- LDKRouteHint arr_conv_11_conv;
- arr_conv_11_conv.inner = (void*)(arr_conv_11 & (~1));
- arr_conv_11_conv.is_owned = (arr_conv_11 & 1) || (arr_conv_11 == 0);
- _res_constr.data[l] = arr_conv_11_conv;
+ uint32_t _res_conv_11 = _res_vals[l];
+ LDKRouteHint _res_conv_11_conv;
+ _res_conv_11_conv.inner = (void*)(_res_conv_11 & (~1));
+ _res_conv_11_conv.is_owned = (_res_conv_11 & 1) || (_res_conv_11 == 0);
+ _res_constr.data[l] = _res_conv_11_conv;
}
CVec_RouteHintZ_free(_res_constr);
}
_res_constr.data = NULL;
uint32_t* _res_vals = (uint32_t*)(_res + 4);
for (size_t p = 0; p < _res_constr.datalen; p++) {
- uint32_t arr_conv_15 = _res_vals[p];
- LDKUpdateAddHTLC arr_conv_15_conv;
- arr_conv_15_conv.inner = (void*)(arr_conv_15 & (~1));
- arr_conv_15_conv.is_owned = (arr_conv_15 & 1) || (arr_conv_15 == 0);
- _res_constr.data[p] = arr_conv_15_conv;
+ uint32_t _res_conv_15 = _res_vals[p];
+ LDKUpdateAddHTLC _res_conv_15_conv;
+ _res_conv_15_conv.inner = (void*)(_res_conv_15 & (~1));
+ _res_conv_15_conv.is_owned = (_res_conv_15 & 1) || (_res_conv_15 == 0);
+ _res_constr.data[p] = _res_conv_15_conv;
}
CVec_UpdateAddHTLCZ_free(_res_constr);
}
_res_constr.data = NULL;
uint32_t* _res_vals = (uint32_t*)(_res + 4);
for (size_t t = 0; t < _res_constr.datalen; t++) {
- uint32_t arr_conv_19 = _res_vals[t];
- LDKUpdateFulfillHTLC arr_conv_19_conv;
- arr_conv_19_conv.inner = (void*)(arr_conv_19 & (~1));
- arr_conv_19_conv.is_owned = (arr_conv_19 & 1) || (arr_conv_19 == 0);
- _res_constr.data[t] = arr_conv_19_conv;
+ uint32_t _res_conv_19 = _res_vals[t];
+ LDKUpdateFulfillHTLC _res_conv_19_conv;
+ _res_conv_19_conv.inner = (void*)(_res_conv_19 & (~1));
+ _res_conv_19_conv.is_owned = (_res_conv_19 & 1) || (_res_conv_19 == 0);
+ _res_constr.data[t] = _res_conv_19_conv;
}
CVec_UpdateFulfillHTLCZ_free(_res_constr);
}
_res_constr.data = NULL;
uint32_t* _res_vals = (uint32_t*)(_res + 4);
for (size_t q = 0; q < _res_constr.datalen; q++) {
- uint32_t arr_conv_16 = _res_vals[q];
- LDKUpdateFailHTLC arr_conv_16_conv;
- arr_conv_16_conv.inner = (void*)(arr_conv_16 & (~1));
- arr_conv_16_conv.is_owned = (arr_conv_16 & 1) || (arr_conv_16 == 0);
- _res_constr.data[q] = arr_conv_16_conv;
+ uint32_t _res_conv_16 = _res_vals[q];
+ LDKUpdateFailHTLC _res_conv_16_conv;
+ _res_conv_16_conv.inner = (void*)(_res_conv_16 & (~1));
+ _res_conv_16_conv.is_owned = (_res_conv_16 & 1) || (_res_conv_16 == 0);
+ _res_constr.data[q] = _res_conv_16_conv;
}
CVec_UpdateFailHTLCZ_free(_res_constr);
}
_res_constr.data = NULL;
uint32_t* _res_vals = (uint32_t*)(_res + 4);
for (size_t z = 0; z < _res_constr.datalen; z++) {
- uint32_t arr_conv_25 = _res_vals[z];
- LDKUpdateFailMalformedHTLC arr_conv_25_conv;
- arr_conv_25_conv.inner = (void*)(arr_conv_25 & (~1));
- arr_conv_25_conv.is_owned = (arr_conv_25 & 1) || (arr_conv_25 == 0);
- _res_constr.data[z] = arr_conv_25_conv;
+ uint32_t _res_conv_25 = _res_vals[z];
+ LDKUpdateFailMalformedHTLC _res_conv_25_conv;
+ _res_conv_25_conv.inner = (void*)(_res_conv_25 & (~1));
+ _res_conv_25_conv.is_owned = (_res_conv_25 & 1) || (_res_conv_25 == 0);
+ _res_constr.data[z] = _res_conv_25_conv;
}
CVec_UpdateFailMalformedHTLCZ_free(_res_constr);
}
int8_tArray __attribute__((visibility("default"))) TS_Event_write(uint32_t obj) {
LDKEvent* obj_conv = (LDKEvent*)obj;
- LDKCVec_u8Z arg_var = Event_write(obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = Event_write(obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_MessageSendEvent_free(uint32_t this_ptr) {
LDKChannelConfig obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = ChannelConfig_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = ChannelConfig_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_ChannelConfig_read(int8_tArray ser) {
Access_free(this_ptr_conv);
}
+void __attribute__((visibility("default"))) TS_Listen_free(uint32_t this_ptr) {
+ if ((this_ptr & 1) != 0) return;
+ LDKListen this_ptr_conv = *(LDKListen*)(((uint64_t)this_ptr) & ~1);
+ FREE((void*)this_ptr);
+ Listen_free(this_ptr_conv);
+}
+
void __attribute__((visibility("default"))) TS_Watch_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
LDKWatch this_ptr_conv = *(LDKWatch*)(((uint64_t)this_ptr) & ~1);
txdata_constr.data = NULL;
uint32_t* txdata_vals = (uint32_t*)(txdata + 4);
for (size_t e = 0; e < txdata_constr.datalen; e++) {
- uint32_t arr_conv_30 = txdata_vals[e];
- LDKC2Tuple_usizeTransactionZ arr_conv_30_conv = *(LDKC2Tuple_usizeTransactionZ*)(((uint64_t)arr_conv_30) & ~1);
- FREE((void*)arr_conv_30);
- txdata_constr.data[e] = arr_conv_30_conv;
+ uint32_t txdata_conv_30 = txdata_vals[e];
+ LDKC2Tuple_usizeTransactionZ txdata_conv_30_conv = *(LDKC2Tuple_usizeTransactionZ*)(((uint64_t)txdata_conv_30) & ~1);
+ FREE((void*)txdata_conv_30);
+ txdata_constr.data[e] = txdata_conv_30_conv;
}
ChainMonitor_block_connected(&this_arg_conv, header_ref, txdata_constr, height);
}
LDKChannelMonitorUpdate obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = ChannelMonitorUpdate_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = ChannelMonitorUpdate_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_ChannelMonitorUpdate_read(int8_tArray ser) {
}
void __attribute__((visibility("default"))) TS_MonitorEvent_free(uint32_t this_ptr) {
- LDKMonitorEvent this_ptr_conv;
- this_ptr_conv.inner = (void*)(this_ptr & (~1));
- this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+ if ((this_ptr & 1) != 0) return;
+ LDKMonitorEvent this_ptr_conv = *(LDKMonitorEvent*)(((uint64_t)this_ptr) & ~1);
+ FREE((void*)this_ptr);
MonitorEvent_free(this_ptr_conv);
}
uint32_t __attribute__((visibility("default"))) TS_MonitorEvent_clone(uint32_t orig) {
- LDKMonitorEvent orig_conv;
- orig_conv.inner = (void*)(orig & (~1));
- orig_conv.is_owned = false;
- LDKMonitorEvent ret_var = MonitorEvent_clone(&orig_conv);
- 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;
- if (ret_var.is_owned) {
- ret_ref |= 1;
- }
+ LDKMonitorEvent* orig_conv = (LDKMonitorEvent*)orig;
+ LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
+ *ret_copy = MonitorEvent_clone(orig_conv);
+ long ret_ref = (long)ret_copy;
return ret_ref;
}
LDKHTLCUpdate obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = HTLCUpdate_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = HTLCUpdate_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_HTLCUpdate_read(int8_tArray ser) {
LDKChannelMonitor obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = ChannelMonitor_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = ChannelMonitor_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_ChannelMonitor_update_monitor(uint32_t this_arg, uint32_t updates, uint32_t broadcaster, uint32_t fee_estimator, uint32_t logger) {
uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t o = 0; o < ret_var.datalen; o++) {
- LDKMonitorEvent arr_conv_14_var = ret_var.data[o];
- CHECK((((long)arr_conv_14_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
- CHECK((((long)&arr_conv_14_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- long arr_conv_14_ref = (long)arr_conv_14_var.inner;
- if (arr_conv_14_var.is_owned) {
- arr_conv_14_ref |= 1;
- }
- ret_arr_ptr[o] = arr_conv_14_ref;
+ LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
+ *ret_conv_14_copy = MonitorEvent_clone(&ret_var.data[o]);
+ long ret_conv_14_ref = (long)ret_conv_14_copy;
+ ret_arr_ptr[o] = ret_conv_14_ref;
}
FREE(ret_var.data);
return ret_arr;
uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t h = 0; h < ret_var.datalen; h++) {
- LDKEvent *arr_conv_7_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
- *arr_conv_7_copy = Event_clone(&ret_var.data[h]);
- long arr_conv_7_ref = (long)arr_conv_7_copy;
- ret_arr_ptr[h] = arr_conv_7_ref;
+ LDKEvent *ret_conv_7_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
+ *ret_conv_7_copy = Event_clone(&ret_var.data[h]);
+ long ret_conv_7_ref = (long)ret_conv_7_copy;
+ ret_arr_ptr[h] = ret_conv_7_ref;
}
FREE(ret_var.data);
return ret_arr;
ptrArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native ptrArray Bytes");
int8_tArray *ret_arr_ptr = (int8_tArray*)(ret_arr + 4);
for (size_t m = 0; m < ret_var.datalen; m++) {
- LDKTransaction arr_conv_12_var = ret_var.data[m];
- int8_tArray arr_conv_12_arr = init_arr(arr_conv_12_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arr_conv_12_arr + 4), arr_conv_12_var.data, arr_conv_12_var.datalen);
- Transaction_free(arr_conv_12_var);
- ret_arr_ptr[m] = arr_conv_12_arr;
+ LDKTransaction ret_conv_12_var = ret_var.data[m];
+ int8_tArray ret_conv_12_arr = init_arr(ret_conv_12_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_conv_12_arr + 4), ret_conv_12_var.data, ret_conv_12_var.datalen);
+ Transaction_free(ret_conv_12_var);
+ ret_arr_ptr[m] = ret_conv_12_arr;
}
FREE(ret_var.data);
return ret_arr;
txdata_constr.data = NULL;
uint32_t* txdata_vals = (uint32_t*)(txdata + 4);
for (size_t e = 0; e < txdata_constr.datalen; e++) {
- uint32_t arr_conv_30 = txdata_vals[e];
- LDKC2Tuple_usizeTransactionZ arr_conv_30_conv = *(LDKC2Tuple_usizeTransactionZ*)(((uint64_t)arr_conv_30) & ~1);
- FREE((void*)arr_conv_30);
- txdata_constr.data[e] = arr_conv_30_conv;
+ uint32_t txdata_conv_30 = txdata_vals[e];
+ LDKC2Tuple_usizeTransactionZ txdata_conv_30_conv = *(LDKC2Tuple_usizeTransactionZ*)(((uint64_t)txdata_conv_30) & ~1);
+ FREE((void*)txdata_conv_30);
+ txdata_constr.data[e] = txdata_conv_30_conv;
}
LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(((uint64_t)broadcaster) & ~1);
LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(((uint64_t)fee_estimator) & ~1);
uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t x = 0; x < ret_var.datalen; x++) {
- LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* arr_conv_49_ref = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
- *arr_conv_49_ref = ret_var.data[x];
- ret_arr_ptr[x] = (long)arr_conv_49_ref;
+ LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_49_ref = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
+ *ret_conv_49_ref = ret_var.data[x];
+ ret_arr_ptr[x] = (long)ret_conv_49_ref;
}
FREE(ret_var.data);
return ret_arr;
OutPoint_free(this_ptr_conv);
}
-int8_tArray __attribute__((visibility("default"))) TS_OutPoint_get_txid(uint32_t this_ptr) {
- LDKOutPoint this_ptr_conv;
+int8_tArray __attribute__((visibility("default"))) TS_OutPoint_get_txid(uint32_t this_ptr) {
+ LDKOutPoint this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), *OutPoint_get_txid(&this_ptr_conv), 32);
+ return ret_arr;
+}
+
+void __attribute__((visibility("default"))) TS_OutPoint_set_txid(uint32_t this_ptr, int8_tArray val) {
+ LDKOutPoint this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKThirtyTwoBytes val_ref;
+ CHECK(*((uint32_t*)val) == 32);
+ memcpy(val_ref.data, (uint8_t*)(val + 4), 32);
+ OutPoint_set_txid(&this_ptr_conv, val_ref);
+}
+
+int16_t __attribute__((visibility("default"))) TS_OutPoint_get_index(uint32_t this_ptr) {
+ LDKOutPoint this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ int16_t ret_val = OutPoint_get_index(&this_ptr_conv);
+ return ret_val;
+}
+
+void __attribute__((visibility("default"))) TS_OutPoint_set_index(uint32_t this_ptr, int16_t val) {
+ LDKOutPoint this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ OutPoint_set_index(&this_ptr_conv, val);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_OutPoint_new(int8_tArray txid_arg, int16_t index_arg) {
+ LDKThirtyTwoBytes txid_arg_ref;
+ CHECK(*((uint32_t*)txid_arg) == 32);
+ memcpy(txid_arg_ref.data, (uint8_t*)(txid_arg + 4), 32);
+ LDKOutPoint ret_var = OutPoint_new(txid_arg_ref, index_arg);
+ 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;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_OutPoint_clone(uint32_t orig) {
+ LDKOutPoint orig_conv;
+ orig_conv.inner = (void*)(orig & (~1));
+ orig_conv.is_owned = false;
+ LDKOutPoint ret_var = OutPoint_clone(&orig_conv);
+ 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;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
+int8_tArray __attribute__((visibility("default"))) TS_OutPoint_to_channel_id(uint32_t this_arg) {
+ LDKOutPoint this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), OutPoint_to_channel_id(&this_arg_conv).data, 32);
+ return ret_arr;
+}
+
+int8_tArray __attribute__((visibility("default"))) TS_OutPoint_write(uint32_t obj) {
+ LDKOutPoint obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z ret_var = OutPoint_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_OutPoint_read(int8_tArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = *((uint32_t*)ser);
+ ser_ref.data = (int8_t*)(ser + 4);
+ LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
+ *ret_conv = OutPoint_read(ser_ref);
+ return (long)ret_conv;
+}
+
+void __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescriptor_free(uint32_t this_ptr) {
+ LDKDelayedPaymentOutputDescriptor this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+ DelayedPaymentOutputDescriptor_free(this_ptr_conv);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescriptor_get_outpoint(uint32_t this_ptr) {
+ LDKDelayedPaymentOutputDescriptor this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKOutPoint ret_var = DelayedPaymentOutputDescriptor_get_outpoint(&this_ptr_conv);
+ 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;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
+void __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescriptor_set_outpoint(uint32_t this_ptr, uint32_t val) {
+ LDKDelayedPaymentOutputDescriptor this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKOutPoint val_conv;
+ val_conv.inner = (void*)(val & (~1));
+ val_conv.is_owned = (val & 1) || (val == 0);
+ val_conv = OutPoint_clone(&val_conv);
+ DelayedPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv);
+}
+
+int8_tArray __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescriptor_get_per_commitment_point(uint32_t this_ptr) {
+ LDKDelayedPaymentOutputDescriptor this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), DelayedPaymentOutputDescriptor_get_per_commitment_point(&this_ptr_conv).compressed_form, 33);
+ return ret_arr;
+}
+
+void __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescriptor_set_per_commitment_point(uint32_t this_ptr, int8_tArray val) {
+ LDKDelayedPaymentOutputDescriptor this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKPublicKey val_ref;
+ CHECK(*((uint32_t*)val) == 33);
+ memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33);
+ DelayedPaymentOutputDescriptor_set_per_commitment_point(&this_ptr_conv, val_ref);
+}
+
+int16_t __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescriptor_get_to_self_delay(uint32_t this_ptr) {
+ LDKDelayedPaymentOutputDescriptor this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ int16_t ret_val = DelayedPaymentOutputDescriptor_get_to_self_delay(&this_ptr_conv);
+ return ret_val;
+}
+
+void __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescriptor_set_to_self_delay(uint32_t this_ptr, int16_t val) {
+ LDKDelayedPaymentOutputDescriptor this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ DelayedPaymentOutputDescriptor_set_to_self_delay(&this_ptr_conv, val);
+}
+
+void __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescriptor_set_output(uint32_t this_ptr, uint32_t val) {
+ LDKDelayedPaymentOutputDescriptor this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKTxOut val_conv = *(LDKTxOut*)(((uint64_t)val) & ~1);
+ FREE((void*)val);
+ DelayedPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv);
+}
+
+int8_tArray __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescriptor_get_revocation_pubkey(uint32_t this_ptr) {
+ LDKDelayedPaymentOutputDescriptor this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), DelayedPaymentOutputDescriptor_get_revocation_pubkey(&this_ptr_conv).compressed_form, 33);
+ return ret_arr;
+}
+
+void __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescriptor_set_revocation_pubkey(uint32_t this_ptr, int8_tArray val) {
+ LDKDelayedPaymentOutputDescriptor this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKPublicKey val_ref;
+ CHECK(*((uint32_t*)val) == 33);
+ memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33);
+ DelayedPaymentOutputDescriptor_set_revocation_pubkey(&this_ptr_conv, val_ref);
+}
+
+int8_tArray __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescriptor_get_channel_keys_id(uint32_t this_ptr) {
+ LDKDelayedPaymentOutputDescriptor this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), *DelayedPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv), 32);
+ return ret_arr;
+}
+
+void __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescriptor_set_channel_keys_id(uint32_t this_ptr, int8_tArray val) {
+ LDKDelayedPaymentOutputDescriptor this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKThirtyTwoBytes val_ref;
+ CHECK(*((uint32_t*)val) == 32);
+ memcpy(val_ref.data, (uint8_t*)(val + 4), 32);
+ DelayedPaymentOutputDescriptor_set_channel_keys_id(&this_ptr_conv, val_ref);
+}
+
+int64_t __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescriptor_get_channel_value_satoshis(uint32_t this_ptr) {
+ LDKDelayedPaymentOutputDescriptor this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ int64_t ret_val = DelayedPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv);
+ return ret_val;
+}
+
+void __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescriptor_set_channel_value_satoshis(uint32_t this_ptr, int64_t val) {
+ LDKDelayedPaymentOutputDescriptor this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ DelayedPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescriptor_new(uint32_t outpoint_arg, int8_tArray per_commitment_point_arg, int16_t to_self_delay_arg, uint32_t output_arg, int8_tArray revocation_pubkey_arg, int8_tArray channel_keys_id_arg, int64_t channel_value_satoshis_arg) {
+ LDKOutPoint outpoint_arg_conv;
+ outpoint_arg_conv.inner = (void*)(outpoint_arg & (~1));
+ outpoint_arg_conv.is_owned = (outpoint_arg & 1) || (outpoint_arg == 0);
+ outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv);
+ LDKPublicKey per_commitment_point_arg_ref;
+ CHECK(*((uint32_t*)per_commitment_point_arg) == 33);
+ memcpy(per_commitment_point_arg_ref.compressed_form, (uint8_t*)(per_commitment_point_arg + 4), 33);
+ LDKTxOut output_arg_conv = *(LDKTxOut*)(((uint64_t)output_arg) & ~1);
+ FREE((void*)output_arg);
+ LDKPublicKey revocation_pubkey_arg_ref;
+ CHECK(*((uint32_t*)revocation_pubkey_arg) == 33);
+ memcpy(revocation_pubkey_arg_ref.compressed_form, (uint8_t*)(revocation_pubkey_arg + 4), 33);
+ LDKThirtyTwoBytes channel_keys_id_arg_ref;
+ CHECK(*((uint32_t*)channel_keys_id_arg) == 32);
+ memcpy(channel_keys_id_arg_ref.data, (uint8_t*)(channel_keys_id_arg + 4), 32);
+ LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_new(outpoint_arg_conv, per_commitment_point_arg_ref, to_self_delay_arg, output_arg_conv, revocation_pubkey_arg_ref, channel_keys_id_arg_ref, channel_value_satoshis_arg);
+ 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;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_DelayedPaymentOutputDescriptor_clone(uint32_t orig) {
+ LDKDelayedPaymentOutputDescriptor orig_conv;
+ orig_conv.inner = (void*)(orig & (~1));
+ orig_conv.is_owned = false;
+ LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(&orig_conv);
+ 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;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
+void __attribute__((visibility("default"))) TS_StaticPaymentOutputDescriptor_free(uint32_t this_ptr) {
+ LDKStaticPaymentOutputDescriptor this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+ StaticPaymentOutputDescriptor_free(this_ptr_conv);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_StaticPaymentOutputDescriptor_get_outpoint(uint32_t this_ptr) {
+ LDKStaticPaymentOutputDescriptor this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKOutPoint ret_var = StaticPaymentOutputDescriptor_get_outpoint(&this_ptr_conv);
+ 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;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
+void __attribute__((visibility("default"))) TS_StaticPaymentOutputDescriptor_set_outpoint(uint32_t this_ptr, uint32_t val) {
+ LDKStaticPaymentOutputDescriptor this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKOutPoint val_conv;
+ val_conv.inner = (void*)(val & (~1));
+ val_conv.is_owned = (val & 1) || (val == 0);
+ val_conv = OutPoint_clone(&val_conv);
+ StaticPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv);
+}
+
+void __attribute__((visibility("default"))) TS_StaticPaymentOutputDescriptor_set_output(uint32_t this_ptr, uint32_t val) {
+ LDKStaticPaymentOutputDescriptor this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKTxOut val_conv = *(LDKTxOut*)(((uint64_t)val) & ~1);
+ FREE((void*)val);
+ StaticPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv);
+}
+
+int8_tArray __attribute__((visibility("default"))) TS_StaticPaymentOutputDescriptor_get_channel_keys_id(uint32_t this_ptr) {
+ LDKStaticPaymentOutputDescriptor this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(ret_arr + 4), *OutPoint_get_txid(&this_ptr_conv), 32);
+ memcpy((uint8_t*)(ret_arr + 4), *StaticPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv), 32);
return ret_arr;
}
-void __attribute__((visibility("default"))) TS_OutPoint_set_txid(uint32_t this_ptr, int8_tArray val) {
- LDKOutPoint this_ptr_conv;
+void __attribute__((visibility("default"))) TS_StaticPaymentOutputDescriptor_set_channel_keys_id(uint32_t this_ptr, int8_tArray val) {
+ LDKStaticPaymentOutputDescriptor this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKThirtyTwoBytes val_ref;
CHECK(*((uint32_t*)val) == 32);
memcpy(val_ref.data, (uint8_t*)(val + 4), 32);
- OutPoint_set_txid(&this_ptr_conv, val_ref);
+ StaticPaymentOutputDescriptor_set_channel_keys_id(&this_ptr_conv, val_ref);
}
-int16_t __attribute__((visibility("default"))) TS_OutPoint_get_index(uint32_t this_ptr) {
- LDKOutPoint this_ptr_conv;
+int64_t __attribute__((visibility("default"))) TS_StaticPaymentOutputDescriptor_get_channel_value_satoshis(uint32_t this_ptr) {
+ LDKStaticPaymentOutputDescriptor this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int16_t ret_val = OutPoint_get_index(&this_ptr_conv);
+ int64_t ret_val = StaticPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv);
return ret_val;
}
-void __attribute__((visibility("default"))) TS_OutPoint_set_index(uint32_t this_ptr, int16_t val) {
- LDKOutPoint this_ptr_conv;
+void __attribute__((visibility("default"))) TS_StaticPaymentOutputDescriptor_set_channel_value_satoshis(uint32_t this_ptr, int64_t val) {
+ LDKStaticPaymentOutputDescriptor this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- OutPoint_set_index(&this_ptr_conv, val);
+ StaticPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val);
}
-uint32_t __attribute__((visibility("default"))) TS_OutPoint_new(int8_tArray txid_arg, int16_t index_arg) {
- LDKThirtyTwoBytes txid_arg_ref;
- CHECK(*((uint32_t*)txid_arg) == 32);
- memcpy(txid_arg_ref.data, (uint8_t*)(txid_arg + 4), 32);
- LDKOutPoint ret_var = OutPoint_new(txid_arg_ref, index_arg);
+uint32_t __attribute__((visibility("default"))) TS_StaticPaymentOutputDescriptor_new(uint32_t outpoint_arg, uint32_t output_arg, int8_tArray channel_keys_id_arg, int64_t channel_value_satoshis_arg) {
+ LDKOutPoint outpoint_arg_conv;
+ outpoint_arg_conv.inner = (void*)(outpoint_arg & (~1));
+ outpoint_arg_conv.is_owned = (outpoint_arg & 1) || (outpoint_arg == 0);
+ outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv);
+ LDKTxOut output_arg_conv = *(LDKTxOut*)(((uint64_t)output_arg) & ~1);
+ FREE((void*)output_arg);
+ LDKThirtyTwoBytes channel_keys_id_arg_ref;
+ CHECK(*((uint32_t*)channel_keys_id_arg) == 32);
+ memcpy(channel_keys_id_arg_ref.data, (uint8_t*)(channel_keys_id_arg + 4), 32);
+ LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_new(outpoint_arg_conv, output_arg_conv, channel_keys_id_arg_ref, channel_value_satoshis_arg);
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_ref;
}
-uint32_t __attribute__((visibility("default"))) TS_OutPoint_clone(uint32_t orig) {
- LDKOutPoint orig_conv;
+uint32_t __attribute__((visibility("default"))) TS_StaticPaymentOutputDescriptor_clone(uint32_t orig) {
+ LDKStaticPaymentOutputDescriptor orig_conv;
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
- LDKOutPoint ret_var = OutPoint_clone(&orig_conv);
+ LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(&orig_conv);
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_ref;
}
-int8_tArray __attribute__((visibility("default"))) TS_OutPoint_to_channel_id(uint32_t this_arg) {
- LDKOutPoint this_arg_conv;
- this_arg_conv.inner = (void*)(this_arg & (~1));
- this_arg_conv.is_owned = false;
- int8_tArray arg_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), OutPoint_to_channel_id(&this_arg_conv).data, 32);
- return arg_arr;
-}
-
-int8_tArray __attribute__((visibility("default"))) TS_OutPoint_write(uint32_t obj) {
- LDKOutPoint obj_conv;
- obj_conv.inner = (void*)(obj & (~1));
- obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = OutPoint_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
-}
-
-uint32_t __attribute__((visibility("default"))) TS_OutPoint_read(int8_tArray ser) {
- LDKu8slice ser_ref;
- ser_ref.datalen = *((uint32_t*)ser);
- ser_ref.data = (int8_t*)(ser + 4);
- LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
- *ret_conv = OutPoint_read(ser_ref);
- return (long)ret_conv;
-}
-
void __attribute__((visibility("default"))) TS_SpendableOutputDescriptor_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
LDKSpendableOutputDescriptor this_ptr_conv = *(LDKSpendableOutputDescriptor*)(((uint64_t)this_ptr) & ~1);
int8_tArray __attribute__((visibility("default"))) TS_SpendableOutputDescriptor_write(uint32_t obj) {
LDKSpendableOutputDescriptor* obj_conv = (LDKSpendableOutputDescriptor*)obj;
- LDKCVec_u8Z arg_var = SpendableOutputDescriptor_write(obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = SpendableOutputDescriptor_write(obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_SpendableOutputDescriptor_read(int8_tArray ser) {
return (long)ret_conv;
}
-uint32_t __attribute__((visibility("default"))) TS_ChannelKeys_clone(uint32_t orig) {
- LDKChannelKeys* orig_conv = (LDKChannelKeys*)orig;
- LDKChannelKeys* ret = MALLOC(sizeof(LDKChannelKeys), "LDKChannelKeys");
- *ret = ChannelKeys_clone(orig_conv);
+uint32_t __attribute__((visibility("default"))) TS_Sign_clone(uint32_t orig) {
+ LDKSign* orig_conv = (LDKSign*)orig;
+ LDKSign* ret = MALLOC(sizeof(LDKSign), "LDKSign");
+ *ret = Sign_clone(orig_conv);
return (long)ret;
}
-void __attribute__((visibility("default"))) TS_ChannelKeys_free(uint32_t this_ptr) {
+void __attribute__((visibility("default"))) TS_Sign_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKChannelKeys this_ptr_conv = *(LDKChannelKeys*)(((uint64_t)this_ptr) & ~1);
+ LDKSign this_ptr_conv = *(LDKSign*)(((uint64_t)this_ptr) & ~1);
FREE((void*)this_ptr);
- ChannelKeys_free(this_ptr_conv);
+ Sign_free(this_ptr_conv);
}
void __attribute__((visibility("default"))) TS_KeysInterface_free(uint32_t this_ptr) {
KeysInterface_free(this_ptr_conv);
}
-void __attribute__((visibility("default"))) TS_InMemoryChannelKeys_free(uint32_t this_ptr) {
- LDKInMemoryChannelKeys this_ptr_conv;
+void __attribute__((visibility("default"))) TS_InMemorySigner_free(uint32_t this_ptr) {
+ LDKInMemorySigner this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
- InMemoryChannelKeys_free(this_ptr_conv);
+ InMemorySigner_free(this_ptr_conv);
}
-int8_tArray __attribute__((visibility("default"))) TS_InMemoryChannelKeys_get_funding_key(uint32_t this_ptr) {
- LDKInMemoryChannelKeys this_ptr_conv;
+int8_tArray __attribute__((visibility("default"))) TS_InMemorySigner_get_funding_key(uint32_t this_ptr) {
+ LDKInMemorySigner this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(ret_arr + 4), *InMemoryChannelKeys_get_funding_key(&this_ptr_conv), 32);
+ memcpy((uint8_t*)(ret_arr + 4), *InMemorySigner_get_funding_key(&this_ptr_conv), 32);
return ret_arr;
}
-void __attribute__((visibility("default"))) TS_InMemoryChannelKeys_set_funding_key(uint32_t this_ptr, int8_tArray val) {
- LDKInMemoryChannelKeys this_ptr_conv;
+void __attribute__((visibility("default"))) TS_InMemorySigner_set_funding_key(uint32_t this_ptr, int8_tArray val) {
+ LDKInMemorySigner this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKSecretKey val_ref;
CHECK(*((uint32_t*)val) == 32);
memcpy(val_ref.bytes, (uint8_t*)(val + 4), 32);
- InMemoryChannelKeys_set_funding_key(&this_ptr_conv, val_ref);
+ InMemorySigner_set_funding_key(&this_ptr_conv, val_ref);
}
-int8_tArray __attribute__((visibility("default"))) TS_InMemoryChannelKeys_get_revocation_base_key(uint32_t this_ptr) {
- LDKInMemoryChannelKeys this_ptr_conv;
+int8_tArray __attribute__((visibility("default"))) TS_InMemorySigner_get_revocation_base_key(uint32_t this_ptr) {
+ LDKInMemorySigner this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(ret_arr + 4), *InMemoryChannelKeys_get_revocation_base_key(&this_ptr_conv), 32);
+ memcpy((uint8_t*)(ret_arr + 4), *InMemorySigner_get_revocation_base_key(&this_ptr_conv), 32);
return ret_arr;
}
-void __attribute__((visibility("default"))) TS_InMemoryChannelKeys_set_revocation_base_key(uint32_t this_ptr, int8_tArray val) {
- LDKInMemoryChannelKeys this_ptr_conv;
+void __attribute__((visibility("default"))) TS_InMemorySigner_set_revocation_base_key(uint32_t this_ptr, int8_tArray val) {
+ LDKInMemorySigner this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKSecretKey val_ref;
CHECK(*((uint32_t*)val) == 32);
memcpy(val_ref.bytes, (uint8_t*)(val + 4), 32);
- InMemoryChannelKeys_set_revocation_base_key(&this_ptr_conv, val_ref);
+ InMemorySigner_set_revocation_base_key(&this_ptr_conv, val_ref);
}
-int8_tArray __attribute__((visibility("default"))) TS_InMemoryChannelKeys_get_payment_key(uint32_t this_ptr) {
- LDKInMemoryChannelKeys this_ptr_conv;
+int8_tArray __attribute__((visibility("default"))) TS_InMemorySigner_get_payment_key(uint32_t this_ptr) {
+ LDKInMemorySigner this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(ret_arr + 4), *InMemoryChannelKeys_get_payment_key(&this_ptr_conv), 32);
+ memcpy((uint8_t*)(ret_arr + 4), *InMemorySigner_get_payment_key(&this_ptr_conv), 32);
return ret_arr;
}
-void __attribute__((visibility("default"))) TS_InMemoryChannelKeys_set_payment_key(uint32_t this_ptr, int8_tArray val) {
- LDKInMemoryChannelKeys this_ptr_conv;
+void __attribute__((visibility("default"))) TS_InMemorySigner_set_payment_key(uint32_t this_ptr, int8_tArray val) {
+ LDKInMemorySigner this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKSecretKey val_ref;
CHECK(*((uint32_t*)val) == 32);
memcpy(val_ref.bytes, (uint8_t*)(val + 4), 32);
- InMemoryChannelKeys_set_payment_key(&this_ptr_conv, val_ref);
+ InMemorySigner_set_payment_key(&this_ptr_conv, val_ref);
}
-int8_tArray __attribute__((visibility("default"))) TS_InMemoryChannelKeys_get_delayed_payment_base_key(uint32_t this_ptr) {
- LDKInMemoryChannelKeys this_ptr_conv;
+int8_tArray __attribute__((visibility("default"))) TS_InMemorySigner_get_delayed_payment_base_key(uint32_t this_ptr) {
+ LDKInMemorySigner this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(ret_arr + 4), *InMemoryChannelKeys_get_delayed_payment_base_key(&this_ptr_conv), 32);
+ memcpy((uint8_t*)(ret_arr + 4), *InMemorySigner_get_delayed_payment_base_key(&this_ptr_conv), 32);
return ret_arr;
}
-void __attribute__((visibility("default"))) TS_InMemoryChannelKeys_set_delayed_payment_base_key(uint32_t this_ptr, int8_tArray val) {
- LDKInMemoryChannelKeys this_ptr_conv;
+void __attribute__((visibility("default"))) TS_InMemorySigner_set_delayed_payment_base_key(uint32_t this_ptr, int8_tArray val) {
+ LDKInMemorySigner this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKSecretKey val_ref;
CHECK(*((uint32_t*)val) == 32);
memcpy(val_ref.bytes, (uint8_t*)(val + 4), 32);
- InMemoryChannelKeys_set_delayed_payment_base_key(&this_ptr_conv, val_ref);
+ InMemorySigner_set_delayed_payment_base_key(&this_ptr_conv, val_ref);
}
-int8_tArray __attribute__((visibility("default"))) TS_InMemoryChannelKeys_get_htlc_base_key(uint32_t this_ptr) {
- LDKInMemoryChannelKeys this_ptr_conv;
+int8_tArray __attribute__((visibility("default"))) TS_InMemorySigner_get_htlc_base_key(uint32_t this_ptr) {
+ LDKInMemorySigner this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(ret_arr + 4), *InMemoryChannelKeys_get_htlc_base_key(&this_ptr_conv), 32);
+ memcpy((uint8_t*)(ret_arr + 4), *InMemorySigner_get_htlc_base_key(&this_ptr_conv), 32);
return ret_arr;
}
-void __attribute__((visibility("default"))) TS_InMemoryChannelKeys_set_htlc_base_key(uint32_t this_ptr, int8_tArray val) {
- LDKInMemoryChannelKeys this_ptr_conv;
+void __attribute__((visibility("default"))) TS_InMemorySigner_set_htlc_base_key(uint32_t this_ptr, int8_tArray val) {
+ LDKInMemorySigner this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKSecretKey val_ref;
CHECK(*((uint32_t*)val) == 32);
memcpy(val_ref.bytes, (uint8_t*)(val + 4), 32);
- InMemoryChannelKeys_set_htlc_base_key(&this_ptr_conv, val_ref);
+ InMemorySigner_set_htlc_base_key(&this_ptr_conv, val_ref);
}
-int8_tArray __attribute__((visibility("default"))) TS_InMemoryChannelKeys_get_commitment_seed(uint32_t this_ptr) {
- LDKInMemoryChannelKeys this_ptr_conv;
+int8_tArray __attribute__((visibility("default"))) TS_InMemorySigner_get_commitment_seed(uint32_t this_ptr) {
+ LDKInMemorySigner this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(ret_arr + 4), *InMemoryChannelKeys_get_commitment_seed(&this_ptr_conv), 32);
+ memcpy((uint8_t*)(ret_arr + 4), *InMemorySigner_get_commitment_seed(&this_ptr_conv), 32);
return ret_arr;
}
-void __attribute__((visibility("default"))) TS_InMemoryChannelKeys_set_commitment_seed(uint32_t this_ptr, int8_tArray val) {
- LDKInMemoryChannelKeys this_ptr_conv;
+void __attribute__((visibility("default"))) TS_InMemorySigner_set_commitment_seed(uint32_t this_ptr, int8_tArray val) {
+ LDKInMemorySigner this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
LDKThirtyTwoBytes val_ref;
CHECK(*((uint32_t*)val) == 32);
memcpy(val_ref.data, (uint8_t*)(val + 4), 32);
- InMemoryChannelKeys_set_commitment_seed(&this_ptr_conv, val_ref);
+ InMemorySigner_set_commitment_seed(&this_ptr_conv, val_ref);
}
-uint32_t __attribute__((visibility("default"))) TS_InMemoryChannelKeys_clone(uint32_t orig) {
- LDKInMemoryChannelKeys orig_conv;
+uint32_t __attribute__((visibility("default"))) TS_InMemorySigner_clone(uint32_t orig) {
+ LDKInMemorySigner orig_conv;
orig_conv.inner = (void*)(orig & (~1));
orig_conv.is_owned = false;
- LDKInMemoryChannelKeys ret_var = InMemoryChannelKeys_clone(&orig_conv);
+ LDKInMemorySigner ret_var = InMemorySigner_clone(&orig_conv);
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_ref;
}
-uint32_t __attribute__((visibility("default"))) TS_InMemoryChannelKeys_new(int8_tArray funding_key, int8_tArray revocation_base_key, int8_tArray payment_key, int8_tArray delayed_payment_base_key, int8_tArray htlc_base_key, int8_tArray commitment_seed, int64_t channel_value_satoshis, uint32_t key_derivation_params) {
+uint32_t __attribute__((visibility("default"))) TS_InMemorySigner_new(int8_tArray funding_key, int8_tArray revocation_base_key, int8_tArray payment_key, int8_tArray delayed_payment_base_key, int8_tArray htlc_base_key, int8_tArray commitment_seed, int64_t channel_value_satoshis, int8_tArray channel_keys_id) {
LDKSecretKey funding_key_ref;
CHECK(*((uint32_t*)funding_key) == 32);
memcpy(funding_key_ref.bytes, (uint8_t*)(funding_key + 4), 32);
LDKThirtyTwoBytes commitment_seed_ref;
CHECK(*((uint32_t*)commitment_seed) == 32);
memcpy(commitment_seed_ref.data, (uint8_t*)(commitment_seed + 4), 32);
- LDKC2Tuple_u64u64Z key_derivation_params_conv = *(LDKC2Tuple_u64u64Z*)(((uint64_t)key_derivation_params) & ~1);
- FREE((void*)key_derivation_params);
- LDKInMemoryChannelKeys ret_var = InMemoryChannelKeys_new(funding_key_ref, revocation_base_key_ref, payment_key_ref, delayed_payment_base_key_ref, htlc_base_key_ref, commitment_seed_ref, channel_value_satoshis, key_derivation_params_conv);
+ LDKThirtyTwoBytes channel_keys_id_ref;
+ CHECK(*((uint32_t*)channel_keys_id) == 32);
+ memcpy(channel_keys_id_ref.data, (uint8_t*)(channel_keys_id + 4), 32);
+ LDKInMemorySigner ret_var = InMemorySigner_new(funding_key_ref, revocation_base_key_ref, payment_key_ref, delayed_payment_base_key_ref, htlc_base_key_ref, commitment_seed_ref, channel_value_satoshis, channel_keys_id_ref);
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_ref;
}
-uint32_t __attribute__((visibility("default"))) TS_InMemoryChannelKeys_counterparty_pubkeys(uint32_t this_arg) {
- LDKInMemoryChannelKeys this_arg_conv;
+uint32_t __attribute__((visibility("default"))) TS_InMemorySigner_counterparty_pubkeys(uint32_t this_arg) {
+ LDKInMemorySigner this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKChannelPublicKeys ret_var = InMemoryChannelKeys_counterparty_pubkeys(&this_arg_conv);
+ LDKChannelPublicKeys ret_var = InMemorySigner_counterparty_pubkeys(&this_arg_conv);
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_ref;
}
-int16_t __attribute__((visibility("default"))) TS_InMemoryChannelKeys_counterparty_selected_contest_delay(uint32_t this_arg) {
- LDKInMemoryChannelKeys this_arg_conv;
+int16_t __attribute__((visibility("default"))) TS_InMemorySigner_counterparty_selected_contest_delay(uint32_t this_arg) {
+ LDKInMemorySigner this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- int16_t ret_val = InMemoryChannelKeys_counterparty_selected_contest_delay(&this_arg_conv);
+ int16_t ret_val = InMemorySigner_counterparty_selected_contest_delay(&this_arg_conv);
return ret_val;
}
-int16_t __attribute__((visibility("default"))) TS_InMemoryChannelKeys_holder_selected_contest_delay(uint32_t this_arg) {
- LDKInMemoryChannelKeys this_arg_conv;
+int16_t __attribute__((visibility("default"))) TS_InMemorySigner_holder_selected_contest_delay(uint32_t this_arg) {
+ LDKInMemorySigner this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- int16_t ret_val = InMemoryChannelKeys_holder_selected_contest_delay(&this_arg_conv);
+ int16_t ret_val = InMemorySigner_holder_selected_contest_delay(&this_arg_conv);
return ret_val;
}
-jboolean __attribute__((visibility("default"))) TS_InMemoryChannelKeys_is_outbound(uint32_t this_arg) {
- LDKInMemoryChannelKeys this_arg_conv;
+jboolean __attribute__((visibility("default"))) TS_InMemorySigner_is_outbound(uint32_t this_arg) {
+ LDKInMemorySigner this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- jboolean ret_val = InMemoryChannelKeys_is_outbound(&this_arg_conv);
+ jboolean ret_val = InMemorySigner_is_outbound(&this_arg_conv);
return ret_val;
}
-uint32_t __attribute__((visibility("default"))) TS_InMemoryChannelKeys_funding_outpoint(uint32_t this_arg) {
- LDKInMemoryChannelKeys this_arg_conv;
+uint32_t __attribute__((visibility("default"))) TS_InMemorySigner_funding_outpoint(uint32_t this_arg) {
+ LDKInMemorySigner this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKOutPoint ret_var = InMemoryChannelKeys_funding_outpoint(&this_arg_conv);
+ LDKOutPoint ret_var = InMemorySigner_funding_outpoint(&this_arg_conv);
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_ref;
}
-uint32_t __attribute__((visibility("default"))) TS_InMemoryChannelKeys_get_channel_parameters(uint32_t this_arg) {
- LDKInMemoryChannelKeys this_arg_conv;
+uint32_t __attribute__((visibility("default"))) TS_InMemorySigner_get_channel_parameters(uint32_t this_arg) {
+ LDKInMemorySigner this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKChannelTransactionParameters ret_var = InMemoryChannelKeys_get_channel_parameters(&this_arg_conv);
+ LDKChannelTransactionParameters ret_var = InMemorySigner_get_channel_parameters(&this_arg_conv);
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_ref;
}
-uint32_t __attribute__((visibility("default"))) TS_InMemoryChannelKeys_as_ChannelKeys(uint32_t this_arg) {
- LDKInMemoryChannelKeys this_arg_conv;
+uint32_t __attribute__((visibility("default"))) TS_InMemorySigner_sign_counterparty_payment_input(uint32_t this_arg, int8_tArray spend_tx, int64_t input_idx, uint32_t descriptor) {
+ LDKInMemorySigner this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ LDKTransaction spend_tx_ref;
+ spend_tx_ref.datalen = *((uint32_t*)spend_tx);
+ spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes");
+ memcpy(spend_tx_ref.data, (uint8_t*)(spend_tx + 4), spend_tx_ref.datalen);
+ spend_tx_ref.data_is_owned = true;
+ LDKStaticPaymentOutputDescriptor descriptor_conv;
+ descriptor_conv.inner = (void*)(descriptor & (~1));
+ descriptor_conv.is_owned = false;
+ LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
+ *ret_conv = InMemorySigner_sign_counterparty_payment_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv);
+ return (long)ret_conv;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_InMemorySigner_sign_dynamic_p2wsh_input(uint32_t this_arg, int8_tArray spend_tx, int64_t input_idx, uint32_t descriptor) {
+ LDKInMemorySigner this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ LDKTransaction spend_tx_ref;
+ spend_tx_ref.datalen = *((uint32_t*)spend_tx);
+ spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes");
+ memcpy(spend_tx_ref.data, (uint8_t*)(spend_tx + 4), spend_tx_ref.datalen);
+ spend_tx_ref.data_is_owned = true;
+ LDKDelayedPaymentOutputDescriptor descriptor_conv;
+ descriptor_conv.inner = (void*)(descriptor & (~1));
+ descriptor_conv.is_owned = false;
+ LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
+ *ret_conv = InMemorySigner_sign_dynamic_p2wsh_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv);
+ return (long)ret_conv;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_InMemorySigner_as_Sign(uint32_t this_arg) {
+ LDKInMemorySigner this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKChannelKeys* ret = MALLOC(sizeof(LDKChannelKeys), "LDKChannelKeys");
- *ret = InMemoryChannelKeys_as_ChannelKeys(&this_arg_conv);
+ LDKSign* ret = MALLOC(sizeof(LDKSign), "LDKSign");
+ *ret = InMemorySigner_as_Sign(&this_arg_conv);
return (long)ret;
}
-int8_tArray __attribute__((visibility("default"))) TS_InMemoryChannelKeys_write(uint32_t obj) {
- LDKInMemoryChannelKeys obj_conv;
+int8_tArray __attribute__((visibility("default"))) TS_InMemorySigner_write(uint32_t obj) {
+ LDKInMemorySigner obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = InMemoryChannelKeys_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = InMemorySigner_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
-uint32_t __attribute__((visibility("default"))) TS_InMemoryChannelKeys_read(int8_tArray ser) {
+uint32_t __attribute__((visibility("default"))) TS_InMemorySigner_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = *((uint32_t*)ser);
ser_ref.data = (int8_t*)(ser + 4);
- LDKCResult_InMemoryChannelKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemoryChannelKeysDecodeErrorZ), "LDKCResult_InMemoryChannelKeysDecodeErrorZ");
- *ret_conv = InMemoryChannelKeys_read(ser_ref);
+ LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
+ *ret_conv = InMemorySigner_read(ser_ref);
return (long)ret_conv;
}
KeysManager_free(this_ptr_conv);
}
-uint32_t __attribute__((visibility("default"))) TS_KeysManager_new(int8_tArray seed, uint32_t network, int64_t starting_time_secs, int32_t starting_time_nanos) {
+uint32_t __attribute__((visibility("default"))) TS_KeysManager_new(int8_tArray seed, int64_t starting_time_secs, int32_t starting_time_nanos) {
unsigned char seed_arr[32];
CHECK(*((uint32_t*)seed) == 32);
memcpy(seed_arr, (uint8_t*)(seed + 4), 32);
unsigned char (*seed_ref)[32] = &seed_arr;
- LDKNetwork network_conv = LDKNetwork_from_js(network);
- LDKKeysManager ret_var = KeysManager_new(seed_ref, network_conv, starting_time_secs, starting_time_nanos);
+ LDKKeysManager ret_var = KeysManager_new(seed_ref, starting_time_secs, starting_time_nanos);
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_ref;
}
-uint32_t __attribute__((visibility("default"))) TS_KeysManager_derive_channel_keys(uint32_t this_arg, int64_t channel_value_satoshis, int64_t params_1, int64_t params_2) {
+uint32_t __attribute__((visibility("default"))) TS_KeysManager_derive_channel_keys(uint32_t this_arg, int64_t channel_value_satoshis, int8_tArray params) {
LDKKeysManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKInMemoryChannelKeys ret_var = KeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_1, params_2);
+ unsigned char params_arr[32];
+ CHECK(*((uint32_t*)params) == 32);
+ memcpy(params_arr, (uint8_t*)(params + 4), 32);
+ unsigned char (*params_ref)[32] = ¶ms_arr;
+ LDKInMemorySigner ret_var = KeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_ref);
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_ref;
}
+uint32_t __attribute__((visibility("default"))) TS_KeysManager_spend_spendable_outputs(uint32_t this_arg, uint32_tArray descriptors, uint32_tArray outputs, int8_tArray change_destination_script, int32_t feerate_sat_per_1000_weight) {
+ LDKKeysManager this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ LDKCVec_SpendableOutputDescriptorZ descriptors_constr;
+ descriptors_constr.datalen = *((uint32_t*)descriptors);
+ if (descriptors_constr.datalen > 0)
+ descriptors_constr.data = MALLOC(descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements");
+ else
+ descriptors_constr.data = NULL;
+ uint32_t* descriptors_vals = (uint32_t*)(descriptors + 4);
+ for (size_t b = 0; b < descriptors_constr.datalen; b++) {
+ uint32_t descriptors_conv_27 = descriptors_vals[b];
+ LDKSpendableOutputDescriptor descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(((uint64_t)descriptors_conv_27) & ~1);
+ FREE((void*)descriptors_conv_27);
+ descriptors_constr.data[b] = descriptors_conv_27_conv;
+ }
+ LDKCVec_TxOutZ outputs_constr;
+ outputs_constr.datalen = *((uint32_t*)outputs);
+ if (outputs_constr.datalen > 0)
+ outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements");
+ else
+ outputs_constr.data = NULL;
+ uint32_t* outputs_vals = (uint32_t*)(outputs + 4);
+ for (size_t h = 0; h < outputs_constr.datalen; h++) {
+ uint32_t outputs_conv_7 = outputs_vals[h];
+ LDKTxOut outputs_conv_7_conv = *(LDKTxOut*)(((uint64_t)outputs_conv_7) & ~1);
+ FREE((void*)outputs_conv_7);
+ outputs_constr.data[h] = outputs_conv_7_conv;
+ }
+ LDKCVec_u8Z change_destination_script_ref;
+ change_destination_script_ref.datalen = *((uint32_t*)change_destination_script);
+ change_destination_script_ref.data = MALLOC(change_destination_script_ref.datalen, "LDKCVec_u8Z Bytes");
+ memcpy(change_destination_script_ref.data, (uint8_t*)(change_destination_script + 4), change_destination_script_ref.datalen);
+ LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
+ *ret_conv = KeysManager_spend_spendable_outputs(&this_arg_conv, descriptors_constr, outputs_constr, change_destination_script_ref, feerate_sat_per_1000_weight);
+ return (long)ret_conv;
+}
+
uint32_t __attribute__((visibility("default"))) TS_KeysManager_as_KeysInterface(uint32_t this_arg) {
LDKKeysManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
LDKChannelDetails this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), ChannelDetails_get_remote_network_id(&this_ptr_conv).compressed_form, 33);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ChannelDetails_get_remote_network_id(&this_ptr_conv).compressed_form, 33);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_ChannelDetails_set_remote_network_id(uint32_t this_ptr, int8_tArray val) {
}
void __attribute__((visibility("default"))) TS_PaymentSendFailure_free(uint32_t this_ptr) {
- LDKPaymentSendFailure this_ptr_conv;
- this_ptr_conv.inner = (void*)(this_ptr & (~1));
- this_ptr_conv.is_owned = (this_ptr & 1) || (this_ptr == 0);
+ if ((this_ptr & 1) != 0) return;
+ LDKPaymentSendFailure this_ptr_conv = *(LDKPaymentSendFailure*)(((uint64_t)this_ptr) & ~1);
+ FREE((void*)this_ptr);
PaymentSendFailure_free(this_ptr_conv);
}
uint32_t __attribute__((visibility("default"))) TS_PaymentSendFailure_clone(uint32_t orig) {
- LDKPaymentSendFailure orig_conv;
- orig_conv.inner = (void*)(orig & (~1));
- orig_conv.is_owned = false;
- LDKPaymentSendFailure ret_var = PaymentSendFailure_clone(&orig_conv);
- 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;
- if (ret_var.is_owned) {
- ret_ref |= 1;
- }
+ LDKPaymentSendFailure* orig_conv = (LDKPaymentSendFailure*)orig;
+ LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
+ *ret_copy = PaymentSendFailure_clone(orig_conv);
+ long ret_ref = (long)ret_copy;
return ret_ref;
}
uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t q = 0; q < ret_var.datalen; q++) {
- LDKChannelDetails arr_conv_16_var = ret_var.data[q];
- CHECK((((long)arr_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
- CHECK((((long)&arr_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- long arr_conv_16_ref = (long)arr_conv_16_var.inner;
- if (arr_conv_16_var.is_owned) {
- arr_conv_16_ref |= 1;
+ LDKChannelDetails ret_conv_16_var = ret_var.data[q];
+ CHECK((((long)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_conv_16_ref = (long)ret_conv_16_var.inner;
+ if (ret_conv_16_var.is_owned) {
+ ret_conv_16_ref |= 1;
}
- ret_arr_ptr[q] = arr_conv_16_ref;
+ ret_arr_ptr[q] = ret_conv_16_ref;
}
FREE(ret_var.data);
return ret_arr;
uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t q = 0; q < ret_var.datalen; q++) {
- LDKChannelDetails arr_conv_16_var = ret_var.data[q];
- CHECK((((long)arr_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
- CHECK((((long)&arr_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
- long arr_conv_16_ref = (long)arr_conv_16_var.inner;
- if (arr_conv_16_var.is_owned) {
- arr_conv_16_ref |= 1;
+ LDKChannelDetails ret_conv_16_var = ret_var.data[q];
+ CHECK((((long)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_conv_16_ref = (long)ret_conv_16_var.inner;
+ if (ret_conv_16_var.is_owned) {
+ ret_conv_16_ref |= 1;
}
- ret_arr_ptr[q] = arr_conv_16_ref;
+ ret_arr_ptr[q] = ret_conv_16_ref;
}
FREE(ret_var.data);
return ret_arr;
addresses_constr.data = NULL;
uint32_t* addresses_vals = (uint32_t*)(addresses + 4);
for (size_t m = 0; m < addresses_constr.datalen; m++) {
- uint32_t arr_conv_12 = addresses_vals[m];
- LDKNetAddress arr_conv_12_conv = *(LDKNetAddress*)(((uint64_t)arr_conv_12) & ~1);
- FREE((void*)arr_conv_12);
- addresses_constr.data[m] = arr_conv_12_conv;
+ uint32_t addresses_conv_12 = addresses_vals[m];
+ LDKNetAddress addresses_conv_12_conv = *(LDKNetAddress*)(((uint64_t)addresses_conv_12) & ~1);
+ FREE((void*)addresses_conv_12);
+ addresses_constr.data[m] = addresses_conv_12_conv;
}
ChannelManager_broadcast_node_announcement(&this_arg_conv, rgb_ref, alias_ref, addresses_constr);
}
LDKChannelManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- int8_tArray arg_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), ChannelManager_get_our_node_id(&this_arg_conv).compressed_form, 33);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ChannelManager_get_our_node_id(&this_arg_conv).compressed_form, 33);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_ChannelManager_channel_monitor_updated(uint32_t this_arg, uint32_t funding_txo, int64_t highest_applied_update_id) {
return (long)ret;
}
+uint32_t __attribute__((visibility("default"))) TS_ChannelManager_as_Listen(uint32_t this_arg) {
+ LDKChannelManager this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ LDKListen* ret = MALLOC(sizeof(LDKListen), "LDKListen");
+ *ret = ChannelManager_as_Listen(&this_arg_conv);
+ return (long)ret;
+}
+
void __attribute__((visibility("default"))) TS_ChannelManager_block_connected(uint32_t this_arg, int8_tArray header, uint32_tArray txdata, int32_t height) {
LDKChannelManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
txdata_constr.data = NULL;
uint32_t* txdata_vals = (uint32_t*)(txdata + 4);
for (size_t e = 0; e < txdata_constr.datalen; e++) {
- uint32_t arr_conv_30 = txdata_vals[e];
- LDKC2Tuple_usizeTransactionZ arr_conv_30_conv = *(LDKC2Tuple_usizeTransactionZ*)(((uint64_t)arr_conv_30) & ~1);
- FREE((void*)arr_conv_30);
- txdata_constr.data[e] = arr_conv_30_conv;
+ uint32_t txdata_conv_30 = txdata_vals[e];
+ LDKC2Tuple_usizeTransactionZ txdata_conv_30_conv = *(LDKC2Tuple_usizeTransactionZ*)(((uint64_t)txdata_conv_30) & ~1);
+ FREE((void*)txdata_conv_30);
+ txdata_constr.data[e] = txdata_conv_30_conv;
}
ChannelManager_block_connected(&this_arg_conv, header_ref, txdata_constr, height);
}
ChannelManager_block_disconnected(&this_arg_conv, header_ref);
}
+void __attribute__((visibility("default"))) TS_ChannelManager_await_persistable_update(uint32_t this_arg) {
+ LDKChannelManager this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ ChannelManager_await_persistable_update(&this_arg_conv);
+}
+
uint32_t __attribute__((visibility("default"))) TS_ChannelManager_as_ChannelMessageHandler(uint32_t this_arg) {
LDKChannelManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
LDKChannelManager obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = ChannelManager_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = ChannelManager_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_ChannelManagerReadArgs_free(uint32_t this_ptr) {
channel_monitors_constr.data = NULL;
uint32_t* channel_monitors_vals = (uint32_t*)(channel_monitors + 4);
for (size_t q = 0; q < channel_monitors_constr.datalen; q++) {
- uint32_t arr_conv_16 = channel_monitors_vals[q];
- LDKChannelMonitor arr_conv_16_conv;
- arr_conv_16_conv.inner = (void*)(arr_conv_16 & (~1));
- arr_conv_16_conv.is_owned = (arr_conv_16 & 1) || (arr_conv_16 == 0);
- channel_monitors_constr.data[q] = arr_conv_16_conv;
+ uint32_t channel_monitors_conv_16 = channel_monitors_vals[q];
+ LDKChannelMonitor channel_monitors_conv_16_conv;
+ channel_monitors_conv_16_conv.inner = (void*)(channel_monitors_conv_16 & (~1));
+ channel_monitors_conv_16_conv.is_owned = (channel_monitors_conv_16 & 1) || (channel_monitors_conv_16 == 0);
+ channel_monitors_constr.data[q] = channel_monitors_conv_16_conv;
}
LDKChannelManagerReadArgs ret_var = ChannelManagerReadArgs_new(keys_manager_conv, fee_estimator_conv, chain_monitor_conv, tx_broadcaster_conv, logger_conv, default_config_conv, channel_monitors_constr);
CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
Init_free(this_ptr_conv);
}
+uint32_t __attribute__((visibility("default"))) TS_Init_get_features(uint32_t this_ptr) {
+ LDKInit this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKInitFeatures ret_var = Init_get_features(&this_ptr_conv);
+ 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;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
+void __attribute__((visibility("default"))) TS_Init_set_features(uint32_t this_ptr, uint32_t val) {
+ LDKInit this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ LDKInitFeatures val_conv;
+ val_conv.inner = (void*)(val & (~1));
+ val_conv.is_owned = (val & 1) || (val == 0);
+ val_conv = InitFeatures_clone(&val_conv);
+ Init_set_features(&this_ptr_conv, val_conv);
+}
+
+uint32_t __attribute__((visibility("default"))) TS_Init_new(uint32_t features_arg) {
+ LDKInitFeatures features_arg_conv;
+ features_arg_conv.inner = (void*)(features_arg & (~1));
+ features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0);
+ features_arg_conv = InitFeatures_clone(&features_arg_conv);
+ LDKInit ret_var = Init_new(features_arg_conv);
+ 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;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
uint32_t __attribute__((visibility("default"))) TS_Init_clone(uint32_t orig) {
LDKInit orig_conv;
orig_conv.inner = (void*)(orig & (~1));
LDKOpenChannel this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), OpenChannel_get_funding_pubkey(&this_ptr_conv).compressed_form, 33);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), OpenChannel_get_funding_pubkey(&this_ptr_conv).compressed_form, 33);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_OpenChannel_set_funding_pubkey(uint32_t this_ptr, int8_tArray val) {
LDKOpenChannel this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), OpenChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form, 33);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), OpenChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form, 33);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_OpenChannel_set_revocation_basepoint(uint32_t this_ptr, int8_tArray val) {
LDKOpenChannel this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), OpenChannel_get_payment_point(&this_ptr_conv).compressed_form, 33);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), OpenChannel_get_payment_point(&this_ptr_conv).compressed_form, 33);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_OpenChannel_set_payment_point(uint32_t this_ptr, int8_tArray val) {
LDKOpenChannel this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), OpenChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form, 33);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), OpenChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form, 33);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_OpenChannel_set_delayed_payment_basepoint(uint32_t this_ptr, int8_tArray val) {
LDKOpenChannel this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), OpenChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form, 33);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), OpenChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form, 33);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_OpenChannel_set_htlc_basepoint(uint32_t this_ptr, int8_tArray val) {
LDKOpenChannel this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), OpenChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form, 33);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), OpenChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form, 33);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_OpenChannel_set_first_per_commitment_point(uint32_t this_ptr, int8_tArray val) {
LDKAcceptChannel this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), AcceptChannel_get_funding_pubkey(&this_ptr_conv).compressed_form, 33);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), AcceptChannel_get_funding_pubkey(&this_ptr_conv).compressed_form, 33);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_AcceptChannel_set_funding_pubkey(uint32_t this_ptr, int8_tArray val) {
LDKAcceptChannel this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), AcceptChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form, 33);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), AcceptChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form, 33);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_AcceptChannel_set_revocation_basepoint(uint32_t this_ptr, int8_tArray val) {
LDKAcceptChannel this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), AcceptChannel_get_payment_point(&this_ptr_conv).compressed_form, 33);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), AcceptChannel_get_payment_point(&this_ptr_conv).compressed_form, 33);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_AcceptChannel_set_payment_point(uint32_t this_ptr, int8_tArray val) {
LDKAcceptChannel this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), AcceptChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form, 33);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), AcceptChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form, 33);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_AcceptChannel_set_delayed_payment_basepoint(uint32_t this_ptr, int8_tArray val) {
LDKAcceptChannel this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), AcceptChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form, 33);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), AcceptChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form, 33);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_AcceptChannel_set_htlc_basepoint(uint32_t this_ptr, int8_tArray val) {
LDKAcceptChannel this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), AcceptChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form, 33);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), AcceptChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form, 33);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_AcceptChannel_set_first_per_commitment_point(uint32_t this_ptr, int8_tArray val) {
LDKFundingCreated this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), FundingCreated_get_signature(&this_ptr_conv).compact_form, 64);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), FundingCreated_get_signature(&this_ptr_conv).compact_form, 64);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_FundingCreated_set_signature(uint32_t this_ptr, int8_tArray val) {
LDKFundingSigned this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), FundingSigned_get_signature(&this_ptr_conv).compact_form, 64);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), FundingSigned_get_signature(&this_ptr_conv).compact_form, 64);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_FundingSigned_set_signature(uint32_t this_ptr, int8_tArray val) {
LDKFundingLocked this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), FundingLocked_get_next_per_commitment_point(&this_ptr_conv).compressed_form, 33);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), FundingLocked_get_next_per_commitment_point(&this_ptr_conv).compressed_form, 33);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_FundingLocked_set_next_per_commitment_point(uint32_t this_ptr, int8_tArray val) {
LDKShutdown this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKu8slice arg_var = Shutdown_get_scriptpubkey(&this_ptr_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- return arg_arr;
+ LDKu8slice ret_var = Shutdown_get_scriptpubkey(&this_ptr_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_Shutdown_set_scriptpubkey(uint32_t this_ptr, int8_tArray val) {
LDKClosingSigned this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), ClosingSigned_get_signature(&this_ptr_conv).compact_form, 64);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ClosingSigned_get_signature(&this_ptr_conv).compact_form, 64);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_ClosingSigned_set_signature(uint32_t this_ptr, int8_tArray val) {
LDKCommitmentSigned this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), CommitmentSigned_get_signature(&this_ptr_conv).compact_form, 64);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), CommitmentSigned_get_signature(&this_ptr_conv).compact_form, 64);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_CommitmentSigned_set_signature(uint32_t this_ptr, int8_tArray val) {
val_constr.data = NULL;
int8_tArray* val_vals = (int8_tArray*)(val + 4);
for (size_t m = 0; m < val_constr.datalen; m++) {
- int8_tArray arr_conv_12 = val_vals[m];
- LDKSignature arr_conv_12_ref;
- CHECK(*((uint32_t*)arr_conv_12) == 64);
- memcpy(arr_conv_12_ref.compact_form, (uint8_t*)(arr_conv_12 + 4), 64);
- val_constr.data[m] = arr_conv_12_ref;
+ int8_tArray val_conv_12 = val_vals[m];
+ LDKSignature val_conv_12_ref;
+ CHECK(*((uint32_t*)val_conv_12) == 64);
+ memcpy(val_conv_12_ref.compact_form, (uint8_t*)(val_conv_12 + 4), 64);
+ val_constr.data[m] = val_conv_12_ref;
}
CommitmentSigned_set_htlc_signatures(&this_ptr_conv, val_constr);
}
htlc_signatures_arg_constr.data = NULL;
int8_tArray* htlc_signatures_arg_vals = (int8_tArray*)(htlc_signatures_arg + 4);
for (size_t m = 0; m < htlc_signatures_arg_constr.datalen; m++) {
- int8_tArray arr_conv_12 = htlc_signatures_arg_vals[m];
- LDKSignature arr_conv_12_ref;
- CHECK(*((uint32_t*)arr_conv_12) == 64);
- memcpy(arr_conv_12_ref.compact_form, (uint8_t*)(arr_conv_12 + 4), 64);
- htlc_signatures_arg_constr.data[m] = arr_conv_12_ref;
+ int8_tArray htlc_signatures_arg_conv_12 = htlc_signatures_arg_vals[m];
+ LDKSignature htlc_signatures_arg_conv_12_ref;
+ CHECK(*((uint32_t*)htlc_signatures_arg_conv_12) == 64);
+ memcpy(htlc_signatures_arg_conv_12_ref.compact_form, (uint8_t*)(htlc_signatures_arg_conv_12 + 4), 64);
+ htlc_signatures_arg_constr.data[m] = htlc_signatures_arg_conv_12_ref;
}
LDKCommitmentSigned ret_var = CommitmentSigned_new(channel_id_arg_ref, signature_arg_ref, htlc_signatures_arg_constr);
CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
LDKRevokeAndACK this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), RevokeAndACK_get_next_per_commitment_point(&this_ptr_conv).compressed_form, 33);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), RevokeAndACK_get_next_per_commitment_point(&this_ptr_conv).compressed_form, 33);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_RevokeAndACK_set_next_per_commitment_point(uint32_t this_ptr, int8_tArray val) {
LDKDataLossProtect this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), DataLossProtect_get_my_current_per_commitment_point(&this_ptr_conv).compressed_form, 33);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), DataLossProtect_get_my_current_per_commitment_point(&this_ptr_conv).compressed_form, 33);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_DataLossProtect_set_my_current_per_commitment_point(uint32_t this_ptr, int8_tArray val) {
LDKAnnouncementSignatures this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), AnnouncementSignatures_get_node_signature(&this_ptr_conv).compact_form, 64);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), AnnouncementSignatures_get_node_signature(&this_ptr_conv).compact_form, 64);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_AnnouncementSignatures_set_node_signature(uint32_t this_ptr, int8_tArray val) {
LDKAnnouncementSignatures this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), AnnouncementSignatures_get_bitcoin_signature(&this_ptr_conv).compact_form, 64);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), AnnouncementSignatures_get_bitcoin_signature(&this_ptr_conv).compact_form, 64);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_AnnouncementSignatures_set_bitcoin_signature(uint32_t this_ptr, int8_tArray val) {
int8_tArray __attribute__((visibility("default"))) TS_NetAddress_write(uint32_t obj) {
LDKNetAddress* obj_conv = (LDKNetAddress*)obj;
- LDKCVec_u8Z arg_var = NetAddress_write(obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = NetAddress_write(obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_Result_read(int8_tArray ser) {
LDKUnsignedNodeAnnouncement this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), UnsignedNodeAnnouncement_get_node_id(&this_ptr_conv).compressed_form, 33);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), UnsignedNodeAnnouncement_get_node_id(&this_ptr_conv).compressed_form, 33);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_UnsignedNodeAnnouncement_set_node_id(uint32_t this_ptr, int8_tArray val) {
val_constr.data = NULL;
uint32_t* val_vals = (uint32_t*)(val + 4);
for (size_t m = 0; m < val_constr.datalen; m++) {
- uint32_t arr_conv_12 = val_vals[m];
- LDKNetAddress arr_conv_12_conv = *(LDKNetAddress*)(((uint64_t)arr_conv_12) & ~1);
- FREE((void*)arr_conv_12);
- val_constr.data[m] = arr_conv_12_conv;
+ uint32_t val_conv_12 = val_vals[m];
+ LDKNetAddress val_conv_12_conv = *(LDKNetAddress*)(((uint64_t)val_conv_12) & ~1);
+ FREE((void*)val_conv_12);
+ val_constr.data[m] = val_conv_12_conv;
}
UnsignedNodeAnnouncement_set_addresses(&this_ptr_conv, val_constr);
}
LDKNodeAnnouncement this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), NodeAnnouncement_get_signature(&this_ptr_conv).compact_form, 64);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), NodeAnnouncement_get_signature(&this_ptr_conv).compact_form, 64);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_NodeAnnouncement_set_signature(uint32_t this_ptr, int8_tArray val) {
LDKUnsignedChannelAnnouncement this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), UnsignedChannelAnnouncement_get_node_id_1(&this_ptr_conv).compressed_form, 33);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), UnsignedChannelAnnouncement_get_node_id_1(&this_ptr_conv).compressed_form, 33);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_UnsignedChannelAnnouncement_set_node_id_1(uint32_t this_ptr, int8_tArray val) {
LDKUnsignedChannelAnnouncement this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), UnsignedChannelAnnouncement_get_node_id_2(&this_ptr_conv).compressed_form, 33);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), UnsignedChannelAnnouncement_get_node_id_2(&this_ptr_conv).compressed_form, 33);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_UnsignedChannelAnnouncement_set_node_id_2(uint32_t this_ptr, int8_tArray val) {
LDKUnsignedChannelAnnouncement this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), UnsignedChannelAnnouncement_get_bitcoin_key_1(&this_ptr_conv).compressed_form, 33);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), UnsignedChannelAnnouncement_get_bitcoin_key_1(&this_ptr_conv).compressed_form, 33);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_UnsignedChannelAnnouncement_set_bitcoin_key_1(uint32_t this_ptr, int8_tArray val) {
LDKUnsignedChannelAnnouncement this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), UnsignedChannelAnnouncement_get_bitcoin_key_2(&this_ptr_conv).compressed_form, 33);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), UnsignedChannelAnnouncement_get_bitcoin_key_2(&this_ptr_conv).compressed_form, 33);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_UnsignedChannelAnnouncement_set_bitcoin_key_2(uint32_t this_ptr, int8_tArray val) {
LDKChannelAnnouncement this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), ChannelAnnouncement_get_node_signature_1(&this_ptr_conv).compact_form, 64);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ChannelAnnouncement_get_node_signature_1(&this_ptr_conv).compact_form, 64);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_ChannelAnnouncement_set_node_signature_1(uint32_t this_ptr, int8_tArray val) {
LDKChannelAnnouncement this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), ChannelAnnouncement_get_node_signature_2(&this_ptr_conv).compact_form, 64);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ChannelAnnouncement_get_node_signature_2(&this_ptr_conv).compact_form, 64);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_ChannelAnnouncement_set_node_signature_2(uint32_t this_ptr, int8_tArray val) {
LDKChannelAnnouncement this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), ChannelAnnouncement_get_bitcoin_signature_1(&this_ptr_conv).compact_form, 64);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ChannelAnnouncement_get_bitcoin_signature_1(&this_ptr_conv).compact_form, 64);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_ChannelAnnouncement_set_bitcoin_signature_1(uint32_t this_ptr, int8_tArray val) {
LDKChannelAnnouncement this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), ChannelAnnouncement_get_bitcoin_signature_2(&this_ptr_conv).compact_form, 64);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ChannelAnnouncement_get_bitcoin_signature_2(&this_ptr_conv).compact_form, 64);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_ChannelAnnouncement_set_bitcoin_signature_2(uint32_t this_ptr, int8_tArray val) {
LDKChannelUpdate this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), ChannelUpdate_get_signature(&this_ptr_conv).compact_form, 64);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ChannelUpdate_get_signature(&this_ptr_conv).compact_form, 64);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_ChannelUpdate_set_signature(uint32_t this_ptr, int8_tArray val) {
val_constr.data = NULL;
int64_t* val_vals = (int64_t*)(val + 4);
for (size_t i = 0; i < val_constr.datalen; i++) {
- int64_t arr_conv_8 = val_vals[i];
- val_constr.data[i] = arr_conv_8;
+ int64_t val_conv_8 = val_vals[i];
+ val_constr.data[i] = val_conv_8;
}
ReplyChannelRange_set_short_channel_ids(&this_ptr_conv, val_constr);
}
short_channel_ids_arg_constr.data = NULL;
int64_t* short_channel_ids_arg_vals = (int64_t*)(short_channel_ids_arg + 4);
for (size_t i = 0; i < short_channel_ids_arg_constr.datalen; i++) {
- int64_t arr_conv_8 = short_channel_ids_arg_vals[i];
- short_channel_ids_arg_constr.data[i] = arr_conv_8;
+ int64_t short_channel_ids_arg_conv_8 = short_channel_ids_arg_vals[i];
+ short_channel_ids_arg_constr.data[i] = short_channel_ids_arg_conv_8;
}
LDKReplyChannelRange ret_var = ReplyChannelRange_new(chain_hash_arg_ref, first_blocknum_arg, number_of_blocks_arg, sync_complete_arg, short_channel_ids_arg_constr);
CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
val_constr.data = NULL;
int64_t* val_vals = (int64_t*)(val + 4);
for (size_t i = 0; i < val_constr.datalen; i++) {
- int64_t arr_conv_8 = val_vals[i];
- val_constr.data[i] = arr_conv_8;
+ int64_t val_conv_8 = val_vals[i];
+ val_constr.data[i] = val_conv_8;
}
QueryShortChannelIds_set_short_channel_ids(&this_ptr_conv, val_constr);
}
short_channel_ids_arg_constr.data = NULL;
int64_t* short_channel_ids_arg_vals = (int64_t*)(short_channel_ids_arg + 4);
for (size_t i = 0; i < short_channel_ids_arg_constr.datalen; i++) {
- int64_t arr_conv_8 = short_channel_ids_arg_vals[i];
- short_channel_ids_arg_constr.data[i] = arr_conv_8;
+ int64_t short_channel_ids_arg_conv_8 = short_channel_ids_arg_vals[i];
+ short_channel_ids_arg_constr.data[i] = short_channel_ids_arg_conv_8;
}
LDKQueryShortChannelIds ret_var = QueryShortChannelIds_new(chain_hash_arg_ref, short_channel_ids_arg_constr);
CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
val_constr.data = NULL;
uint32_t* val_vals = (uint32_t*)(val + 4);
for (size_t p = 0; p < val_constr.datalen; p++) {
- uint32_t arr_conv_15 = val_vals[p];
- LDKUpdateAddHTLC arr_conv_15_conv;
- arr_conv_15_conv.inner = (void*)(arr_conv_15 & (~1));
- arr_conv_15_conv.is_owned = (arr_conv_15 & 1) || (arr_conv_15 == 0);
- arr_conv_15_conv = UpdateAddHTLC_clone(&arr_conv_15_conv);
- val_constr.data[p] = arr_conv_15_conv;
+ uint32_t val_conv_15 = val_vals[p];
+ LDKUpdateAddHTLC val_conv_15_conv;
+ val_conv_15_conv.inner = (void*)(val_conv_15 & (~1));
+ val_conv_15_conv.is_owned = (val_conv_15 & 1) || (val_conv_15 == 0);
+ val_conv_15_conv = UpdateAddHTLC_clone(&val_conv_15_conv);
+ val_constr.data[p] = val_conv_15_conv;
}
CommitmentUpdate_set_update_add_htlcs(&this_ptr_conv, val_constr);
}
val_constr.data = NULL;
uint32_t* val_vals = (uint32_t*)(val + 4);
for (size_t t = 0; t < val_constr.datalen; t++) {
- uint32_t arr_conv_19 = val_vals[t];
- LDKUpdateFulfillHTLC arr_conv_19_conv;
- arr_conv_19_conv.inner = (void*)(arr_conv_19 & (~1));
- arr_conv_19_conv.is_owned = (arr_conv_19 & 1) || (arr_conv_19 == 0);
- arr_conv_19_conv = UpdateFulfillHTLC_clone(&arr_conv_19_conv);
- val_constr.data[t] = arr_conv_19_conv;
+ uint32_t val_conv_19 = val_vals[t];
+ LDKUpdateFulfillHTLC val_conv_19_conv;
+ val_conv_19_conv.inner = (void*)(val_conv_19 & (~1));
+ val_conv_19_conv.is_owned = (val_conv_19 & 1) || (val_conv_19 == 0);
+ val_conv_19_conv = UpdateFulfillHTLC_clone(&val_conv_19_conv);
+ val_constr.data[t] = val_conv_19_conv;
}
CommitmentUpdate_set_update_fulfill_htlcs(&this_ptr_conv, val_constr);
}
val_constr.data = NULL;
uint32_t* val_vals = (uint32_t*)(val + 4);
for (size_t q = 0; q < val_constr.datalen; q++) {
- uint32_t arr_conv_16 = val_vals[q];
- LDKUpdateFailHTLC arr_conv_16_conv;
- arr_conv_16_conv.inner = (void*)(arr_conv_16 & (~1));
- arr_conv_16_conv.is_owned = (arr_conv_16 & 1) || (arr_conv_16 == 0);
- arr_conv_16_conv = UpdateFailHTLC_clone(&arr_conv_16_conv);
- val_constr.data[q] = arr_conv_16_conv;
+ uint32_t val_conv_16 = val_vals[q];
+ LDKUpdateFailHTLC val_conv_16_conv;
+ val_conv_16_conv.inner = (void*)(val_conv_16 & (~1));
+ val_conv_16_conv.is_owned = (val_conv_16 & 1) || (val_conv_16 == 0);
+ val_conv_16_conv = UpdateFailHTLC_clone(&val_conv_16_conv);
+ val_constr.data[q] = val_conv_16_conv;
}
CommitmentUpdate_set_update_fail_htlcs(&this_ptr_conv, val_constr);
}
val_constr.data = NULL;
uint32_t* val_vals = (uint32_t*)(val + 4);
for (size_t z = 0; z < val_constr.datalen; z++) {
- uint32_t arr_conv_25 = val_vals[z];
- LDKUpdateFailMalformedHTLC arr_conv_25_conv;
- arr_conv_25_conv.inner = (void*)(arr_conv_25 & (~1));
- arr_conv_25_conv.is_owned = (arr_conv_25 & 1) || (arr_conv_25 == 0);
- arr_conv_25_conv = UpdateFailMalformedHTLC_clone(&arr_conv_25_conv);
- val_constr.data[z] = arr_conv_25_conv;
+ uint32_t val_conv_25 = val_vals[z];
+ LDKUpdateFailMalformedHTLC val_conv_25_conv;
+ val_conv_25_conv.inner = (void*)(val_conv_25 & (~1));
+ val_conv_25_conv.is_owned = (val_conv_25 & 1) || (val_conv_25 == 0);
+ val_conv_25_conv = UpdateFailMalformedHTLC_clone(&val_conv_25_conv);
+ val_constr.data[z] = val_conv_25_conv;
}
CommitmentUpdate_set_update_fail_malformed_htlcs(&this_ptr_conv, val_constr);
}
update_add_htlcs_arg_constr.data = NULL;
uint32_t* update_add_htlcs_arg_vals = (uint32_t*)(update_add_htlcs_arg + 4);
for (size_t p = 0; p < update_add_htlcs_arg_constr.datalen; p++) {
- uint32_t arr_conv_15 = update_add_htlcs_arg_vals[p];
- LDKUpdateAddHTLC arr_conv_15_conv;
- arr_conv_15_conv.inner = (void*)(arr_conv_15 & (~1));
- arr_conv_15_conv.is_owned = (arr_conv_15 & 1) || (arr_conv_15 == 0);
- arr_conv_15_conv = UpdateAddHTLC_clone(&arr_conv_15_conv);
- update_add_htlcs_arg_constr.data[p] = arr_conv_15_conv;
+ uint32_t update_add_htlcs_arg_conv_15 = update_add_htlcs_arg_vals[p];
+ LDKUpdateAddHTLC update_add_htlcs_arg_conv_15_conv;
+ update_add_htlcs_arg_conv_15_conv.inner = (void*)(update_add_htlcs_arg_conv_15 & (~1));
+ update_add_htlcs_arg_conv_15_conv.is_owned = (update_add_htlcs_arg_conv_15 & 1) || (update_add_htlcs_arg_conv_15 == 0);
+ update_add_htlcs_arg_conv_15_conv = UpdateAddHTLC_clone(&update_add_htlcs_arg_conv_15_conv);
+ update_add_htlcs_arg_constr.data[p] = update_add_htlcs_arg_conv_15_conv;
}
LDKCVec_UpdateFulfillHTLCZ update_fulfill_htlcs_arg_constr;
update_fulfill_htlcs_arg_constr.datalen = *((uint32_t*)update_fulfill_htlcs_arg);
update_fulfill_htlcs_arg_constr.data = NULL;
uint32_t* update_fulfill_htlcs_arg_vals = (uint32_t*)(update_fulfill_htlcs_arg + 4);
for (size_t t = 0; t < update_fulfill_htlcs_arg_constr.datalen; t++) {
- uint32_t arr_conv_19 = update_fulfill_htlcs_arg_vals[t];
- LDKUpdateFulfillHTLC arr_conv_19_conv;
- arr_conv_19_conv.inner = (void*)(arr_conv_19 & (~1));
- arr_conv_19_conv.is_owned = (arr_conv_19 & 1) || (arr_conv_19 == 0);
- arr_conv_19_conv = UpdateFulfillHTLC_clone(&arr_conv_19_conv);
- update_fulfill_htlcs_arg_constr.data[t] = arr_conv_19_conv;
+ uint32_t update_fulfill_htlcs_arg_conv_19 = update_fulfill_htlcs_arg_vals[t];
+ LDKUpdateFulfillHTLC update_fulfill_htlcs_arg_conv_19_conv;
+ update_fulfill_htlcs_arg_conv_19_conv.inner = (void*)(update_fulfill_htlcs_arg_conv_19 & (~1));
+ update_fulfill_htlcs_arg_conv_19_conv.is_owned = (update_fulfill_htlcs_arg_conv_19 & 1) || (update_fulfill_htlcs_arg_conv_19 == 0);
+ update_fulfill_htlcs_arg_conv_19_conv = UpdateFulfillHTLC_clone(&update_fulfill_htlcs_arg_conv_19_conv);
+ update_fulfill_htlcs_arg_constr.data[t] = update_fulfill_htlcs_arg_conv_19_conv;
}
LDKCVec_UpdateFailHTLCZ update_fail_htlcs_arg_constr;
update_fail_htlcs_arg_constr.datalen = *((uint32_t*)update_fail_htlcs_arg);
update_fail_htlcs_arg_constr.data = NULL;
uint32_t* update_fail_htlcs_arg_vals = (uint32_t*)(update_fail_htlcs_arg + 4);
for (size_t q = 0; q < update_fail_htlcs_arg_constr.datalen; q++) {
- uint32_t arr_conv_16 = update_fail_htlcs_arg_vals[q];
- LDKUpdateFailHTLC arr_conv_16_conv;
- arr_conv_16_conv.inner = (void*)(arr_conv_16 & (~1));
- arr_conv_16_conv.is_owned = (arr_conv_16 & 1) || (arr_conv_16 == 0);
- arr_conv_16_conv = UpdateFailHTLC_clone(&arr_conv_16_conv);
- update_fail_htlcs_arg_constr.data[q] = arr_conv_16_conv;
+ uint32_t update_fail_htlcs_arg_conv_16 = update_fail_htlcs_arg_vals[q];
+ LDKUpdateFailHTLC update_fail_htlcs_arg_conv_16_conv;
+ update_fail_htlcs_arg_conv_16_conv.inner = (void*)(update_fail_htlcs_arg_conv_16 & (~1));
+ update_fail_htlcs_arg_conv_16_conv.is_owned = (update_fail_htlcs_arg_conv_16 & 1) || (update_fail_htlcs_arg_conv_16 == 0);
+ update_fail_htlcs_arg_conv_16_conv = UpdateFailHTLC_clone(&update_fail_htlcs_arg_conv_16_conv);
+ update_fail_htlcs_arg_constr.data[q] = update_fail_htlcs_arg_conv_16_conv;
}
LDKCVec_UpdateFailMalformedHTLCZ update_fail_malformed_htlcs_arg_constr;
update_fail_malformed_htlcs_arg_constr.datalen = *((uint32_t*)update_fail_malformed_htlcs_arg);
update_fail_malformed_htlcs_arg_constr.data = NULL;
uint32_t* update_fail_malformed_htlcs_arg_vals = (uint32_t*)(update_fail_malformed_htlcs_arg + 4);
for (size_t z = 0; z < update_fail_malformed_htlcs_arg_constr.datalen; z++) {
- uint32_t arr_conv_25 = update_fail_malformed_htlcs_arg_vals[z];
- LDKUpdateFailMalformedHTLC arr_conv_25_conv;
- arr_conv_25_conv.inner = (void*)(arr_conv_25 & (~1));
- arr_conv_25_conv.is_owned = (arr_conv_25 & 1) || (arr_conv_25 == 0);
- arr_conv_25_conv = UpdateFailMalformedHTLC_clone(&arr_conv_25_conv);
- update_fail_malformed_htlcs_arg_constr.data[z] = arr_conv_25_conv;
+ uint32_t update_fail_malformed_htlcs_arg_conv_25 = update_fail_malformed_htlcs_arg_vals[z];
+ LDKUpdateFailMalformedHTLC update_fail_malformed_htlcs_arg_conv_25_conv;
+ update_fail_malformed_htlcs_arg_conv_25_conv.inner = (void*)(update_fail_malformed_htlcs_arg_conv_25 & (~1));
+ update_fail_malformed_htlcs_arg_conv_25_conv.is_owned = (update_fail_malformed_htlcs_arg_conv_25 & 1) || (update_fail_malformed_htlcs_arg_conv_25 == 0);
+ update_fail_malformed_htlcs_arg_conv_25_conv = UpdateFailMalformedHTLC_clone(&update_fail_malformed_htlcs_arg_conv_25_conv);
+ update_fail_malformed_htlcs_arg_constr.data[z] = update_fail_malformed_htlcs_arg_conv_25_conv;
}
LDKUpdateFee update_fee_arg_conv;
update_fee_arg_conv.inner = (void*)(update_fee_arg & (~1));
LDKAcceptChannel obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = AcceptChannel_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = AcceptChannel_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_AcceptChannel_read(int8_tArray ser) {
LDKAnnouncementSignatures obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = AnnouncementSignatures_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = AnnouncementSignatures_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_AnnouncementSignatures_read(int8_tArray ser) {
LDKChannelReestablish obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = ChannelReestablish_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = ChannelReestablish_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_ChannelReestablish_read(int8_tArray ser) {
LDKClosingSigned obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = ClosingSigned_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = ClosingSigned_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_ClosingSigned_read(int8_tArray ser) {
LDKCommitmentSigned obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = CommitmentSigned_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = CommitmentSigned_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_CommitmentSigned_read(int8_tArray ser) {
LDKFundingCreated obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = FundingCreated_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = FundingCreated_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_FundingCreated_read(int8_tArray ser) {
LDKFundingSigned obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = FundingSigned_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = FundingSigned_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_FundingSigned_read(int8_tArray ser) {
LDKFundingLocked obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = FundingLocked_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = FundingLocked_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_FundingLocked_read(int8_tArray ser) {
LDKInit obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = Init_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = Init_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_Init_read(int8_tArray ser) {
LDKOpenChannel obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = OpenChannel_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = OpenChannel_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_OpenChannel_read(int8_tArray ser) {
LDKRevokeAndACK obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = RevokeAndACK_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = RevokeAndACK_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_RevokeAndACK_read(int8_tArray ser) {
LDKShutdown obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = Shutdown_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = Shutdown_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_Shutdown_read(int8_tArray ser) {
LDKUpdateFailHTLC obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = UpdateFailHTLC_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = UpdateFailHTLC_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_UpdateFailHTLC_read(int8_tArray ser) {
LDKUpdateFailMalformedHTLC obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = UpdateFailMalformedHTLC_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = UpdateFailMalformedHTLC_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_UpdateFailMalformedHTLC_read(int8_tArray ser) {
LDKUpdateFee obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = UpdateFee_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = UpdateFee_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_UpdateFee_read(int8_tArray ser) {
LDKUpdateFulfillHTLC obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = UpdateFulfillHTLC_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = UpdateFulfillHTLC_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_UpdateFulfillHTLC_read(int8_tArray ser) {
LDKUpdateAddHTLC obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = UpdateAddHTLC_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = UpdateAddHTLC_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_UpdateAddHTLC_read(int8_tArray ser) {
LDKPing obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = Ping_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = Ping_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_Ping_read(int8_tArray ser) {
LDKPong obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = Pong_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = Pong_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_Pong_read(int8_tArray ser) {
LDKUnsignedChannelAnnouncement obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = UnsignedChannelAnnouncement_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = UnsignedChannelAnnouncement_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_UnsignedChannelAnnouncement_read(int8_tArray ser) {
LDKChannelAnnouncement obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = ChannelAnnouncement_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = ChannelAnnouncement_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_ChannelAnnouncement_read(int8_tArray ser) {
LDKUnsignedChannelUpdate obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = UnsignedChannelUpdate_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = UnsignedChannelUpdate_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_UnsignedChannelUpdate_read(int8_tArray ser) {
LDKChannelUpdate obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = ChannelUpdate_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = ChannelUpdate_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_ChannelUpdate_read(int8_tArray ser) {
LDKErrorMessage obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = ErrorMessage_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = ErrorMessage_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_ErrorMessage_read(int8_tArray ser) {
LDKUnsignedNodeAnnouncement obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = UnsignedNodeAnnouncement_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = UnsignedNodeAnnouncement_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_UnsignedNodeAnnouncement_read(int8_tArray ser) {
LDKNodeAnnouncement obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = NodeAnnouncement_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = NodeAnnouncement_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_NodeAnnouncement_read(int8_tArray ser) {
LDKQueryShortChannelIds obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = QueryShortChannelIds_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = QueryShortChannelIds_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_ReplyShortChannelIdsEnd_read(int8_tArray ser) {
LDKReplyShortChannelIdsEnd obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = ReplyShortChannelIdsEnd_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = ReplyShortChannelIdsEnd_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_QueryChannelRange_read(int8_tArray ser) {
LDKQueryChannelRange obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = QueryChannelRange_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = QueryChannelRange_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_ReplyChannelRange_read(int8_tArray ser) {
LDKReplyChannelRange obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = ReplyChannelRange_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = ReplyChannelRange_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_GossipTimestampFilter_read(int8_tArray ser) {
LDKGossipTimestampFilter obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = GossipTimestampFilter_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = GossipTimestampFilter_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_MessageHandler_free(uint32_t this_ptr) {
ptrArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native ptrArray Bytes");
int8_tArray *ret_arr_ptr = (int8_tArray*)(ret_arr + 4);
for (size_t m = 0; m < ret_var.datalen; m++) {
- int8_tArray arr_conv_12_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arr_conv_12_arr + 4), ret_var.data[m].compressed_form, 33);
- ret_arr_ptr[m] = arr_conv_12_arr;
+ int8_tArray ret_conv_12_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_conv_12_arr + 4), ret_var.data[m].compressed_form, 33);
+ ret_arr_ptr[m] = ret_conv_12_arr;
}
FREE(ret_var.data);
return ret_arr;
CHECK(*((uint32_t*)commitment_seed) == 32);
memcpy(commitment_seed_arr, (uint8_t*)(commitment_seed + 4), 32);
unsigned char (*commitment_seed_ref)[32] = &commitment_seed_arr;
- int8_tArray arg_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), build_commitment_secret(commitment_seed_ref, idx).data, 32);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), build_commitment_secret(commitment_seed_ref, idx).data, 32);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_derive_private_key(int8_tArray per_commitment_point, int8_tArray base_secret) {
LDKTxCreationKeys this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), TxCreationKeys_get_per_commitment_point(&this_ptr_conv).compressed_form, 33);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), TxCreationKeys_get_per_commitment_point(&this_ptr_conv).compressed_form, 33);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_TxCreationKeys_set_per_commitment_point(uint32_t this_ptr, int8_tArray val) {
LDKTxCreationKeys this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), TxCreationKeys_get_revocation_key(&this_ptr_conv).compressed_form, 33);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), TxCreationKeys_get_revocation_key(&this_ptr_conv).compressed_form, 33);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_TxCreationKeys_set_revocation_key(uint32_t this_ptr, int8_tArray val) {
LDKTxCreationKeys this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), TxCreationKeys_get_broadcaster_htlc_key(&this_ptr_conv).compressed_form, 33);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), TxCreationKeys_get_broadcaster_htlc_key(&this_ptr_conv).compressed_form, 33);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_TxCreationKeys_set_broadcaster_htlc_key(uint32_t this_ptr, int8_tArray val) {
LDKTxCreationKeys this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), TxCreationKeys_get_countersignatory_htlc_key(&this_ptr_conv).compressed_form, 33);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), TxCreationKeys_get_countersignatory_htlc_key(&this_ptr_conv).compressed_form, 33);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_TxCreationKeys_set_countersignatory_htlc_key(uint32_t this_ptr, int8_tArray val) {
LDKTxCreationKeys this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), TxCreationKeys_get_broadcaster_delayed_payment_key(&this_ptr_conv).compressed_form, 33);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), TxCreationKeys_get_broadcaster_delayed_payment_key(&this_ptr_conv).compressed_form, 33);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_TxCreationKeys_set_broadcaster_delayed_payment_key(uint32_t this_ptr, int8_tArray val) {
LDKTxCreationKeys obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = TxCreationKeys_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = TxCreationKeys_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_TxCreationKeys_read(int8_tArray ser) {
LDKChannelPublicKeys this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), ChannelPublicKeys_get_funding_pubkey(&this_ptr_conv).compressed_form, 33);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ChannelPublicKeys_get_funding_pubkey(&this_ptr_conv).compressed_form, 33);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_ChannelPublicKeys_set_funding_pubkey(uint32_t this_ptr, int8_tArray val) {
LDKChannelPublicKeys this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), ChannelPublicKeys_get_revocation_basepoint(&this_ptr_conv).compressed_form, 33);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ChannelPublicKeys_get_revocation_basepoint(&this_ptr_conv).compressed_form, 33);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_ChannelPublicKeys_set_revocation_basepoint(uint32_t this_ptr, int8_tArray val) {
LDKChannelPublicKeys this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), ChannelPublicKeys_get_payment_point(&this_ptr_conv).compressed_form, 33);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ChannelPublicKeys_get_payment_point(&this_ptr_conv).compressed_form, 33);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_ChannelPublicKeys_set_payment_point(uint32_t this_ptr, int8_tArray val) {
LDKChannelPublicKeys this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), ChannelPublicKeys_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form, 33);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ChannelPublicKeys_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form, 33);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_ChannelPublicKeys_set_delayed_payment_basepoint(uint32_t this_ptr, int8_tArray val) {
LDKChannelPublicKeys this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), ChannelPublicKeys_get_htlc_basepoint(&this_ptr_conv).compressed_form, 33);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ChannelPublicKeys_get_htlc_basepoint(&this_ptr_conv).compressed_form, 33);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_ChannelPublicKeys_set_htlc_basepoint(uint32_t this_ptr, int8_tArray val) {
LDKChannelPublicKeys obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = ChannelPublicKeys_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = ChannelPublicKeys_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_ChannelPublicKeys_read(int8_tArray ser) {
LDKPublicKey broadcaster_delayed_payment_key_ref;
CHECK(*((uint32_t*)broadcaster_delayed_payment_key) == 33);
memcpy(broadcaster_delayed_payment_key_ref.compressed_form, (uint8_t*)(broadcaster_delayed_payment_key + 4), 33);
- LDKCVec_u8Z arg_var = get_revokeable_redeemscript(revocation_key_ref, contest_delay, broadcaster_delayed_payment_key_ref);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = get_revokeable_redeemscript(revocation_key_ref, contest_delay, broadcaster_delayed_payment_key_ref);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_HTLCOutputInCommitment_free(uint32_t this_ptr) {
LDKHTLCOutputInCommitment obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = HTLCOutputInCommitment_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = HTLCOutputInCommitment_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_HTLCOutputInCommitment_read(int8_tArray ser) {
LDKTxCreationKeys keys_conv;
keys_conv.inner = (void*)(keys & (~1));
keys_conv.is_owned = false;
- LDKCVec_u8Z arg_var = get_htlc_redeemscript(&htlc_conv, &keys_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = get_htlc_redeemscript(&htlc_conv, &keys_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
int8_tArray __attribute__((visibility("default"))) TS_make_funding_redeemscript(int8_tArray broadcaster, int8_tArray countersignatory) {
LDKPublicKey countersignatory_ref;
CHECK(*((uint32_t*)countersignatory) == 33);
memcpy(countersignatory_ref.compressed_form, (uint8_t*)(countersignatory + 4), 33);
- LDKCVec_u8Z arg_var = make_funding_redeemscript(broadcaster_ref, countersignatory_ref);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = make_funding_redeemscript(broadcaster_ref, countersignatory_ref);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
int8_tArray __attribute__((visibility("default"))) TS_build_htlc_transaction(int8_tArray prev_hash, int32_t feerate_per_kw, int16_t contest_delay, uint32_t htlc, int8_tArray broadcaster_delayed_payment_key, int8_tArray revocation_key) {
LDKPublicKey revocation_key_ref;
CHECK(*((uint32_t*)revocation_key) == 33);
memcpy(revocation_key_ref.compressed_form, (uint8_t*)(revocation_key + 4), 33);
- LDKTransaction arg_var = build_htlc_transaction(prev_hash_ref, feerate_per_kw, contest_delay, &htlc_conv, broadcaster_delayed_payment_key_ref, revocation_key_ref);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- Transaction_free(arg_var);
- return arg_arr;
+ LDKTransaction ret_var = build_htlc_transaction(prev_hash_ref, feerate_per_kw, contest_delay, &htlc_conv, broadcaster_delayed_payment_key_ref, revocation_key_ref);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ Transaction_free(ret_var);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_ChannelTransactionParameters_free(uint32_t this_ptr) {
LDKCounterpartyChannelTransactionParameters obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = CounterpartyChannelTransactionParameters_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = CounterpartyChannelTransactionParameters_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_CounterpartyChannelTransactionParameters_read(int8_tArray ser) {
LDKChannelTransactionParameters obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = ChannelTransactionParameters_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = ChannelTransactionParameters_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_ChannelTransactionParameters_read(int8_tArray ser) {
LDKHolderCommitmentTransaction this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), HolderCommitmentTransaction_get_counterparty_sig(&this_ptr_conv).compact_form, 64);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), HolderCommitmentTransaction_get_counterparty_sig(&this_ptr_conv).compact_form, 64);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_HolderCommitmentTransaction_set_counterparty_sig(uint32_t this_ptr, int8_tArray val) {
val_constr.data = NULL;
int8_tArray* val_vals = (int8_tArray*)(val + 4);
for (size_t m = 0; m < val_constr.datalen; m++) {
- int8_tArray arr_conv_12 = val_vals[m];
- LDKSignature arr_conv_12_ref;
- CHECK(*((uint32_t*)arr_conv_12) == 64);
- memcpy(arr_conv_12_ref.compact_form, (uint8_t*)(arr_conv_12 + 4), 64);
- val_constr.data[m] = arr_conv_12_ref;
+ int8_tArray val_conv_12 = val_vals[m];
+ LDKSignature val_conv_12_ref;
+ CHECK(*((uint32_t*)val_conv_12) == 64);
+ memcpy(val_conv_12_ref.compact_form, (uint8_t*)(val_conv_12 + 4), 64);
+ val_constr.data[m] = val_conv_12_ref;
}
HolderCommitmentTransaction_set_counterparty_htlc_sigs(&this_ptr_conv, val_constr);
}
LDKHolderCommitmentTransaction obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = HolderCommitmentTransaction_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = HolderCommitmentTransaction_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_HolderCommitmentTransaction_read(int8_tArray ser) {
counterparty_htlc_sigs_constr.data = NULL;
int8_tArray* counterparty_htlc_sigs_vals = (int8_tArray*)(counterparty_htlc_sigs + 4);
for (size_t m = 0; m < counterparty_htlc_sigs_constr.datalen; m++) {
- int8_tArray arr_conv_12 = counterparty_htlc_sigs_vals[m];
- LDKSignature arr_conv_12_ref;
- CHECK(*((uint32_t*)arr_conv_12) == 64);
- memcpy(arr_conv_12_ref.compact_form, (uint8_t*)(arr_conv_12 + 4), 64);
- counterparty_htlc_sigs_constr.data[m] = arr_conv_12_ref;
+ int8_tArray counterparty_htlc_sigs_conv_12 = counterparty_htlc_sigs_vals[m];
+ LDKSignature counterparty_htlc_sigs_conv_12_ref;
+ CHECK(*((uint32_t*)counterparty_htlc_sigs_conv_12) == 64);
+ memcpy(counterparty_htlc_sigs_conv_12_ref.compact_form, (uint8_t*)(counterparty_htlc_sigs_conv_12 + 4), 64);
+ counterparty_htlc_sigs_constr.data[m] = counterparty_htlc_sigs_conv_12_ref;
}
LDKPublicKey holder_funding_key_ref;
CHECK(*((uint32_t*)holder_funding_key) == 33);
LDKBuiltCommitmentTransaction this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKTransaction arg_var = BuiltCommitmentTransaction_get_transaction(&this_ptr_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- Transaction_free(arg_var);
- return arg_arr;
+ LDKTransaction ret_var = BuiltCommitmentTransaction_get_transaction(&this_ptr_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ Transaction_free(ret_var);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_BuiltCommitmentTransaction_set_transaction(uint32_t this_ptr, int8_tArray val) {
LDKBuiltCommitmentTransaction obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = BuiltCommitmentTransaction_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = BuiltCommitmentTransaction_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_BuiltCommitmentTransaction_read(int8_tArray ser) {
LDKu8slice funding_redeemscript_ref;
funding_redeemscript_ref.datalen = *((uint32_t*)funding_redeemscript);
funding_redeemscript_ref.data = (int8_t*)(funding_redeemscript + 4);
- int8_tArray arg_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), BuiltCommitmentTransaction_get_sighash_all(&this_arg_conv, funding_redeemscript_ref, channel_value_satoshis).data, 32);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), BuiltCommitmentTransaction_get_sighash_all(&this_arg_conv, funding_redeemscript_ref, channel_value_satoshis).data, 32);
+ return ret_arr;
}
int8_tArray __attribute__((visibility("default"))) TS_BuiltCommitmentTransaction_sign(uint32_t this_arg, int8_tArray funding_key, int8_tArray funding_redeemscript, int64_t channel_value_satoshis) {
LDKu8slice funding_redeemscript_ref;
funding_redeemscript_ref.datalen = *((uint32_t*)funding_redeemscript);
funding_redeemscript_ref.data = (int8_t*)(funding_redeemscript + 4);
- int8_tArray arg_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), BuiltCommitmentTransaction_sign(&this_arg_conv, funding_key_ref, funding_redeemscript_ref, channel_value_satoshis).compact_form, 64);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(64, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), BuiltCommitmentTransaction_sign(&this_arg_conv, funding_key_ref, funding_redeemscript_ref, channel_value_satoshis).compact_form, 64);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_CommitmentTransaction_free(uint32_t this_ptr) {
LDKCommitmentTransaction obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = CommitmentTransaction_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = CommitmentTransaction_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_CommitmentTransaction_read(int8_tArray ser) {
LDKTrustedCommitmentTransaction this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- int8_tArray arg_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), TrustedCommitmentTransaction_txid(&this_arg_conv).data, 32);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), TrustedCommitmentTransaction_txid(&this_arg_conv).data, 32);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_TrustedCommitmentTransaction_built_transaction(uint32_t this_arg) {
LDKInitFeatures obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = InitFeatures_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = InitFeatures_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
int8_tArray __attribute__((visibility("default"))) TS_NodeFeatures_write(uint32_t obj) {
LDKNodeFeatures obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = NodeFeatures_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = NodeFeatures_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
int8_tArray __attribute__((visibility("default"))) TS_ChannelFeatures_write(uint32_t obj) {
LDKChannelFeatures obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = ChannelFeatures_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = ChannelFeatures_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_InitFeatures_read(int8_tArray ser) {
LDKRouteHop this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), RouteHop_get_pubkey(&this_ptr_conv).compressed_form, 33);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), RouteHop_get_pubkey(&this_ptr_conv).compressed_form, 33);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_RouteHop_set_pubkey(uint32_t this_ptr, int8_tArray val) {
val_constr.data = NULL;
uint32_tArray* val_vals = (uint32_tArray*)(val + 4);
for (size_t m = 0; m < val_constr.datalen; m++) {
- uint32_tArray arr_conv_12 = val_vals[m];
- LDKCVec_RouteHopZ arr_conv_12_constr;
- arr_conv_12_constr.datalen = *((uint32_t*)arr_conv_12);
- if (arr_conv_12_constr.datalen > 0)
- arr_conv_12_constr.data = MALLOC(arr_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
+ uint32_tArray val_conv_12 = val_vals[m];
+ LDKCVec_RouteHopZ val_conv_12_constr;
+ val_conv_12_constr.datalen = *((uint32_t*)val_conv_12);
+ if (val_conv_12_constr.datalen > 0)
+ val_conv_12_constr.data = MALLOC(val_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
else
- arr_conv_12_constr.data = NULL;
- uint32_t* arr_conv_12_vals = (uint32_t*)(arr_conv_12 + 4);
- for (size_t k = 0; k < arr_conv_12_constr.datalen; k++) {
- uint32_t arr_conv_10 = arr_conv_12_vals[k];
- LDKRouteHop arr_conv_10_conv;
- arr_conv_10_conv.inner = (void*)(arr_conv_10 & (~1));
- arr_conv_10_conv.is_owned = (arr_conv_10 & 1) || (arr_conv_10 == 0);
- arr_conv_10_conv = RouteHop_clone(&arr_conv_10_conv);
- arr_conv_12_constr.data[k] = arr_conv_10_conv;
+ val_conv_12_constr.data = NULL;
+ uint32_t* val_conv_12_vals = (uint32_t*)(val_conv_12 + 4);
+ for (size_t k = 0; k < val_conv_12_constr.datalen; k++) {
+ uint32_t val_conv_12_conv_10 = val_conv_12_vals[k];
+ LDKRouteHop val_conv_12_conv_10_conv;
+ val_conv_12_conv_10_conv.inner = (void*)(val_conv_12_conv_10 & (~1));
+ val_conv_12_conv_10_conv.is_owned = (val_conv_12_conv_10 & 1) || (val_conv_12_conv_10 == 0);
+ val_conv_12_conv_10_conv = RouteHop_clone(&val_conv_12_conv_10_conv);
+ val_conv_12_constr.data[k] = val_conv_12_conv_10_conv;
}
- val_constr.data[m] = arr_conv_12_constr;
+ val_constr.data[m] = val_conv_12_constr;
}
Route_set_paths(&this_ptr_conv, val_constr);
}
paths_arg_constr.data = NULL;
uint32_tArray* paths_arg_vals = (uint32_tArray*)(paths_arg + 4);
for (size_t m = 0; m < paths_arg_constr.datalen; m++) {
- uint32_tArray arr_conv_12 = paths_arg_vals[m];
- LDKCVec_RouteHopZ arr_conv_12_constr;
- arr_conv_12_constr.datalen = *((uint32_t*)arr_conv_12);
- if (arr_conv_12_constr.datalen > 0)
- arr_conv_12_constr.data = MALLOC(arr_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
+ uint32_tArray paths_arg_conv_12 = paths_arg_vals[m];
+ LDKCVec_RouteHopZ paths_arg_conv_12_constr;
+ paths_arg_conv_12_constr.datalen = *((uint32_t*)paths_arg_conv_12);
+ if (paths_arg_conv_12_constr.datalen > 0)
+ paths_arg_conv_12_constr.data = MALLOC(paths_arg_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
else
- arr_conv_12_constr.data = NULL;
- uint32_t* arr_conv_12_vals = (uint32_t*)(arr_conv_12 + 4);
- for (size_t k = 0; k < arr_conv_12_constr.datalen; k++) {
- uint32_t arr_conv_10 = arr_conv_12_vals[k];
- LDKRouteHop arr_conv_10_conv;
- arr_conv_10_conv.inner = (void*)(arr_conv_10 & (~1));
- arr_conv_10_conv.is_owned = (arr_conv_10 & 1) || (arr_conv_10 == 0);
- arr_conv_10_conv = RouteHop_clone(&arr_conv_10_conv);
- arr_conv_12_constr.data[k] = arr_conv_10_conv;
+ paths_arg_conv_12_constr.data = NULL;
+ uint32_t* paths_arg_conv_12_vals = (uint32_t*)(paths_arg_conv_12 + 4);
+ for (size_t k = 0; k < paths_arg_conv_12_constr.datalen; k++) {
+ uint32_t paths_arg_conv_12_conv_10 = paths_arg_conv_12_vals[k];
+ LDKRouteHop paths_arg_conv_12_conv_10_conv;
+ paths_arg_conv_12_conv_10_conv.inner = (void*)(paths_arg_conv_12_conv_10 & (~1));
+ paths_arg_conv_12_conv_10_conv.is_owned = (paths_arg_conv_12_conv_10 & 1) || (paths_arg_conv_12_conv_10 == 0);
+ paths_arg_conv_12_conv_10_conv = RouteHop_clone(&paths_arg_conv_12_conv_10_conv);
+ paths_arg_conv_12_constr.data[k] = paths_arg_conv_12_conv_10_conv;
}
- paths_arg_constr.data[m] = arr_conv_12_constr;
+ paths_arg_constr.data[m] = paths_arg_conv_12_constr;
}
LDKRoute ret_var = Route_new(paths_arg_constr);
CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
LDKRoute obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = Route_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = Route_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_Route_read(int8_tArray ser) {
LDKRouteHint this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), RouteHint_get_src_node_id(&this_ptr_conv).compressed_form, 33);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), RouteHint_get_src_node_id(&this_ptr_conv).compressed_form, 33);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_RouteHint_set_src_node_id(uint32_t this_ptr, int8_tArray val) {
first_hops_constr.data = NULL;
uint32_t* first_hops_vals = (uint32_t*)(first_hops + 4);
for (size_t q = 0; q < first_hops_constr.datalen; q++) {
- uint32_t arr_conv_16 = first_hops_vals[q];
- LDKChannelDetails arr_conv_16_conv;
- arr_conv_16_conv.inner = (void*)(arr_conv_16 & (~1));
- arr_conv_16_conv.is_owned = (arr_conv_16 & 1) || (arr_conv_16 == 0);
- first_hops_constr.data[q] = arr_conv_16_conv;
+ uint32_t first_hops_conv_16 = first_hops_vals[q];
+ LDKChannelDetails first_hops_conv_16_conv;
+ first_hops_conv_16_conv.inner = (void*)(first_hops_conv_16 & (~1));
+ first_hops_conv_16_conv.is_owned = (first_hops_conv_16 & 1) || (first_hops_conv_16 == 0);
+ first_hops_constr.data[q] = first_hops_conv_16_conv;
}
LDKCVec_RouteHintZ last_hops_constr;
last_hops_constr.datalen = *((uint32_t*)last_hops);
last_hops_constr.data = NULL;
uint32_t* last_hops_vals = (uint32_t*)(last_hops + 4);
for (size_t l = 0; l < last_hops_constr.datalen; l++) {
- uint32_t arr_conv_11 = last_hops_vals[l];
- LDKRouteHint arr_conv_11_conv;
- arr_conv_11_conv.inner = (void*)(arr_conv_11 & (~1));
- arr_conv_11_conv.is_owned = (arr_conv_11 & 1) || (arr_conv_11 == 0);
- arr_conv_11_conv = RouteHint_clone(&arr_conv_11_conv);
- last_hops_constr.data[l] = arr_conv_11_conv;
+ uint32_t last_hops_conv_11 = last_hops_vals[l];
+ LDKRouteHint last_hops_conv_11_conv;
+ last_hops_conv_11_conv.inner = (void*)(last_hops_conv_11 & (~1));
+ last_hops_conv_11_conv.is_owned = (last_hops_conv_11 & 1) || (last_hops_conv_11 == 0);
+ last_hops_conv_11_conv = RouteHint_clone(&last_hops_conv_11_conv);
+ last_hops_constr.data[l] = last_hops_conv_11_conv;
}
LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
NetworkGraph_free(this_ptr_conv);
}
+uint32_t __attribute__((visibility("default"))) TS_NetworkGraph_clone(uint32_t orig) {
+ LDKNetworkGraph orig_conv;
+ orig_conv.inner = (void*)(orig & (~1));
+ orig_conv.is_owned = false;
+ LDKNetworkGraph ret_var = NetworkGraph_clone(&orig_conv);
+ 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;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
void __attribute__((visibility("default"))) TS_LockedNetworkGraph_free(uint32_t this_ptr) {
LDKLockedNetworkGraph this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
LDKNetworkGraph network_graph_conv;
network_graph_conv.inner = (void*)(network_graph & (~1));
network_graph_conv.is_owned = (network_graph & 1) || (network_graph == 0);
- // Warning: we need a move here but no clone is available for LDKNetworkGraph
+ network_graph_conv = NetworkGraph_clone(&network_graph_conv);
LDKNetGraphMsgHandler ret_var = NetGraphMsgHandler_from_net_graph(chain_access_conv, logger_conv, network_graph_conv);
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.
LDKDirectionalChannelInfo obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = DirectionalChannelInfo_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = DirectionalChannelInfo_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_DirectionalChannelInfo_read(int8_tArray ser) {
LDKChannelInfo this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), ChannelInfo_get_node_one(&this_ptr_conv).compressed_form, 33);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ChannelInfo_get_node_one(&this_ptr_conv).compressed_form, 33);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_ChannelInfo_set_node_one(uint32_t this_ptr, int8_tArray val) {
LDKChannelInfo this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- int8_tArray arg_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), ChannelInfo_get_node_two(&this_ptr_conv).compressed_form, 33);
- return arg_arr;
+ int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ChannelInfo_get_node_two(&this_ptr_conv).compressed_form, 33);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_ChannelInfo_set_node_two(uint32_t this_ptr, int8_tArray val) {
ChannelInfo_set_announcement_message(&this_ptr_conv, val_conv);
}
+uint32_t __attribute__((visibility("default"))) TS_ChannelInfo_clone(uint32_t orig) {
+ LDKChannelInfo orig_conv;
+ orig_conv.inner = (void*)(orig & (~1));
+ orig_conv.is_owned = false;
+ LDKChannelInfo ret_var = ChannelInfo_clone(&orig_conv);
+ 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;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
int8_tArray __attribute__((visibility("default"))) TS_ChannelInfo_write(uint32_t obj) {
LDKChannelInfo obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = ChannelInfo_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = ChannelInfo_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_ChannelInfo_read(int8_tArray ser) {
LDKRoutingFees obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = RoutingFees_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = RoutingFees_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
void __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_free(uint32_t this_ptr) {
val_constr.data = NULL;
uint32_t* val_vals = (uint32_t*)(val + 4);
for (size_t m = 0; m < val_constr.datalen; m++) {
- uint32_t arr_conv_12 = val_vals[m];
- LDKNetAddress arr_conv_12_conv = *(LDKNetAddress*)(((uint64_t)arr_conv_12) & ~1);
- FREE((void*)arr_conv_12);
- val_constr.data[m] = arr_conv_12_conv;
+ uint32_t val_conv_12 = val_vals[m];
+ LDKNetAddress val_conv_12_conv = *(LDKNetAddress*)(((uint64_t)val_conv_12) & ~1);
+ FREE((void*)val_conv_12);
+ val_constr.data[m] = val_conv_12_conv;
}
NodeAnnouncementInfo_set_addresses(&this_ptr_conv, val_constr);
}
addresses_arg_constr.data = NULL;
uint32_t* addresses_arg_vals = (uint32_t*)(addresses_arg + 4);
for (size_t m = 0; m < addresses_arg_constr.datalen; m++) {
- uint32_t arr_conv_12 = addresses_arg_vals[m];
- LDKNetAddress arr_conv_12_conv = *(LDKNetAddress*)(((uint64_t)arr_conv_12) & ~1);
- FREE((void*)arr_conv_12);
- addresses_arg_constr.data[m] = arr_conv_12_conv;
+ uint32_t addresses_arg_conv_12 = addresses_arg_vals[m];
+ LDKNetAddress addresses_arg_conv_12_conv = *(LDKNetAddress*)(((uint64_t)addresses_arg_conv_12) & ~1);
+ FREE((void*)addresses_arg_conv_12);
+ addresses_arg_constr.data[m] = addresses_arg_conv_12_conv;
}
LDKNodeAnnouncement announcement_message_arg_conv;
announcement_message_arg_conv.inner = (void*)(announcement_message_arg & (~1));
LDKNodeAnnouncementInfo obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = NodeAnnouncementInfo_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = NodeAnnouncementInfo_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_NodeAnnouncementInfo_read(int8_tArray ser) {
val_constr.data = NULL;
int64_t* val_vals = (int64_t*)(val + 4);
for (size_t i = 0; i < val_constr.datalen; i++) {
- int64_t arr_conv_8 = val_vals[i];
- val_constr.data[i] = arr_conv_8;
+ int64_t val_conv_8 = val_vals[i];
+ val_constr.data[i] = val_conv_8;
}
NodeInfo_set_channels(&this_ptr_conv, val_constr);
}
channels_arg_constr.data = NULL;
int64_t* channels_arg_vals = (int64_t*)(channels_arg + 4);
for (size_t i = 0; i < channels_arg_constr.datalen; i++) {
- int64_t arr_conv_8 = channels_arg_vals[i];
- channels_arg_constr.data[i] = arr_conv_8;
+ int64_t channels_arg_conv_8 = channels_arg_vals[i];
+ channels_arg_constr.data[i] = channels_arg_conv_8;
}
LDKRoutingFees lowest_inbound_channel_fees_arg_conv;
lowest_inbound_channel_fees_arg_conv.inner = (void*)(lowest_inbound_channel_fees_arg & (~1));
LDKNodeInfo obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = NodeInfo_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = NodeInfo_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_NodeInfo_read(int8_tArray ser) {
LDKNetworkGraph obj_conv;
obj_conv.inner = (void*)(obj & (~1));
obj_conv.is_owned = false;
- LDKCVec_u8Z arg_var = NetworkGraph_write(&obj_conv);
- int8_tArray arg_arr = init_arr(arg_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
- memcpy((uint8_t*)(arg_arr + 4), arg_var.data, arg_var.datalen);
- CVec_u8Z_free(arg_var);
- return arg_arr;
+ LDKCVec_u8Z ret_var = NetworkGraph_write(&obj_conv);
+ int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_NetworkGraph_read(int8_tArray ser) {
public static native boolean LDKCResult_NoneChannelMonitorUpdateErrZ_result_ok(long arg);
public static native void LDKCResult_NoneChannelMonitorUpdateErrZ_get_ok(long arg);
public static native LDKChannelMonitorUpdateErr LDKCResult_NoneChannelMonitorUpdateErrZ_get_err(long arg);
+ public static class LDKMonitorEvent {
+ private LDKMonitorEvent() {}
+ export class HTLCEvent extends LDKMonitorEvent {
+ HTLCEvent() { }
+ }
+ export class CommitmentTxBroadcasted extends LDKMonitorEvent {
+ CommitmentTxBroadcasted() { }
+ }
+ static native void init();
+ }
+ static { LDKMonitorEvent.init(); }
+ public static native LDKMonitorEvent LDKMonitorEvent_ref_from_ptr(long ptr);
public static native long LDKCVec_MonitorEventZ_new(number[] elems);
- public static native long LDKC2Tuple_u64u64Z_new(number a, number b);
- public static native number LDKC2Tuple_u64u64Z_get_a(long ptr);
- public static native number LDKC2Tuple_u64u64Z_get_b(long ptr);
public static class LDKSpendableOutputDescriptor {
private LDKSpendableOutputDescriptor() {}
export class StaticOutput extends LDKSpendableOutputDescriptor {
public number output;
StaticOutput(number outpoint, number output) { this.outpoint = outpoint; this.output = output; }
}
- export class DynamicOutputP2WSH extends LDKSpendableOutputDescriptor {
- public number outpoint;
- public Uint8Array per_commitment_point;
- public number to_self_delay;
- public number output;
- public number key_derivation_params;
- public Uint8Array revocation_pubkey;
- DynamicOutputP2WSH(number outpoint, Uint8Array per_commitment_point, number to_self_delay, number output, number key_derivation_params, Uint8Array revocation_pubkey) { this.outpoint = outpoint; this.per_commitment_point = per_commitment_point; this.to_self_delay = to_self_delay; this.output = output; this.key_derivation_params = key_derivation_params; this.revocation_pubkey = revocation_pubkey; }
+ export class DelayedPaymentOutput extends LDKSpendableOutputDescriptor {
+ DelayedPaymentOutput() { }
}
- export class StaticOutputCounterpartyPayment extends LDKSpendableOutputDescriptor {
- public number outpoint;
- public number output;
- public number key_derivation_params;
- StaticOutputCounterpartyPayment(number outpoint, number output, number key_derivation_params) { this.outpoint = outpoint; this.output = output; this.key_derivation_params = key_derivation_params; }
+ export class StaticPaymentOutput extends LDKSpendableOutputDescriptor {
+ StaticPaymentOutput() { }
}
static native void init();
}
// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START
- export interface LDKChannelKeys {
+ export interface LDKSign {
get_per_commitment_point (idx: number): Uint8Array;
release_commitment_secret (idx: number): Uint8Array;
- key_derivation_params (): number;
+ channel_keys_id (): Uint8Array;
sign_counterparty_commitment (commitment_tx: number): number;
sign_holder_commitment_and_htlcs (commitment_tx: number): number;
sign_justice_transaction (justice_tx: Uint8Array, input: number, amount: number, per_commitment_key: Uint8Array, htlc: number): number;
write (): Uint8Array;
}
- export function LDKChannelKeys_new(impl: LDKChannelKeys, pubkeys: number): number {
+ export function LDKSign_new(impl: LDKSign, pubkeys: number): number {
throw new Error('unimplemented'); // TODO: bind to WASM
}
// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END
- // LDKPublicKey ChannelKeys_get_per_commitment_point LDKChannelKeys* this_arg, uint64_t idx
- export function ChannelKeys_get_per_commitment_point(this_arg: number, idx: number): Uint8Array {
+ // LDKPublicKey Sign_get_per_commitment_point LDKSign* this_arg, uint64_t idx
+ export function Sign_get_per_commitment_point(this_arg: number, idx: number): Uint8Array {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.ChannelKeys_get_per_commitment_point(this_arg, idx);
+ const nativeResponseValue = wasm.Sign_get_per_commitment_point(this_arg, idx);
return decodeArray(nativeResponseValue);
}
- // LDKThirtyTwoBytes ChannelKeys_release_commitment_secret LDKChannelKeys* this_arg, uint64_t idx
- export function ChannelKeys_release_commitment_secret(this_arg: number, idx: number): Uint8Array {
+ // LDKThirtyTwoBytes Sign_release_commitment_secret LDKSign* this_arg, uint64_t idx
+ export function Sign_release_commitment_secret(this_arg: number, idx: number): Uint8Array {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.ChannelKeys_release_commitment_secret(this_arg, idx);
+ const nativeResponseValue = wasm.Sign_release_commitment_secret(this_arg, idx);
return decodeArray(nativeResponseValue);
}
- // LDKC2Tuple_u64u64Z ChannelKeys_key_derivation_params LDKChannelKeys* this_arg
- export function ChannelKeys_key_derivation_params(this_arg: number): number {
+ // LDKThirtyTwoBytes Sign_channel_keys_id LDKSign* this_arg
+ export function Sign_channel_keys_id(this_arg: number): Uint8Array {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.ChannelKeys_key_derivation_params(this_arg);
- return nativeResponseValue;
+ const nativeResponseValue = wasm.Sign_channel_keys_id(this_arg);
+ return decodeArray(nativeResponseValue);
}
- // LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ChannelKeys_sign_counterparty_commitment LDKChannelKeys* this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx
- export function ChannelKeys_sign_counterparty_commitment(this_arg: number, commitment_tx: number): number {
+ // LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ Sign_sign_counterparty_commitment LDKSign* this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx
+ export function Sign_sign_counterparty_commitment(this_arg: number, commitment_tx: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.ChannelKeys_sign_counterparty_commitment(this_arg, commitment_tx);
+ const nativeResponseValue = wasm.Sign_sign_counterparty_commitment(this_arg, commitment_tx);
return nativeResponseValue;
}
- // LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ChannelKeys_sign_holder_commitment_and_htlcs LDKChannelKeys* this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx
- export function ChannelKeys_sign_holder_commitment_and_htlcs(this_arg: number, commitment_tx: number): number {
+ // LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ Sign_sign_holder_commitment_and_htlcs LDKSign* this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx
+ export function Sign_sign_holder_commitment_and_htlcs(this_arg: number, commitment_tx: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.ChannelKeys_sign_holder_commitment_and_htlcs(this_arg, commitment_tx);
+ const nativeResponseValue = wasm.Sign_sign_holder_commitment_and_htlcs(this_arg, commitment_tx);
return nativeResponseValue;
}
- // LDKCResult_SignatureNoneZ ChannelKeys_sign_justice_transaction LDKChannelKeys* this_arg, struct LDKTransaction justice_tx, uintptr_t input, uint64_t amount, const uint8_t (*per_commitment_key)[32], const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc
- export function ChannelKeys_sign_justice_transaction(this_arg: number, justice_tx: Uint8Array, input: number, amount: number, per_commitment_key: Uint8Array, htlc: number): number {
+ // LDKCResult_SignatureNoneZ Sign_sign_justice_transaction LDKSign* this_arg, struct LDKTransaction justice_tx, uintptr_t input, uint64_t amount, const uint8_t (*per_commitment_key)[32], const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc
+ export function Sign_sign_justice_transaction(this_arg: number, justice_tx: Uint8Array, input: number, amount: number, per_commitment_key: Uint8Array, htlc: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.ChannelKeys_sign_justice_transaction(this_arg, encodeArray(justice_tx), input, amount, encodeArray(per_commitment_key), htlc);
+ const nativeResponseValue = wasm.Sign_sign_justice_transaction(this_arg, encodeArray(justice_tx), input, amount, encodeArray(per_commitment_key), htlc);
return nativeResponseValue;
}
- // LDKCResult_SignatureNoneZ ChannelKeys_sign_counterparty_htlc_transaction LDKChannelKeys* this_arg, struct LDKTransaction htlc_tx, uintptr_t input, uint64_t amount, struct LDKPublicKey per_commitment_point, const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc
- export function ChannelKeys_sign_counterparty_htlc_transaction(this_arg: number, htlc_tx: Uint8Array, input: number, amount: number, per_commitment_point: Uint8Array, htlc: number): number {
+ // LDKCResult_SignatureNoneZ Sign_sign_counterparty_htlc_transaction LDKSign* this_arg, struct LDKTransaction htlc_tx, uintptr_t input, uint64_t amount, struct LDKPublicKey per_commitment_point, const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc
+ export function Sign_sign_counterparty_htlc_transaction(this_arg: number, htlc_tx: Uint8Array, input: number, amount: number, per_commitment_point: Uint8Array, htlc: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.ChannelKeys_sign_counterparty_htlc_transaction(this_arg, encodeArray(htlc_tx), input, amount, encodeArray(per_commitment_point), htlc);
+ const nativeResponseValue = wasm.Sign_sign_counterparty_htlc_transaction(this_arg, encodeArray(htlc_tx), input, amount, encodeArray(per_commitment_point), htlc);
return nativeResponseValue;
}
- // LDKCResult_SignatureNoneZ ChannelKeys_sign_closing_transaction LDKChannelKeys* this_arg, struct LDKTransaction closing_tx
- export function ChannelKeys_sign_closing_transaction(this_arg: number, closing_tx: Uint8Array): number {
+ // LDKCResult_SignatureNoneZ Sign_sign_closing_transaction LDKSign* this_arg, struct LDKTransaction closing_tx
+ export function Sign_sign_closing_transaction(this_arg: number, closing_tx: Uint8Array): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.ChannelKeys_sign_closing_transaction(this_arg, encodeArray(closing_tx));
+ const nativeResponseValue = wasm.Sign_sign_closing_transaction(this_arg, encodeArray(closing_tx));
return nativeResponseValue;
}
- // LDKCResult_SignatureNoneZ ChannelKeys_sign_channel_announcement LDKChannelKeys* this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg
- export function ChannelKeys_sign_channel_announcement(this_arg: number, msg: number): number {
+ // LDKCResult_SignatureNoneZ Sign_sign_channel_announcement LDKSign* this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg
+ export function Sign_sign_channel_announcement(this_arg: number, msg: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.ChannelKeys_sign_channel_announcement(this_arg, msg);
+ const nativeResponseValue = wasm.Sign_sign_channel_announcement(this_arg, msg);
return nativeResponseValue;
}
- // void ChannelKeys_ready_channel LDKChannelKeys* this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters
- export function ChannelKeys_ready_channel(this_arg: number, channel_parameters: number): void {
+ // void Sign_ready_channel LDKSign* this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters
+ export function Sign_ready_channel(this_arg: number, channel_parameters: number): void {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.ChannelKeys_ready_channel(this_arg, channel_parameters);
+ const nativeResponseValue = wasm.Sign_ready_channel(this_arg, channel_parameters);
// debug statements here
}
- // LDKCVec_u8Z ChannelKeys_write LDKChannelKeys* this_arg
- export function ChannelKeys_write(this_arg: number): Uint8Array {
+ // LDKCVec_u8Z Sign_write LDKSign* this_arg
+ export function Sign_write(this_arg: number): Uint8Array {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.ChannelKeys_write(this_arg);
+ const nativeResponseValue = wasm.Sign_write(this_arg);
return decodeArray(nativeResponseValue);
}
- // LDKChannelPublicKeys ChannelKeys_get_pubkeys LDKChannelKeys* this_arg
- export function ChannelKeys_get_pubkeys(this_arg: number): number {
+ // LDKChannelPublicKeys Sign_get_pubkeys LDKSign* this_arg
+ export function Sign_get_pubkeys(this_arg: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.ChannelKeys_get_pubkeys(this_arg);
+ const nativeResponseValue = wasm.Sign_get_pubkeys(this_arg);
return nativeResponseValue;
}
public static native long LDKC2Tuple_BlockHashChannelMonitorZ_new(Uint8Array a, number b);
public static native boolean LDKCResult_NoneAPIErrorZ_result_ok(long arg);
public static native void LDKCResult_NoneAPIErrorZ_get_ok(long arg);
public static native number LDKCResult_NoneAPIErrorZ_get_err(long arg);
+ public static native long LDKCVec_CResult_NoneAPIErrorZZ_new(number[] elems);
+ public static native long LDKCVec_APIErrorZ_new(number[] elems);
public static native long LDKCVec_ChannelDetailsZ_new(number[] elems);
+ public static class LDKPaymentSendFailure {
+ private LDKPaymentSendFailure() {}
+ export class ParameterError extends LDKPaymentSendFailure {
+ ParameterError() { }
+ }
+ export class PathParameterError extends LDKPaymentSendFailure {
+ PathParameterError() { }
+ }
+ export class AllFailedRetrySafe extends LDKPaymentSendFailure {
+ AllFailedRetrySafe() { }
+ }
+ export class PartialFailure extends LDKPaymentSendFailure {
+ PartialFailure() { }
+ }
+ static native void init();
+ }
+ static { LDKPaymentSendFailure.init(); }
+ public static native LDKPaymentSendFailure LDKPaymentSendFailure_ref_from_ptr(long ptr);
public static native boolean LDKCResult_NonePaymentSendFailureZ_result_ok(long arg);
public static native void LDKCResult_NonePaymentSendFailureZ_get_ok(long arg);
public static native number LDKCResult_NonePaymentSendFailureZ_get_err(long arg);
const nativeResponseValue = wasm.BroadcasterInterface_broadcast_transaction(this_arg, encodeArray(tx));
// debug statements here
}
- public static native boolean LDKCResult_ChannelKeysDecodeErrorZ_result_ok(long arg);
- public static native number LDKCResult_ChannelKeysDecodeErrorZ_get_ok(long arg);
- public static native number LDKCResult_ChannelKeysDecodeErrorZ_get_err(long arg);
+ public static native boolean LDKCResult_SignDecodeErrorZ_result_ok(long arg);
+ public static native number LDKCResult_SignDecodeErrorZ_get_ok(long arg);
+ public static native number LDKCResult_SignDecodeErrorZ_get_err(long arg);
get_node_secret (): Uint8Array;
get_destination_script (): Uint8Array;
get_shutdown_pubkey (): Uint8Array;
- get_channel_keys (inbound: boolean, channel_value_satoshis: number): number;
+ get_channel_signer (inbound: boolean, channel_value_satoshis: number): number;
get_secure_random_bytes (): Uint8Array;
read_chan_signer (reader: Uint8Array): number;
}
const nativeResponseValue = wasm.KeysInterface_get_shutdown_pubkey(this_arg);
return decodeArray(nativeResponseValue);
}
- // LDKChannelKeys KeysInterface_get_channel_keys LDKKeysInterface* this_arg, bool inbound, uint64_t channel_value_satoshis
- export function KeysInterface_get_channel_keys(this_arg: number, inbound: boolean, channel_value_satoshis: number): number {
+ // LDKSign KeysInterface_get_channel_signer LDKKeysInterface* this_arg, bool inbound, uint64_t channel_value_satoshis
+ export function KeysInterface_get_channel_signer(this_arg: number, inbound: boolean, channel_value_satoshis: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.KeysInterface_get_channel_keys(this_arg, inbound, channel_value_satoshis);
+ const nativeResponseValue = wasm.KeysInterface_get_channel_signer(this_arg, inbound, channel_value_satoshis);
return nativeResponseValue;
}
// LDKThirtyTwoBytes KeysInterface_get_secure_random_bytes LDKKeysInterface* this_arg
const nativeResponseValue = wasm.KeysInterface_get_secure_random_bytes(this_arg);
return decodeArray(nativeResponseValue);
}
- // LDKCResult_ChannelKeysDecodeErrorZ KeysInterface_read_chan_signer LDKKeysInterface* this_arg, struct LDKu8slice reader
+ // LDKCResult_SignDecodeErrorZ KeysInterface_read_chan_signer LDKKeysInterface* this_arg, struct LDKu8slice reader
export function KeysInterface_read_chan_signer(this_arg: number, reader: Uint8Array): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
public static native boolean LDKCResult_SpendableOutputDescriptorDecodeErrorZ_result_ok(long arg);
public static native number LDKCResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(long arg);
public static native number LDKCResult_SpendableOutputDescriptorDecodeErrorZ_get_err(long arg);
- public static native boolean LDKCResult_InMemoryChannelKeysDecodeErrorZ_result_ok(long arg);
- public static native number LDKCResult_InMemoryChannelKeysDecodeErrorZ_get_ok(long arg);
- public static native number LDKCResult_InMemoryChannelKeysDecodeErrorZ_get_err(long arg);
+ public static native boolean LDKCResult_CVec_CVec_u8ZZNoneZ_result_ok(long arg);
+ public static native Uint8Array[] LDKCResult_CVec_CVec_u8ZZNoneZ_get_ok(long arg);
+ public static native void LDKCResult_CVec_CVec_u8ZZNoneZ_get_err(long arg);
+ public static native boolean LDKCResult_InMemorySignerDecodeErrorZ_result_ok(long arg);
+ public static native number LDKCResult_InMemorySignerDecodeErrorZ_get_ok(long arg);
+ public static native number LDKCResult_InMemorySignerDecodeErrorZ_get_err(long arg);
+ public static native long LDKCVec_TxOutZ_new(number[] elems);
+ public static native boolean LDKCResult_TransactionNoneZ_result_ok(long arg);
+ public static native Uint8Array LDKCResult_TransactionNoneZ_get_ok(long arg);
+ public static native void LDKCResult_TransactionNoneZ_get_err(long arg);
public static native long LDKCVec_RouteHopZ_new(number[] elems);
public static native boolean LDKCResult_RouteDecodeErrorZ_result_ok(long arg);
public static native number LDKCResult_RouteDecodeErrorZ_get_ok(long arg);
+// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START
+
+ export interface LDKListen {
+ block_connected (block: Uint8Array, height: number): void;
+ block_disconnected (header: Uint8Array, height: number): void;
+ }
+
+ export function LDKListen_new(impl: LDKListen): number {
+ throw new Error('unimplemented'); // TODO: bind to WASM
+ }
+
+// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END
+
+
+ // void Listen_block_connected LDKListen* this_arg, struct LDKu8slice block, uint32_t height
+ export function Listen_block_connected(this_arg: number, block: Uint8Array, height: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.Listen_block_connected(this_arg, encodeArray(block), height);
+ // debug statements here
+ }
+ // void Listen_block_disconnected LDKListen* this_arg, const uint8_t (*header)[80], uint32_t height
+ export function Listen_block_disconnected(this_arg: number, header: Uint8Array, height: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.Listen_block_disconnected(this_arg, encodeArray(header), height);
+ // debug statements here
+ }
+
+
+
// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START
export interface LDKFilter {
handle_funding_created (their_node_id: Uint8Array, msg: number): void;
handle_funding_signed (their_node_id: Uint8Array, msg: number): void;
handle_funding_locked (their_node_id: Uint8Array, msg: number): void;
- handle_shutdown (their_node_id: Uint8Array, msg: number): void;
+ handle_shutdown (their_node_id: Uint8Array, their_features: number, msg: number): void;
handle_closing_signed (their_node_id: Uint8Array, msg: number): void;
handle_update_add_htlc (their_node_id: Uint8Array, msg: number): void;
handle_update_fulfill_htlc (their_node_id: Uint8Array, msg: number): void;
const nativeResponseValue = wasm.ChannelMessageHandler_handle_funding_locked(this_arg, encodeArray(their_node_id), msg);
// debug statements here
}
- // void ChannelMessageHandler_handle_shutdown LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKShutdown *NONNULL_PTR msg
- export function ChannelMessageHandler_handle_shutdown(this_arg: number, their_node_id: Uint8Array, msg: number): void {
+ // void ChannelMessageHandler_handle_shutdown LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKInitFeatures *NONNULL_PTR their_features, const struct LDKShutdown *NONNULL_PTR msg
+ export function ChannelMessageHandler_handle_shutdown(this_arg: number, their_node_id: Uint8Array, their_features: number, msg: number): void {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.ChannelMessageHandler_handle_shutdown(this_arg, encodeArray(their_node_id), msg);
+ const nativeResponseValue = wasm.ChannelMessageHandler_handle_shutdown(this_arg, encodeArray(their_node_id), their_features, msg);
// debug statements here
}
// void ChannelMessageHandler_handle_closing_signed LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg
const nativeResponseValue = wasm.CResult_ChannelInfoDecodeErrorZ_free(_res);
// debug statements here
}
+ // struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR orig);
+ export function CResult_ChannelInfoDecodeErrorZ_clone(orig: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_ChannelInfoDecodeErrorZ_clone(orig);
+ return nativeResponseValue;
+ }
// struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o);
export function CResult_RoutingFeesDecodeErrorZ_ok(o: number): number {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.CResult_NetworkGraphDecodeErrorZ_free(_res);
// debug statements here
}
+ // struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_clone(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR orig);
+ export function CResult_NetworkGraphDecodeErrorZ_clone(orig: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_NetworkGraphDecodeErrorZ_clone(orig);
+ return nativeResponseValue;
+ }
// struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b);
export function C2Tuple_usizeTransactionZ_new(a: number, b: Uint8Array): number {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.CResult_NoneAPIErrorZ_clone(orig);
return nativeResponseValue;
}
+ // void CVec_CResult_NoneAPIErrorZZ_free(struct LDKCVec_CResult_NoneAPIErrorZZ _res);
+ export function CVec_CResult_NoneAPIErrorZZ_free(_res: number[]): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CVec_CResult_NoneAPIErrorZZ_free(_res);
+ // debug statements here
+ }
+ // void CVec_APIErrorZ_free(struct LDKCVec_APIErrorZ _res);
+ export function CVec_APIErrorZ_free(_res: number[]): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CVec_APIErrorZ_free(_res);
+ // debug statements here
+ }
// void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res);
export function CVec_ChannelDetailsZ_free(_res: number[]): void {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(_res);
// debug statements here
}
- // struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_clone(const struct LDKC2Tuple_u64u64Z *NONNULL_PTR orig);
- export function C2Tuple_u64u64Z_clone(orig: number): number {
- if(!isWasmInitialized) {
- throw new Error("initializeWasm() must be awaited first!");
- }
- const nativeResponseValue = wasm.C2Tuple_u64u64Z_clone(orig);
- return nativeResponseValue;
- }
- // struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_new(uint64_t a, uint64_t b);
- export function C2Tuple_u64u64Z_new(a: number, b: number): number {
- if(!isWasmInitialized) {
- throw new Error("initializeWasm() must be awaited first!");
- }
- const nativeResponseValue = wasm.C2Tuple_u64u64Z_new(a, b);
- return nativeResponseValue;
- }
- // void C2Tuple_u64u64Z_free(struct LDKC2Tuple_u64u64Z _res);
- export function C2Tuple_u64u64Z_free(_res: number): void {
- if(!isWasmInitialized) {
- throw new Error("initializeWasm() must be awaited first!");
- }
- const nativeResponseValue = wasm.C2Tuple_u64u64Z_free(_res);
- // debug statements here
- }
// struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o);
export function CResult_SpendableOutputDescriptorDecodeErrorZ_ok(o: number): number {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.CResult_SignatureNoneZ_clone(orig);
return nativeResponseValue;
}
- // struct LDKCResult_ChannelKeysDecodeErrorZ CResult_ChannelKeysDecodeErrorZ_ok(struct LDKChannelKeys o);
- export function CResult_ChannelKeysDecodeErrorZ_ok(o: number): number {
+ // struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_ok(struct LDKSign o);
+ export function CResult_SignDecodeErrorZ_ok(o: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_SignDecodeErrorZ_ok(o);
+ return nativeResponseValue;
+ }
+ // struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_err(struct LDKDecodeError e);
+ export function CResult_SignDecodeErrorZ_err(e: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_SignDecodeErrorZ_err(e);
+ return nativeResponseValue;
+ }
+ // void CResult_SignDecodeErrorZ_free(struct LDKCResult_SignDecodeErrorZ _res);
+ export function CResult_SignDecodeErrorZ_free(_res: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_SignDecodeErrorZ_free(_res);
+ // debug statements here
+ }
+ // struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_clone(const struct LDKCResult_SignDecodeErrorZ *NONNULL_PTR orig);
+ export function CResult_SignDecodeErrorZ_clone(orig: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_SignDecodeErrorZ_clone(orig);
+ return nativeResponseValue;
+ }
+ // void CVec_CVec_u8ZZ_free(struct LDKCVec_CVec_u8ZZ _res);
+ export function CVec_CVec_u8ZZ_free(_res: Uint8Array[]): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CVec_CVec_u8ZZ_free(_res);
+ // debug statements here
+ }
+ // struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_ok(struct LDKCVec_CVec_u8ZZ o);
+ export function CResult_CVec_CVec_u8ZZNoneZ_ok(o: Uint8Array[]): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.CResult_ChannelKeysDecodeErrorZ_ok(o);
+ const nativeResponseValue = wasm.CResult_CVec_CVec_u8ZZNoneZ_ok(o);
return nativeResponseValue;
}
- // struct LDKCResult_ChannelKeysDecodeErrorZ CResult_ChannelKeysDecodeErrorZ_err(struct LDKDecodeError e);
- export function CResult_ChannelKeysDecodeErrorZ_err(e: number): number {
+ // struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_err(void);
+ export function CResult_CVec_CVec_u8ZZNoneZ_err(): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.CResult_ChannelKeysDecodeErrorZ_err(e);
+ const nativeResponseValue = wasm.CResult_CVec_CVec_u8ZZNoneZ_err();
return nativeResponseValue;
}
- // void CResult_ChannelKeysDecodeErrorZ_free(struct LDKCResult_ChannelKeysDecodeErrorZ _res);
- export function CResult_ChannelKeysDecodeErrorZ_free(_res: number): void {
+ // void CResult_CVec_CVec_u8ZZNoneZ_free(struct LDKCResult_CVec_CVec_u8ZZNoneZ _res);
+ export function CResult_CVec_CVec_u8ZZNoneZ_free(_res: number): void {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.CResult_ChannelKeysDecodeErrorZ_free(_res);
+ const nativeResponseValue = wasm.CResult_CVec_CVec_u8ZZNoneZ_free(_res);
// debug statements here
}
- // struct LDKCResult_ChannelKeysDecodeErrorZ CResult_ChannelKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelKeysDecodeErrorZ *NONNULL_PTR orig);
- export function CResult_ChannelKeysDecodeErrorZ_clone(orig: number): number {
+ // struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_clone(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR orig);
+ export function CResult_CVec_CVec_u8ZZNoneZ_clone(orig: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.CResult_ChannelKeysDecodeErrorZ_clone(orig);
+ const nativeResponseValue = wasm.CResult_CVec_CVec_u8ZZNoneZ_clone(orig);
return nativeResponseValue;
}
- // struct LDKCResult_InMemoryChannelKeysDecodeErrorZ CResult_InMemoryChannelKeysDecodeErrorZ_ok(struct LDKInMemoryChannelKeys o);
- export function CResult_InMemoryChannelKeysDecodeErrorZ_ok(o: number): number {
+ // struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_ok(struct LDKInMemorySigner o);
+ export function CResult_InMemorySignerDecodeErrorZ_ok(o: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.CResult_InMemoryChannelKeysDecodeErrorZ_ok(o);
+ const nativeResponseValue = wasm.CResult_InMemorySignerDecodeErrorZ_ok(o);
return nativeResponseValue;
}
- // struct LDKCResult_InMemoryChannelKeysDecodeErrorZ CResult_InMemoryChannelKeysDecodeErrorZ_err(struct LDKDecodeError e);
- export function CResult_InMemoryChannelKeysDecodeErrorZ_err(e: number): number {
+ // struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_err(struct LDKDecodeError e);
+ export function CResult_InMemorySignerDecodeErrorZ_err(e: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.CResult_InMemoryChannelKeysDecodeErrorZ_err(e);
+ const nativeResponseValue = wasm.CResult_InMemorySignerDecodeErrorZ_err(e);
return nativeResponseValue;
}
- // void CResult_InMemoryChannelKeysDecodeErrorZ_free(struct LDKCResult_InMemoryChannelKeysDecodeErrorZ _res);
- export function CResult_InMemoryChannelKeysDecodeErrorZ_free(_res: number): void {
+ // void CResult_InMemorySignerDecodeErrorZ_free(struct LDKCResult_InMemorySignerDecodeErrorZ _res);
+ export function CResult_InMemorySignerDecodeErrorZ_free(_res: number): void {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.CResult_InMemoryChannelKeysDecodeErrorZ_free(_res);
+ const nativeResponseValue = wasm.CResult_InMemorySignerDecodeErrorZ_free(_res);
// debug statements here
}
- // struct LDKCResult_InMemoryChannelKeysDecodeErrorZ CResult_InMemoryChannelKeysDecodeErrorZ_clone(const struct LDKCResult_InMemoryChannelKeysDecodeErrorZ *NONNULL_PTR orig);
- export function CResult_InMemoryChannelKeysDecodeErrorZ_clone(orig: number): number {
+ // struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_clone(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR orig);
+ export function CResult_InMemorySignerDecodeErrorZ_clone(orig: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_InMemorySignerDecodeErrorZ_clone(orig);
+ return nativeResponseValue;
+ }
+ // void CVec_TxOutZ_free(struct LDKCVec_TxOutZ _res);
+ export function CVec_TxOutZ_free(_res: number[]): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CVec_TxOutZ_free(_res);
+ // debug statements here
+ }
+ // struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_ok(struct LDKTransaction o);
+ export function CResult_TransactionNoneZ_ok(o: Uint8Array): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_TransactionNoneZ_ok(encodeArray(o));
+ return nativeResponseValue;
+ }
+ // struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_err(void);
+ export function CResult_TransactionNoneZ_err(): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.CResult_InMemoryChannelKeysDecodeErrorZ_clone(orig);
+ const nativeResponseValue = wasm.CResult_TransactionNoneZ_err();
return nativeResponseValue;
}
+ // void CResult_TransactionNoneZ_free(struct LDKCResult_TransactionNoneZ _res);
+ export function CResult_TransactionNoneZ_free(_res: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_TransactionNoneZ_free(_res);
+ // debug statements here
+ }
// void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res);
export function CVec_RouteHopZ_free(_res: number[]): void {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.Access_free(this_ptr);
// debug statements here
}
+ // void Listen_free(struct LDKListen this_ptr);
+ export function Listen_free(this_ptr: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.Listen_free(this_ptr);
+ // debug statements here
+ }
// void Watch_free(struct LDKWatch this_ptr);
export function Watch_free(this_ptr: number): void {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.OutPoint_read(encodeArray(ser));
return nativeResponseValue;
}
+ // void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_ptr);
+ export function DelayedPaymentOutputDescriptor_free(this_ptr: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.DelayedPaymentOutputDescriptor_free(this_ptr);
+ // debug statements here
+ }
+ // struct LDKOutPoint DelayedPaymentOutputDescriptor_get_outpoint(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
+ export function DelayedPaymentOutputDescriptor_get_outpoint(this_ptr: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.DelayedPaymentOutputDescriptor_get_outpoint(this_ptr);
+ return nativeResponseValue;
+ }
+ // void DelayedPaymentOutputDescriptor_set_outpoint(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
+ export function DelayedPaymentOutputDescriptor_set_outpoint(this_ptr: number, val: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.DelayedPaymentOutputDescriptor_set_outpoint(this_ptr, val);
+ // debug statements here
+ }
+ // struct LDKPublicKey DelayedPaymentOutputDescriptor_get_per_commitment_point(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
+ export function DelayedPaymentOutputDescriptor_get_per_commitment_point(this_ptr: number): Uint8Array {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.DelayedPaymentOutputDescriptor_get_per_commitment_point(this_ptr);
+ return decodeArray(nativeResponseValue);
+ }
+ // void DelayedPaymentOutputDescriptor_set_per_commitment_point(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+ export function DelayedPaymentOutputDescriptor_set_per_commitment_point(this_ptr: number, val: Uint8Array): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.DelayedPaymentOutputDescriptor_set_per_commitment_point(this_ptr, encodeArray(val));
+ // debug statements here
+ }
+ // uint16_t DelayedPaymentOutputDescriptor_get_to_self_delay(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
+ export function DelayedPaymentOutputDescriptor_get_to_self_delay(this_ptr: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.DelayedPaymentOutputDescriptor_get_to_self_delay(this_ptr);
+ return nativeResponseValue;
+ }
+ // void DelayedPaymentOutputDescriptor_set_to_self_delay(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint16_t val);
+ export function DelayedPaymentOutputDescriptor_set_to_self_delay(this_ptr: number, val: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.DelayedPaymentOutputDescriptor_set_to_self_delay(this_ptr, val);
+ // debug statements here
+ }
+ // void DelayedPaymentOutputDescriptor_set_output(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
+ export function DelayedPaymentOutputDescriptor_set_output(this_ptr: number, val: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.DelayedPaymentOutputDescriptor_set_output(this_ptr, val);
+ // debug statements here
+ }
+ // struct LDKPublicKey DelayedPaymentOutputDescriptor_get_revocation_pubkey(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
+ export function DelayedPaymentOutputDescriptor_get_revocation_pubkey(this_ptr: number): Uint8Array {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.DelayedPaymentOutputDescriptor_get_revocation_pubkey(this_ptr);
+ return decodeArray(nativeResponseValue);
+ }
+ // void DelayedPaymentOutputDescriptor_set_revocation_pubkey(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+ export function DelayedPaymentOutputDescriptor_set_revocation_pubkey(this_ptr: number, val: Uint8Array): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.DelayedPaymentOutputDescriptor_set_revocation_pubkey(this_ptr, encodeArray(val));
+ // debug statements here
+ }
+ // const uint8_t (*DelayedPaymentOutputDescriptor_get_channel_keys_id(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
+ export function DelayedPaymentOutputDescriptor_get_channel_keys_id(this_ptr: number): Uint8Array {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.DelayedPaymentOutputDescriptor_get_channel_keys_id(this_ptr);
+ return decodeArray(nativeResponseValue);
+ }
+ // void DelayedPaymentOutputDescriptor_set_channel_keys_id(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+ export function DelayedPaymentOutputDescriptor_set_channel_keys_id(this_ptr: number, val: Uint8Array): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.DelayedPaymentOutputDescriptor_set_channel_keys_id(this_ptr, encodeArray(val));
+ // debug statements here
+ }
+ // uint64_t DelayedPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
+ export function DelayedPaymentOutputDescriptor_get_channel_value_satoshis(this_ptr: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.DelayedPaymentOutputDescriptor_get_channel_value_satoshis(this_ptr);
+ return nativeResponseValue;
+ }
+ // void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
+ export function DelayedPaymentOutputDescriptor_set_channel_value_satoshis(this_ptr: number, val: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.DelayedPaymentOutputDescriptor_set_channel_value_satoshis(this_ptr, val);
+ // debug statements here
+ }
+ // MUST_USE_RES struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_new(struct LDKOutPoint outpoint_arg, struct LDKPublicKey per_commitment_point_arg, uint16_t to_self_delay_arg, struct LDKTxOut output_arg, struct LDKPublicKey revocation_pubkey_arg, struct LDKThirtyTwoBytes channel_keys_id_arg, uint64_t channel_value_satoshis_arg);
+ export function DelayedPaymentOutputDescriptor_new(outpoint_arg: number, per_commitment_point_arg: Uint8Array, to_self_delay_arg: number, output_arg: number, revocation_pubkey_arg: Uint8Array, channel_keys_id_arg: Uint8Array, channel_value_satoshis_arg: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.DelayedPaymentOutputDescriptor_new(outpoint_arg, encodeArray(per_commitment_point_arg), to_self_delay_arg, output_arg, encodeArray(revocation_pubkey_arg), encodeArray(channel_keys_id_arg), channel_value_satoshis_arg);
+ return nativeResponseValue;
+ }
+ // struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig);
+ export function DelayedPaymentOutputDescriptor_clone(orig: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.DelayedPaymentOutputDescriptor_clone(orig);
+ return nativeResponseValue;
+ }
+ // void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_ptr);
+ export function StaticPaymentOutputDescriptor_free(this_ptr: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.StaticPaymentOutputDescriptor_free(this_ptr);
+ // debug statements here
+ }
+ // struct LDKOutPoint StaticPaymentOutputDescriptor_get_outpoint(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
+ export function StaticPaymentOutputDescriptor_get_outpoint(this_ptr: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.StaticPaymentOutputDescriptor_get_outpoint(this_ptr);
+ return nativeResponseValue;
+ }
+ // void StaticPaymentOutputDescriptor_set_outpoint(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
+ export function StaticPaymentOutputDescriptor_set_outpoint(this_ptr: number, val: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.StaticPaymentOutputDescriptor_set_outpoint(this_ptr, val);
+ // debug statements here
+ }
+ // void StaticPaymentOutputDescriptor_set_output(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
+ export function StaticPaymentOutputDescriptor_set_output(this_ptr: number, val: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.StaticPaymentOutputDescriptor_set_output(this_ptr, val);
+ // debug statements here
+ }
+ // const uint8_t (*StaticPaymentOutputDescriptor_get_channel_keys_id(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
+ export function StaticPaymentOutputDescriptor_get_channel_keys_id(this_ptr: number): Uint8Array {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.StaticPaymentOutputDescriptor_get_channel_keys_id(this_ptr);
+ return decodeArray(nativeResponseValue);
+ }
+ // void StaticPaymentOutputDescriptor_set_channel_keys_id(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+ export function StaticPaymentOutputDescriptor_set_channel_keys_id(this_ptr: number, val: Uint8Array): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.StaticPaymentOutputDescriptor_set_channel_keys_id(this_ptr, encodeArray(val));
+ // debug statements here
+ }
+ // uint64_t StaticPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
+ export function StaticPaymentOutputDescriptor_get_channel_value_satoshis(this_ptr: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.StaticPaymentOutputDescriptor_get_channel_value_satoshis(this_ptr);
+ return nativeResponseValue;
+ }
+ // void StaticPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
+ export function StaticPaymentOutputDescriptor_set_channel_value_satoshis(this_ptr: number, val: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.StaticPaymentOutputDescriptor_set_channel_value_satoshis(this_ptr, val);
+ // debug statements here
+ }
+ // MUST_USE_RES struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_new(struct LDKOutPoint outpoint_arg, struct LDKTxOut output_arg, struct LDKThirtyTwoBytes channel_keys_id_arg, uint64_t channel_value_satoshis_arg);
+ export function StaticPaymentOutputDescriptor_new(outpoint_arg: number, output_arg: number, channel_keys_id_arg: Uint8Array, channel_value_satoshis_arg: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.StaticPaymentOutputDescriptor_new(outpoint_arg, output_arg, encodeArray(channel_keys_id_arg), channel_value_satoshis_arg);
+ return nativeResponseValue;
+ }
+ // struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig);
+ export function StaticPaymentOutputDescriptor_clone(orig: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.StaticPaymentOutputDescriptor_clone(orig);
+ return nativeResponseValue;
+ }
// void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr);
export function SpendableOutputDescriptor_free(this_ptr: number): void {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.SpendableOutputDescriptor_read(encodeArray(ser));
return nativeResponseValue;
}
- // struct LDKChannelKeys ChannelKeys_clone(const struct LDKChannelKeys *NONNULL_PTR orig);
- export function ChannelKeys_clone(orig: number): number {
+ // struct LDKSign Sign_clone(const struct LDKSign *NONNULL_PTR orig);
+ export function Sign_clone(orig: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.ChannelKeys_clone(orig);
+ const nativeResponseValue = wasm.Sign_clone(orig);
return nativeResponseValue;
}
- // void ChannelKeys_free(struct LDKChannelKeys this_ptr);
- export function ChannelKeys_free(this_ptr: number): void {
+ // void Sign_free(struct LDKSign this_ptr);
+ export function Sign_free(this_ptr: number): void {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.ChannelKeys_free(this_ptr);
+ const nativeResponseValue = wasm.Sign_free(this_ptr);
// debug statements here
}
// void KeysInterface_free(struct LDKKeysInterface this_ptr);
const nativeResponseValue = wasm.KeysInterface_free(this_ptr);
// debug statements here
}
- // void InMemoryChannelKeys_free(struct LDKInMemoryChannelKeys this_ptr);
- export function InMemoryChannelKeys_free(this_ptr: number): void {
+ // void InMemorySigner_free(struct LDKInMemorySigner this_ptr);
+ export function InMemorySigner_free(this_ptr: number): void {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.InMemoryChannelKeys_free(this_ptr);
+ const nativeResponseValue = wasm.InMemorySigner_free(this_ptr);
// debug statements here
}
- // const uint8_t (*InMemoryChannelKeys_get_funding_key(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr))[32];
- export function InMemoryChannelKeys_get_funding_key(this_ptr: number): Uint8Array {
+ // const uint8_t (*InMemorySigner_get_funding_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
+ export function InMemorySigner_get_funding_key(this_ptr: number): Uint8Array {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.InMemoryChannelKeys_get_funding_key(this_ptr);
+ const nativeResponseValue = wasm.InMemorySigner_get_funding_key(this_ptr);
return decodeArray(nativeResponseValue);
}
- // void InMemoryChannelKeys_set_funding_key(struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr, struct LDKSecretKey val);
- export function InMemoryChannelKeys_set_funding_key(this_ptr: number, val: Uint8Array): void {
+ // void InMemorySigner_set_funding_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
+ export function InMemorySigner_set_funding_key(this_ptr: number, val: Uint8Array): void {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.InMemoryChannelKeys_set_funding_key(this_ptr, encodeArray(val));
+ const nativeResponseValue = wasm.InMemorySigner_set_funding_key(this_ptr, encodeArray(val));
// debug statements here
}
- // const uint8_t (*InMemoryChannelKeys_get_revocation_base_key(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr))[32];
- export function InMemoryChannelKeys_get_revocation_base_key(this_ptr: number): Uint8Array {
+ // const uint8_t (*InMemorySigner_get_revocation_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
+ export function InMemorySigner_get_revocation_base_key(this_ptr: number): Uint8Array {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.InMemoryChannelKeys_get_revocation_base_key(this_ptr);
+ const nativeResponseValue = wasm.InMemorySigner_get_revocation_base_key(this_ptr);
return decodeArray(nativeResponseValue);
}
- // void InMemoryChannelKeys_set_revocation_base_key(struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr, struct LDKSecretKey val);
- export function InMemoryChannelKeys_set_revocation_base_key(this_ptr: number, val: Uint8Array): void {
+ // void InMemorySigner_set_revocation_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
+ export function InMemorySigner_set_revocation_base_key(this_ptr: number, val: Uint8Array): void {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.InMemoryChannelKeys_set_revocation_base_key(this_ptr, encodeArray(val));
+ const nativeResponseValue = wasm.InMemorySigner_set_revocation_base_key(this_ptr, encodeArray(val));
// debug statements here
}
- // const uint8_t (*InMemoryChannelKeys_get_payment_key(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr))[32];
- export function InMemoryChannelKeys_get_payment_key(this_ptr: number): Uint8Array {
+ // const uint8_t (*InMemorySigner_get_payment_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
+ export function InMemorySigner_get_payment_key(this_ptr: number): Uint8Array {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.InMemoryChannelKeys_get_payment_key(this_ptr);
+ const nativeResponseValue = wasm.InMemorySigner_get_payment_key(this_ptr);
return decodeArray(nativeResponseValue);
}
- // void InMemoryChannelKeys_set_payment_key(struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr, struct LDKSecretKey val);
- export function InMemoryChannelKeys_set_payment_key(this_ptr: number, val: Uint8Array): void {
+ // void InMemorySigner_set_payment_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
+ export function InMemorySigner_set_payment_key(this_ptr: number, val: Uint8Array): void {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.InMemoryChannelKeys_set_payment_key(this_ptr, encodeArray(val));
+ const nativeResponseValue = wasm.InMemorySigner_set_payment_key(this_ptr, encodeArray(val));
// debug statements here
}
- // const uint8_t (*InMemoryChannelKeys_get_delayed_payment_base_key(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr))[32];
- export function InMemoryChannelKeys_get_delayed_payment_base_key(this_ptr: number): Uint8Array {
+ // const uint8_t (*InMemorySigner_get_delayed_payment_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
+ export function InMemorySigner_get_delayed_payment_base_key(this_ptr: number): Uint8Array {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.InMemoryChannelKeys_get_delayed_payment_base_key(this_ptr);
+ const nativeResponseValue = wasm.InMemorySigner_get_delayed_payment_base_key(this_ptr);
return decodeArray(nativeResponseValue);
}
- // void InMemoryChannelKeys_set_delayed_payment_base_key(struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr, struct LDKSecretKey val);
- export function InMemoryChannelKeys_set_delayed_payment_base_key(this_ptr: number, val: Uint8Array): void {
+ // void InMemorySigner_set_delayed_payment_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
+ export function InMemorySigner_set_delayed_payment_base_key(this_ptr: number, val: Uint8Array): void {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.InMemoryChannelKeys_set_delayed_payment_base_key(this_ptr, encodeArray(val));
+ const nativeResponseValue = wasm.InMemorySigner_set_delayed_payment_base_key(this_ptr, encodeArray(val));
// debug statements here
}
- // const uint8_t (*InMemoryChannelKeys_get_htlc_base_key(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr))[32];
- export function InMemoryChannelKeys_get_htlc_base_key(this_ptr: number): Uint8Array {
+ // const uint8_t (*InMemorySigner_get_htlc_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
+ export function InMemorySigner_get_htlc_base_key(this_ptr: number): Uint8Array {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.InMemoryChannelKeys_get_htlc_base_key(this_ptr);
+ const nativeResponseValue = wasm.InMemorySigner_get_htlc_base_key(this_ptr);
return decodeArray(nativeResponseValue);
}
- // void InMemoryChannelKeys_set_htlc_base_key(struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr, struct LDKSecretKey val);
- export function InMemoryChannelKeys_set_htlc_base_key(this_ptr: number, val: Uint8Array): void {
+ // void InMemorySigner_set_htlc_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
+ export function InMemorySigner_set_htlc_base_key(this_ptr: number, val: Uint8Array): void {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.InMemoryChannelKeys_set_htlc_base_key(this_ptr, encodeArray(val));
+ const nativeResponseValue = wasm.InMemorySigner_set_htlc_base_key(this_ptr, encodeArray(val));
// debug statements here
}
- // const uint8_t (*InMemoryChannelKeys_get_commitment_seed(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr))[32];
- export function InMemoryChannelKeys_get_commitment_seed(this_ptr: number): Uint8Array {
+ // const uint8_t (*InMemorySigner_get_commitment_seed(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
+ export function InMemorySigner_get_commitment_seed(this_ptr: number): Uint8Array {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.InMemoryChannelKeys_get_commitment_seed(this_ptr);
+ const nativeResponseValue = wasm.InMemorySigner_get_commitment_seed(this_ptr);
return decodeArray(nativeResponseValue);
}
- // void InMemoryChannelKeys_set_commitment_seed(struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
- export function InMemoryChannelKeys_set_commitment_seed(this_ptr: number, val: Uint8Array): void {
+ // void InMemorySigner_set_commitment_seed(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+ export function InMemorySigner_set_commitment_seed(this_ptr: number, val: Uint8Array): void {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.InMemoryChannelKeys_set_commitment_seed(this_ptr, encodeArray(val));
+ const nativeResponseValue = wasm.InMemorySigner_set_commitment_seed(this_ptr, encodeArray(val));
// debug statements here
}
- // struct LDKInMemoryChannelKeys InMemoryChannelKeys_clone(const struct LDKInMemoryChannelKeys *NONNULL_PTR orig);
- export function InMemoryChannelKeys_clone(orig: number): number {
+ // struct LDKInMemorySigner InMemorySigner_clone(const struct LDKInMemorySigner *NONNULL_PTR orig);
+ export function InMemorySigner_clone(orig: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.InMemoryChannelKeys_clone(orig);
+ const nativeResponseValue = wasm.InMemorySigner_clone(orig);
return nativeResponseValue;
}
- // MUST_USE_RES struct LDKInMemoryChannelKeys InMemoryChannelKeys_new(struct LDKSecretKey funding_key, struct LDKSecretKey revocation_base_key, struct LDKSecretKey payment_key, struct LDKSecretKey delayed_payment_base_key, struct LDKSecretKey htlc_base_key, struct LDKThirtyTwoBytes commitment_seed, uint64_t channel_value_satoshis, struct LDKC2Tuple_u64u64Z key_derivation_params);
- export function InMemoryChannelKeys_new(funding_key: Uint8Array, revocation_base_key: Uint8Array, payment_key: Uint8Array, delayed_payment_base_key: Uint8Array, htlc_base_key: Uint8Array, commitment_seed: Uint8Array, channel_value_satoshis: number, key_derivation_params: number): number {
+ // MUST_USE_RES struct LDKInMemorySigner InMemorySigner_new(struct LDKSecretKey funding_key, struct LDKSecretKey revocation_base_key, struct LDKSecretKey payment_key, struct LDKSecretKey delayed_payment_base_key, struct LDKSecretKey htlc_base_key, struct LDKThirtyTwoBytes commitment_seed, uint64_t channel_value_satoshis, struct LDKThirtyTwoBytes channel_keys_id);
+ export function InMemorySigner_new(funding_key: Uint8Array, revocation_base_key: Uint8Array, payment_key: Uint8Array, delayed_payment_base_key: Uint8Array, htlc_base_key: Uint8Array, commitment_seed: Uint8Array, channel_value_satoshis: number, channel_keys_id: Uint8Array): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.InMemoryChannelKeys_new(encodeArray(funding_key), encodeArray(revocation_base_key), encodeArray(payment_key), encodeArray(delayed_payment_base_key), encodeArray(htlc_base_key), encodeArray(commitment_seed), channel_value_satoshis, key_derivation_params);
+ const nativeResponseValue = wasm.InMemorySigner_new(encodeArray(funding_key), encodeArray(revocation_base_key), encodeArray(payment_key), encodeArray(delayed_payment_base_key), encodeArray(htlc_base_key), encodeArray(commitment_seed), channel_value_satoshis, encodeArray(channel_keys_id));
return nativeResponseValue;
}
- // MUST_USE_RES struct LDKChannelPublicKeys InMemoryChannelKeys_counterparty_pubkeys(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_arg);
- export function InMemoryChannelKeys_counterparty_pubkeys(this_arg: number): number {
+ // MUST_USE_RES struct LDKChannelPublicKeys InMemorySigner_counterparty_pubkeys(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
+ export function InMemorySigner_counterparty_pubkeys(this_arg: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.InMemoryChannelKeys_counterparty_pubkeys(this_arg);
+ const nativeResponseValue = wasm.InMemorySigner_counterparty_pubkeys(this_arg);
return nativeResponseValue;
}
- // MUST_USE_RES uint16_t InMemoryChannelKeys_counterparty_selected_contest_delay(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_arg);
- export function InMemoryChannelKeys_counterparty_selected_contest_delay(this_arg: number): number {
+ // MUST_USE_RES uint16_t InMemorySigner_counterparty_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
+ export function InMemorySigner_counterparty_selected_contest_delay(this_arg: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.InMemoryChannelKeys_counterparty_selected_contest_delay(this_arg);
+ const nativeResponseValue = wasm.InMemorySigner_counterparty_selected_contest_delay(this_arg);
return nativeResponseValue;
}
- // MUST_USE_RES uint16_t InMemoryChannelKeys_holder_selected_contest_delay(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_arg);
- export function InMemoryChannelKeys_holder_selected_contest_delay(this_arg: number): number {
+ // MUST_USE_RES uint16_t InMemorySigner_holder_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
+ export function InMemorySigner_holder_selected_contest_delay(this_arg: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.InMemoryChannelKeys_holder_selected_contest_delay(this_arg);
+ const nativeResponseValue = wasm.InMemorySigner_holder_selected_contest_delay(this_arg);
return nativeResponseValue;
}
- // MUST_USE_RES bool InMemoryChannelKeys_is_outbound(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_arg);
- export function InMemoryChannelKeys_is_outbound(this_arg: number): boolean {
+ // MUST_USE_RES bool InMemorySigner_is_outbound(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
+ export function InMemorySigner_is_outbound(this_arg: number): boolean {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.InMemoryChannelKeys_is_outbound(this_arg);
+ const nativeResponseValue = wasm.InMemorySigner_is_outbound(this_arg);
return nativeResponseValue;
}
- // MUST_USE_RES struct LDKOutPoint InMemoryChannelKeys_funding_outpoint(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_arg);
- export function InMemoryChannelKeys_funding_outpoint(this_arg: number): number {
+ // MUST_USE_RES struct LDKOutPoint InMemorySigner_funding_outpoint(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
+ export function InMemorySigner_funding_outpoint(this_arg: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.InMemoryChannelKeys_funding_outpoint(this_arg);
+ const nativeResponseValue = wasm.InMemorySigner_funding_outpoint(this_arg);
return nativeResponseValue;
}
- // MUST_USE_RES struct LDKChannelTransactionParameters InMemoryChannelKeys_get_channel_parameters(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_arg);
- export function InMemoryChannelKeys_get_channel_parameters(this_arg: number): number {
+ // MUST_USE_RES struct LDKChannelTransactionParameters InMemorySigner_get_channel_parameters(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
+ export function InMemorySigner_get_channel_parameters(this_arg: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.InMemoryChannelKeys_get_channel_parameters(this_arg);
+ const nativeResponseValue = wasm.InMemorySigner_get_channel_parameters(this_arg);
return nativeResponseValue;
}
- // struct LDKChannelKeys InMemoryChannelKeys_as_ChannelKeys(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_arg);
- export function InMemoryChannelKeys_as_ChannelKeys(this_arg: number): number {
+ // MUST_USE_RES struct LDKCResult_CVec_CVec_u8ZZNoneZ InMemorySigner_sign_counterparty_payment_input(const struct LDKInMemorySigner *NONNULL_PTR this_arg, struct LDKTransaction spend_tx, uintptr_t input_idx, const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR descriptor);
+ export function InMemorySigner_sign_counterparty_payment_input(this_arg: number, spend_tx: Uint8Array, input_idx: number, descriptor: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.InMemoryChannelKeys_as_ChannelKeys(this_arg);
+ const nativeResponseValue = wasm.InMemorySigner_sign_counterparty_payment_input(this_arg, encodeArray(spend_tx), input_idx, descriptor);
return nativeResponseValue;
}
- // struct LDKCVec_u8Z InMemoryChannelKeys_write(const struct LDKInMemoryChannelKeys *NONNULL_PTR obj);
- export function InMemoryChannelKeys_write(obj: number): Uint8Array {
+ // MUST_USE_RES struct LDKCResult_CVec_CVec_u8ZZNoneZ InMemorySigner_sign_dynamic_p2wsh_input(const struct LDKInMemorySigner *NONNULL_PTR this_arg, struct LDKTransaction spend_tx, uintptr_t input_idx, const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR descriptor);
+ export function InMemorySigner_sign_dynamic_p2wsh_input(this_arg: number, spend_tx: Uint8Array, input_idx: number, descriptor: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.InMemoryChannelKeys_write(obj);
+ const nativeResponseValue = wasm.InMemorySigner_sign_dynamic_p2wsh_input(this_arg, encodeArray(spend_tx), input_idx, descriptor);
+ return nativeResponseValue;
+ }
+ // struct LDKSign InMemorySigner_as_Sign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
+ export function InMemorySigner_as_Sign(this_arg: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.InMemorySigner_as_Sign(this_arg);
+ return nativeResponseValue;
+ }
+ // struct LDKCVec_u8Z InMemorySigner_write(const struct LDKInMemorySigner *NONNULL_PTR obj);
+ export function InMemorySigner_write(obj: number): Uint8Array {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.InMemorySigner_write(obj);
return decodeArray(nativeResponseValue);
}
- // struct LDKCResult_InMemoryChannelKeysDecodeErrorZ InMemoryChannelKeys_read(struct LDKu8slice ser);
- export function InMemoryChannelKeys_read(ser: Uint8Array): number {
+ // struct LDKCResult_InMemorySignerDecodeErrorZ InMemorySigner_read(struct LDKu8slice ser);
+ export function InMemorySigner_read(ser: Uint8Array): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.InMemoryChannelKeys_read(encodeArray(ser));
+ const nativeResponseValue = wasm.InMemorySigner_read(encodeArray(ser));
return nativeResponseValue;
}
// void KeysManager_free(struct LDKKeysManager this_ptr);
const nativeResponseValue = wasm.KeysManager_free(this_ptr);
// debug statements here
}
- // MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], enum LDKNetwork network, uint64_t starting_time_secs, uint32_t starting_time_nanos);
- export function KeysManager_new(seed: Uint8Array, network: LDKNetwork, starting_time_secs: number, starting_time_nanos: number): number {
+ // MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos);
+ export function KeysManager_new(seed: Uint8Array, starting_time_secs: number, starting_time_nanos: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.KeysManager_new(encodeArray(seed), starting_time_secs, starting_time_nanos);
+ return nativeResponseValue;
+ }
+ // MUST_USE_RES struct LDKInMemorySigner KeysManager_derive_channel_keys(const struct LDKKeysManager *NONNULL_PTR this_arg, uint64_t channel_value_satoshis, const uint8_t (*params)[32]);
+ export function KeysManager_derive_channel_keys(this_arg: number, channel_value_satoshis: number, params: Uint8Array): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.KeysManager_new(encodeArray(seed), network, starting_time_secs, starting_time_nanos);
+ const nativeResponseValue = wasm.KeysManager_derive_channel_keys(this_arg, channel_value_satoshis, encodeArray(params));
return nativeResponseValue;
}
- // MUST_USE_RES struct LDKInMemoryChannelKeys KeysManager_derive_channel_keys(const struct LDKKeysManager *NONNULL_PTR this_arg, uint64_t channel_value_satoshis, uint64_t params_1, uint64_t params_2);
- export function KeysManager_derive_channel_keys(this_arg: number, channel_value_satoshis: number, params_1: number, params_2: number): number {
+ // MUST_USE_RES struct LDKCResult_TransactionNoneZ KeysManager_spend_spendable_outputs(const struct LDKKeysManager *NONNULL_PTR this_arg, struct LDKCVec_SpendableOutputDescriptorZ descriptors, struct LDKCVec_TxOutZ outputs, struct LDKCVec_u8Z change_destination_script, uint32_t feerate_sat_per_1000_weight);
+ export function KeysManager_spend_spendable_outputs(this_arg: number, descriptors: number[], outputs: number[], change_destination_script: Uint8Array, feerate_sat_per_1000_weight: number): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
}
- const nativeResponseValue = wasm.KeysManager_derive_channel_keys(this_arg, channel_value_satoshis, params_1, params_2);
+ const nativeResponseValue = wasm.KeysManager_spend_spendable_outputs(this_arg, descriptors, outputs, encodeArray(change_destination_script), feerate_sat_per_1000_weight);
return nativeResponseValue;
}
// struct LDKKeysInterface KeysManager_as_KeysInterface(const struct LDKKeysManager *NONNULL_PTR this_arg);
const nativeResponseValue = wasm.ChannelManager_as_EventsProvider(this_arg);
return nativeResponseValue;
}
+ // struct LDKListen ChannelManager_as_Listen(const struct LDKChannelManager *NONNULL_PTR this_arg);
+ export function ChannelManager_as_Listen(this_arg: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.ChannelManager_as_Listen(this_arg);
+ return nativeResponseValue;
+ }
// void ChannelManager_block_connected(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
export function ChannelManager_block_connected(this_arg: number, header: Uint8Array, txdata: number[], height: number): void {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.ChannelManager_block_disconnected(this_arg, encodeArray(header));
// debug statements here
}
+ // void ChannelManager_await_persistable_update(const struct LDKChannelManager *NONNULL_PTR this_arg);
+ export function ChannelManager_await_persistable_update(this_arg: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.ChannelManager_await_persistable_update(this_arg);
+ // debug statements here
+ }
// struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
export function ChannelManager_as_ChannelMessageHandler(this_arg: number): number {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.Init_free(this_ptr);
// debug statements here
}
+ // struct LDKInitFeatures Init_get_features(const struct LDKInit *NONNULL_PTR this_ptr);
+ export function Init_get_features(this_ptr: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.Init_get_features(this_ptr);
+ return nativeResponseValue;
+ }
+ // void Init_set_features(struct LDKInit *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
+ export function Init_set_features(this_ptr: number, val: number): void {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.Init_set_features(this_ptr, val);
+ // debug statements here
+ }
+ // MUST_USE_RES struct LDKInit Init_new(struct LDKInitFeatures features_arg);
+ export function Init_new(features_arg: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.Init_new(features_arg);
+ return nativeResponseValue;
+ }
// struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig);
export function Init_clone(orig: number): number {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.NetworkGraph_free(this_ptr);
// debug statements here
}
+ // struct LDKNetworkGraph NetworkGraph_clone(const struct LDKNetworkGraph *NONNULL_PTR orig);
+ export function NetworkGraph_clone(orig: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.NetworkGraph_clone(orig);
+ return nativeResponseValue;
+ }
// void LockedNetworkGraph_free(struct LDKLockedNetworkGraph this_ptr);
export function LockedNetworkGraph_free(this_ptr: number): void {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.ChannelInfo_set_announcement_message(this_ptr, val);
// debug statements here
}
+ // struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig);
+ export function ChannelInfo_clone(orig: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.ChannelInfo_clone(orig);
+ return nativeResponseValue;
+ }
// struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj);
export function ChannelInfo_write(obj: number): Uint8Array {
if(!isWasmInitialized) {
LDKSecp256k1Error_InvalidSecretKey,
LDKSecp256k1Error_InvalidRecoveryId,
LDKSecp256k1Error_InvalidTweak,
+ LDKSecp256k1Error_TweakCheckFailed,
LDKSecp256k1Error_NotEnoughMemory,
- LDKSecp256k1Error_CallbackPanicked,
}
}
}
public void block_connected(Uint8Array header, TwoTuple<Number, Uint8Array>[] txdata, number height) {
- bindings.ChainMonitor_block_connected(this.ptr, header, Arrays.stream(txdata).map(arr_conv_30 -> bindings.C2Tuple_usizeTransactionZ_new(arr_conv_30.a, arr_conv_30.b)).toArray(number[]::new), height);
+ bindings.ChainMonitor_block_connected(this.ptr, header, Arrays.stream(txdata).map(txdata_conv_30 -> bindings.C2Tuple_usizeTransactionZ_new(txdata_conv_30.a, txdata_conv_30.b)).toArray(number[]::new), height);
/* TODO 2 TwoTuple<Number, Uint8Array> */;
}
this.ptrs_to.add(val);
}
+ public ChannelInfo clone() {
+ number ret = bindings.ChannelInfo_clone(this.ptr);
+ const ret_hu_conv: ChannelInfo = new ChannelInfo(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
public Uint8Array write() {
Uint8Array ret = bindings.ChannelInfo_write(this.ptr);
return ret;
+++ /dev/null
-
-
-import CommonBase from './CommonBase';
-import * as bindings from '../bindings' // TODO: figure out location
-
-
-
- export class ChannelKeys extends CommonBase {
-
- bindings_instance?: bindings.LDKChannelKeys;
-
- constructor(ptr?: number, arg?: bindings.LDKChannelKeys, pubkeys?: ChannelPublicKeys) {
- if (Number.isFinite(ptr)) {
- super(ptr);
- this.bindings_instance = null;
- } else {
- // TODO: private constructor instantiation
- super(bindings.LDKChannelKeys_new(arg, pubkeys == null ? 0 : pubkeys.ptr & ~1));
- this.ptrs_to.push(arg);
- this.ptrs_to.add(pubkeys);
-
- }
- }
-
- protected finalize() {
- if (this.ptr != 0) {
- bindings.ChannelKeys_free(this.ptr);
- }
- super.finalize();
- }
-
- static new_impl(arg: ChannelKeysInterface, pubkeys: ChannelPublicKeys): ChannelKeys {
- const impl_holder: LDKChannelKeysHolder = new LDKChannelKeysHolder();
- let structImplementation = <bindings.LDKChannelKeys>{
- // todo: in-line interface filling
- get_per_commitment_point (idx: number): Uint8Array {
- Uint8Array ret = arg.get_per_commitment_point(idx);
- return ret;
- },
-
- release_commitment_secret (idx: number): Uint8Array {
- Uint8Array ret = arg.release_commitment_secret(idx);
- return ret;
- },
-
- key_derivation_params (): number {
- TwoTuple<Number, Number> ret = arg.key_derivation_params();
- result: number = bindings.C2Tuple_u64u64Z_new(ret.a, ret.b);
- return result;
- },
-
- sign_counterparty_commitment (commitment_tx: number): number {
- const commitment_tx_hu_conv: CommitmentTransaction = new CommitmentTransaction(null, commitment_tx);
- Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret = arg.sign_counterparty_commitment(commitment_tx_hu_conv);
- result: number = ret != null ? ret.ptr : 0;
- return result;
- },
-
- sign_holder_commitment_and_htlcs (commitment_tx: number): number {
- const commitment_tx_hu_conv: HolderCommitmentTransaction = new HolderCommitmentTransaction(null, commitment_tx);
- Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret = arg.sign_holder_commitment_and_htlcs(commitment_tx_hu_conv);
- result: number = ret != null ? ret.ptr : 0;
- return result;
- },
-
- sign_justice_transaction (justice_tx: Uint8Array, input: number, amount: number, per_commitment_key: Uint8Array, htlc: number): number {
- const htlc_hu_conv: HTLCOutputInCommitment = new HTLCOutputInCommitment(null, htlc);
- Result_SignatureNoneZ ret = arg.sign_justice_transaction(justice_tx, input, amount, per_commitment_key, htlc_hu_conv);
- result: number = ret != null ? ret.ptr : 0;
- return result;
- },
-
- sign_counterparty_htlc_transaction (htlc_tx: Uint8Array, input: number, amount: number, per_commitment_point: Uint8Array, htlc: number): number {
- const htlc_hu_conv: HTLCOutputInCommitment = new HTLCOutputInCommitment(null, htlc);
- Result_SignatureNoneZ ret = arg.sign_counterparty_htlc_transaction(htlc_tx, input, amount, per_commitment_point, htlc_hu_conv);
- result: number = ret != null ? ret.ptr : 0;
- return result;
- },
-
- sign_closing_transaction (closing_tx: Uint8Array): number {
- Result_SignatureNoneZ ret = arg.sign_closing_transaction(closing_tx);
- result: number = ret != null ? ret.ptr : 0;
- return result;
- },
-
- sign_channel_announcement (msg: number): number {
- const msg_hu_conv: UnsignedChannelAnnouncement = new UnsignedChannelAnnouncement(null, msg);
- Result_SignatureNoneZ ret = arg.sign_channel_announcement(msg_hu_conv);
- result: number = ret != null ? ret.ptr : 0;
- return result;
- },
-
- ready_channel (channel_parameters: number): void {
- const channel_parameters_hu_conv: ChannelTransactionParameters = new ChannelTransactionParameters(null, channel_parameters);
- arg.ready_channel(channel_parameters_hu_conv);
- },
-
- write (): Uint8Array {
- Uint8Array ret = arg.write();
- return ret;
- },
-
-
- };
- impl_holder.held = new ChannelKeys (null, structImplementation, pubkeys);
- }
- }
-
- export interface ChannelKeysInterface {
- get_per_commitment_point(idx: number): Uint8Array;
- release_commitment_secret(idx: number): Uint8Array;
- key_derivation_params(): TwoTuple<Number, Number>;
- sign_counterparty_commitment(commitment_tx: CommitmentTransaction): Result_C2Tuple_SignatureCVec_SignatureZZNoneZ;
- sign_holder_commitment_and_htlcs(commitment_tx: HolderCommitmentTransaction): Result_C2Tuple_SignatureCVec_SignatureZZNoneZ;
- sign_justice_transaction(justice_tx: Uint8Array, input: number, amount: number, per_commitment_key: Uint8Array, htlc: HTLCOutputInCommitment): Result_SignatureNoneZ;
- sign_counterparty_htlc_transaction(htlc_tx: Uint8Array, input: number, amount: number, per_commitment_point: Uint8Array, htlc: HTLCOutputInCommitment): Result_SignatureNoneZ;
- sign_closing_transaction(closing_tx: Uint8Array): Result_SignatureNoneZ;
- sign_channel_announcement(msg: UnsignedChannelAnnouncement): Result_SignatureNoneZ;
- ready_channel(channel_parameters: ChannelTransactionParameters): void;
- write(): Uint8Array;
-
- }
-
- class LDKChannelKeysHolder {
- held: ChannelKeys;
- }
- public Uint8Array get_per_commitment_point(number idx) {
- Uint8Array ret = bindings.ChannelKeys_get_per_commitment_point(this.ptr, idx);
- return ret;
- }
-
- public Uint8Array release_commitment_secret(number idx) {
- Uint8Array ret = bindings.ChannelKeys_release_commitment_secret(this.ptr, idx);
- return ret;
- }
-
- public TwoTuple<Number, Number> key_derivation_params() {
- number ret = bindings.ChannelKeys_key_derivation_params(this.ptr);
- number ret_a = bindings.LDKC2Tuple_u64u64Z_get_a(ret);
- number ret_b = bindings.LDKC2Tuple_u64u64Z_get_b(ret);
- TwoTuple<Number, Number> ret_conv = new TwoTuple<Number, Number>(ret_a, ret_b, () -> {
- bindings.C2Tuple_u64u64Z_free(ret);
- });
- return ret_conv;
- }
-
- public Result_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment(CommitmentTransaction commitment_tx) {
- number ret = bindings.ChannelKeys_sign_counterparty_commitment(this.ptr, commitment_tx == null ? 0 : commitment_tx.ptr & ~1);
- Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_hu_conv = Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.constr_from_ptr(ret);
- this.ptrs_to.add(commitment_tx);
- return ret_hu_conv;
- }
-
- public Result_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htlcs(HolderCommitmentTransaction commitment_tx) {
- number ret = bindings.ChannelKeys_sign_holder_commitment_and_htlcs(this.ptr, commitment_tx == null ? 0 : commitment_tx.ptr & ~1);
- Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_hu_conv = Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.constr_from_ptr(ret);
- this.ptrs_to.add(commitment_tx);
- return ret_hu_conv;
- }
-
- public Result_SignatureNoneZ sign_justice_transaction(Uint8Array justice_tx, number input, number amount, Uint8Array per_commitment_key, HTLCOutputInCommitment htlc) {
- number ret = bindings.ChannelKeys_sign_justice_transaction(this.ptr, justice_tx, input, amount, per_commitment_key, htlc == null ? 0 : htlc.ptr & ~1);
- Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret);
- this.ptrs_to.add(htlc);
- return ret_hu_conv;
- }
-
- public Result_SignatureNoneZ sign_counterparty_htlc_transaction(Uint8Array htlc_tx, number input, number amount, Uint8Array per_commitment_point, HTLCOutputInCommitment htlc) {
- number ret = bindings.ChannelKeys_sign_counterparty_htlc_transaction(this.ptr, htlc_tx, input, amount, per_commitment_point, htlc == null ? 0 : htlc.ptr & ~1);
- Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret);
- this.ptrs_to.add(htlc);
- return ret_hu_conv;
- }
-
- public Result_SignatureNoneZ sign_closing_transaction(Uint8Array closing_tx) {
- number ret = bindings.ChannelKeys_sign_closing_transaction(this.ptr, closing_tx);
- Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret);
- return ret_hu_conv;
- }
-
- public Result_SignatureNoneZ sign_channel_announcement(UnsignedChannelAnnouncement msg) {
- number ret = bindings.ChannelKeys_sign_channel_announcement(this.ptr, msg == null ? 0 : msg.ptr & ~1);
- Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret);
- this.ptrs_to.add(msg);
- return ret_hu_conv;
- }
-
- public void ready_channel(ChannelTransactionParameters channel_parameters) {
- bindings.ChannelKeys_ready_channel(this.ptr, channel_parameters == null ? 0 : channel_parameters.ptr & ~1);
- this.ptrs_to.add(channel_parameters);
- }
-
- public Uint8Array write() {
- Uint8Array ret = bindings.ChannelKeys_write(this.ptr);
- return ret;
- }
-
- public ChannelPublicKeys get_pubkeys() {
- number ret = bindings.ChannelKeys_get_pubkeys(this.ptr);
- const ret_hu_conv: ChannelPublicKeys = new ChannelPublicKeys(null, ret);
- ret_hu_conv.ptrs_to.add(this);
- return ret_hu_conv;
- }
-
- public ChannelKeys clone() {
- number ret = bindings.ChannelKeys_clone(this.ptr);
- ChannelKeys ret_hu_conv = new ChannelKeys(null, ret);
- ret_hu_conv.ptrs_to.add(this);
- return ret_hu_conv;
- }
-
-}
public ChannelDetails[] list_channels() {
number[] ret = bindings.ChannelManager_list_channels(this.ptr);
- ChannelDetails[] arr_conv_16_arr = new ChannelDetails[ret.length];
+ ChannelDetails[] ret_conv_16_arr = new ChannelDetails[ret.length];
for (int q = 0; q < ret.length; q++) {
- number arr_conv_16 = ret[q];
- const arr_conv_16_hu_conv: ChannelDetails = new ChannelDetails(null, arr_conv_16);
- arr_conv_16_hu_conv.ptrs_to.add(this);
- arr_conv_16_arr[q] = arr_conv_16_hu_conv;
+ number ret_conv_16 = ret[q];
+ const ret_conv_16_hu_conv: ChannelDetails = new ChannelDetails(null, ret_conv_16);
+ ret_conv_16_hu_conv.ptrs_to.add(this);
+ ret_conv_16_arr[q] = ret_conv_16_hu_conv;
}
- return arr_conv_16_arr;
+ return ret_conv_16_arr;
}
public ChannelDetails[] list_usable_channels() {
number[] ret = bindings.ChannelManager_list_usable_channels(this.ptr);
- ChannelDetails[] arr_conv_16_arr = new ChannelDetails[ret.length];
+ ChannelDetails[] ret_conv_16_arr = new ChannelDetails[ret.length];
for (int q = 0; q < ret.length; q++) {
- number arr_conv_16 = ret[q];
- const arr_conv_16_hu_conv: ChannelDetails = new ChannelDetails(null, arr_conv_16);
- arr_conv_16_hu_conv.ptrs_to.add(this);
- arr_conv_16_arr[q] = arr_conv_16_hu_conv;
+ number ret_conv_16 = ret[q];
+ const ret_conv_16_hu_conv: ChannelDetails = new ChannelDetails(null, ret_conv_16);
+ ret_conv_16_hu_conv.ptrs_to.add(this);
+ ret_conv_16_arr[q] = ret_conv_16_hu_conv;
}
- return arr_conv_16_arr;
+ return ret_conv_16_arr;
}
public Result_NoneAPIErrorZ close_channel(Uint8Array channel_id) {
}
public void broadcast_node_announcement(Uint8Array rgb, Uint8Array alias, NetAddress[] addresses) {
- bindings.ChannelManager_broadcast_node_announcement(this.ptr, rgb, alias, Arrays.stream(addresses).map(arr_conv_12 -> arr_conv_12.ptr).toArray(number[]::new));
+ bindings.ChannelManager_broadcast_node_announcement(this.ptr, rgb, alias, Arrays.stream(addresses).map(addresses_conv_12 -> addresses_conv_12.ptr).toArray(number[]::new));
/* TODO 2 NetAddress */;
}
return ret_hu_conv;
}
+ public Listen as_Listen() {
+ number ret = bindings.ChannelManager_as_Listen(this.ptr);
+ Listen ret_hu_conv = new Listen(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
public void block_connected(Uint8Array header, TwoTuple<Number, Uint8Array>[] txdata, number height) {
- bindings.ChannelManager_block_connected(this.ptr, header, Arrays.stream(txdata).map(arr_conv_30 -> bindings.C2Tuple_usizeTransactionZ_new(arr_conv_30.a, arr_conv_30.b)).toArray(number[]::new), height);
+ bindings.ChannelManager_block_connected(this.ptr, header, Arrays.stream(txdata).map(txdata_conv_30 -> bindings.C2Tuple_usizeTransactionZ_new(txdata_conv_30.a, txdata_conv_30.b)).toArray(number[]::new), height);
/* TODO 2 TwoTuple<Number, Uint8Array> */;
}
bindings.ChannelManager_block_disconnected(this.ptr, header);
}
+ public void await_persistable_update() {
+ bindings.ChannelManager_await_persistable_update(this.ptr);
+ }
+
public ChannelMessageHandler as_ChannelMessageHandler() {
number ret = bindings.ChannelManager_as_ChannelMessageHandler(this.ptr);
ChannelMessageHandler ret_hu_conv = new ChannelMessageHandler(null, ret);
}
public static ChannelManagerReadArgs constructor_new(KeysInterface keys_manager, FeeEstimator fee_estimator, Watch chain_monitor, BroadcasterInterface tx_broadcaster, Logger logger, UserConfig default_config, ChannelMonitor[] channel_monitors) {
- number ret = bindings.ChannelManagerReadArgs_new(keys_manager == null ? 0 : keys_manager.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, chain_monitor == null ? 0 : chain_monitor.ptr, tx_broadcaster == null ? 0 : tx_broadcaster.ptr, logger == null ? 0 : logger.ptr, default_config == null ? 0 : default_config.ptr & ~1, Arrays.stream(channel_monitors).map(arr_conv_16 -> arr_conv_16 == null ? 0 : arr_conv_16.ptr & ~1).toArray(number[]::new));
+ number ret = bindings.ChannelManagerReadArgs_new(keys_manager == null ? 0 : keys_manager.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, chain_monitor == null ? 0 : chain_monitor.ptr, tx_broadcaster == null ? 0 : tx_broadcaster.ptr, logger == null ? 0 : logger.ptr, default_config == null ? 0 : default_config.ptr & ~1, Arrays.stream(channel_monitors).map(channel_monitors_conv_16 -> channel_monitors_conv_16 == null ? 0 : channel_monitors_conv_16.ptr & ~1).toArray(number[]::new));
const ret_hu_conv: ChannelManagerReadArgs = new ChannelManagerReadArgs(null, ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
ret_hu_conv.ptrs_to.add(keys_manager);
arg.handle_funding_locked(their_node_id, msg_hu_conv);
},
- handle_shutdown (their_node_id: Uint8Array, msg: number): void {
+ handle_shutdown (their_node_id: Uint8Array, their_features: number, msg: number): void {
+ const their_features_hu_conv: InitFeatures = new InitFeatures(null, their_features);
const msg_hu_conv: Shutdown = new Shutdown(null, msg);
- arg.handle_shutdown(their_node_id, msg_hu_conv);
+ arg.handle_shutdown(their_node_id, their_features_hu_conv, msg_hu_conv);
},
handle_closing_signed (their_node_id: Uint8Array, msg: number): void {
handle_funding_created(their_node_id: Uint8Array, msg: FundingCreated): void;
handle_funding_signed(their_node_id: Uint8Array, msg: FundingSigned): void;
handle_funding_locked(their_node_id: Uint8Array, msg: FundingLocked): void;
- handle_shutdown(their_node_id: Uint8Array, msg: Shutdown): void;
+ handle_shutdown(their_node_id: Uint8Array, their_features: InitFeatures, msg: Shutdown): void;
handle_closing_signed(their_node_id: Uint8Array, msg: ClosingSigned): void;
handle_update_add_htlc(their_node_id: Uint8Array, msg: UpdateAddHTLC): void;
handle_update_fulfill_htlc(their_node_id: Uint8Array, msg: UpdateFulfillHTLC): void;
this.ptrs_to.add(msg);
}
- public void handle_shutdown(Uint8Array their_node_id, Shutdown msg) {
- bindings.ChannelMessageHandler_handle_shutdown(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1);
+ public void handle_shutdown(Uint8Array their_node_id, InitFeatures their_features, Shutdown msg) {
+ bindings.ChannelMessageHandler_handle_shutdown(this.ptr, their_node_id, their_features == null ? 0 : their_features.ptr & ~1, msg == null ? 0 : msg.ptr & ~1);
+ this.ptrs_to.add(their_features);
this.ptrs_to.add(msg);
}
public MonitorEvent[] get_and_clear_pending_monitor_events() {
number[] ret = bindings.ChannelMonitor_get_and_clear_pending_monitor_events(this.ptr);
- MonitorEvent[] arr_conv_14_arr = new MonitorEvent[ret.length];
+ MonitorEvent[] ret_conv_14_arr = new MonitorEvent[ret.length];
for (int o = 0; o < ret.length; o++) {
- number arr_conv_14 = ret[o];
- const arr_conv_14_hu_conv: MonitorEvent = new MonitorEvent(null, arr_conv_14);
- arr_conv_14_hu_conv.ptrs_to.add(this);
- arr_conv_14_arr[o] = arr_conv_14_hu_conv;
+ number ret_conv_14 = ret[o];
+ MonitorEvent ret_conv_14_hu_conv = MonitorEvent.constr_from_ptr(ret_conv_14);
+ ret_conv_14_hu_conv.ptrs_to.add(this);
+ ret_conv_14_arr[o] = ret_conv_14_hu_conv;
}
- return arr_conv_14_arr;
+ return ret_conv_14_arr;
}
public Event[] get_and_clear_pending_events() {
number[] ret = bindings.ChannelMonitor_get_and_clear_pending_events(this.ptr);
- Event[] arr_conv_7_arr = new Event[ret.length];
+ Event[] ret_conv_7_arr = new Event[ret.length];
for (int h = 0; h < ret.length; h++) {
- number arr_conv_7 = ret[h];
- Event arr_conv_7_hu_conv = Event.constr_from_ptr(arr_conv_7);
- arr_conv_7_hu_conv.ptrs_to.add(this);
- arr_conv_7_arr[h] = arr_conv_7_hu_conv;
+ number ret_conv_7 = ret[h];
+ Event ret_conv_7_hu_conv = Event.constr_from_ptr(ret_conv_7);
+ ret_conv_7_hu_conv.ptrs_to.add(this);
+ ret_conv_7_arr[h] = ret_conv_7_hu_conv;
}
- return arr_conv_7_arr;
+ return ret_conv_7_arr;
}
public Uint8Array[] get_latest_holder_commitment_txn(Logger logger) {
}
public TwoTuple<Uint8Array, TwoTuple<Number, TxOut>[]>[] block_connected(Uint8Array header, TwoTuple<Number, Uint8Array>[] txdata, number height, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) {
- number[] ret = bindings.ChannelMonitor_block_connected(this.ptr, header, Arrays.stream(txdata).map(arr_conv_30 -> bindings.C2Tuple_usizeTransactionZ_new(arr_conv_30.a, arr_conv_30.b)).toArray(number[]::new), height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr);
- TwoTuple<Uint8Array, TwoTuple<Number, TxOut>[]>[] arr_conv_49_arr = new TwoTuple[ret.length];
+ number[] ret = bindings.ChannelMonitor_block_connected(this.ptr, header, Arrays.stream(txdata).map(txdata_conv_30 -> bindings.C2Tuple_usizeTransactionZ_new(txdata_conv_30.a, txdata_conv_30.b)).toArray(number[]::new), height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr);
+ TwoTuple<Uint8Array, TwoTuple<Number, TxOut>[]>[] ret_conv_49_arr = new TwoTuple[ret.length];
for (int x = 0; x < ret.length; x++) {
- number arr_conv_49 = ret[x];
- Uint8Array arr_conv_49_a = bindings.LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(arr_conv_49);
- number[] arr_conv_49_b = bindings.LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(arr_conv_49);
- TwoTuple<Number, TxOut>[] arr_conv_25_arr = new TwoTuple[arr_conv_49_b.length];
- for (int z = 0; z < arr_conv_49_b.length; z++) {
- number arr_conv_25 = arr_conv_49_b[z];
- number arr_conv_25_a = bindings.LDKC2Tuple_u32TxOutZ_get_a(arr_conv_25);
- number arr_conv_25_b = bindings.TxOut_clone(bindings.LDKC2Tuple_u32TxOutZ_get_b(arr_conv_25));
- TxOut arr_conv_25_b_conv = new TxOut(null, arr_conv_25_b);;
- TwoTuple<Number, TxOut> arr_conv_25_conv = new TwoTuple<Number, TxOut>(arr_conv_25_a, arr_conv_25_b_conv, () -> {
- bindings.C2Tuple_u32TxOutZ_free(arr_conv_25);
+ number ret_conv_49 = ret[x];
+ Uint8Array ret_conv_49_a = bindings.LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(ret_conv_49);
+ number[] ret_conv_49_b = bindings.LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(ret_conv_49);
+ TwoTuple<Number, TxOut>[] ret_conv_49_b_conv_25_arr = new TwoTuple[ret_conv_49_b.length];
+ for (int z = 0; z < ret_conv_49_b.length; z++) {
+ number ret_conv_49_b_conv_25 = ret_conv_49_b[z];
+ number ret_conv_49_b_conv_25_a = bindings.LDKC2Tuple_u32TxOutZ_get_a(ret_conv_49_b_conv_25);
+ number ret_conv_49_b_conv_25_b = bindings.TxOut_clone(bindings.LDKC2Tuple_u32TxOutZ_get_b(ret_conv_49_b_conv_25));
+ TxOut ret_conv_49_b_conv_25_b_conv = new TxOut(null, ret_conv_49_b_conv_25_b);;
+ TwoTuple<Number, TxOut> ret_conv_49_b_conv_25_conv = new TwoTuple<Number, TxOut>(ret_conv_49_b_conv_25_a, ret_conv_49_b_conv_25_b_conv, () -> {
+ bindings.C2Tuple_u32TxOutZ_free(ret_conv_49_b_conv_25);
});
- arr_conv_25_b_conv.ptrs_to.add(arr_conv_25_conv);
- arr_conv_25_arr[z] = arr_conv_25_conv;
+ ret_conv_49_b_conv_25_b_conv.ptrs_to.add(ret_conv_49_b_conv_25_conv);
+ ret_conv_49_b_conv_25_arr[z] = ret_conv_49_b_conv_25_conv;
};
- TwoTuple<Uint8Array, TwoTuple<Number, TxOut>[]> arr_conv_49_conv = new TwoTuple<Uint8Array, TwoTuple<Number, TxOut>[]>(arr_conv_49_a, arr_conv_25_arr);
+ TwoTuple<Uint8Array, TwoTuple<Number, TxOut>[]> ret_conv_49_conv = new TwoTuple<Uint8Array, TwoTuple<Number, TxOut>[]>(ret_conv_49_a, ret_conv_49_b_conv_25_arr);
// Warning: We may not free the C tuple object!
- arr_conv_49_arr[x] = arr_conv_49_conv;
+ ret_conv_49_arr[x] = ret_conv_49_conv;
}
/* TODO 2 TwoTuple<Number, Uint8Array> */;
this.ptrs_to.add(broadcaster);
this.ptrs_to.add(fee_estimator);
this.ptrs_to.add(logger);
- return arr_conv_49_arr;
+ return ret_conv_49_arr;
}
public void block_disconnected(Uint8Array header, number height, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) {
}
}
public void set_update_add_htlcs(UpdateAddHTLC[] val) {
- bindings.CommitmentUpdate_set_update_add_htlcs(this.ptr, Arrays.stream(val).map(arr_conv_15 -> arr_conv_15 == null ? 0 : arr_conv_15.ptr & ~1).toArray(number[]::new));
+ bindings.CommitmentUpdate_set_update_add_htlcs(this.ptr, Arrays.stream(val).map(val_conv_15 -> val_conv_15 == null ? 0 : val_conv_15.ptr & ~1).toArray(number[]::new));
/* TODO 2 UpdateAddHTLC */;
}
public void set_update_fulfill_htlcs(UpdateFulfillHTLC[] val) {
- bindings.CommitmentUpdate_set_update_fulfill_htlcs(this.ptr, Arrays.stream(val).map(arr_conv_19 -> arr_conv_19 == null ? 0 : arr_conv_19.ptr & ~1).toArray(number[]::new));
+ bindings.CommitmentUpdate_set_update_fulfill_htlcs(this.ptr, Arrays.stream(val).map(val_conv_19 -> val_conv_19 == null ? 0 : val_conv_19.ptr & ~1).toArray(number[]::new));
/* TODO 2 UpdateFulfillHTLC */;
}
public void set_update_fail_htlcs(UpdateFailHTLC[] val) {
- bindings.CommitmentUpdate_set_update_fail_htlcs(this.ptr, Arrays.stream(val).map(arr_conv_16 -> arr_conv_16 == null ? 0 : arr_conv_16.ptr & ~1).toArray(number[]::new));
+ bindings.CommitmentUpdate_set_update_fail_htlcs(this.ptr, Arrays.stream(val).map(val_conv_16 -> val_conv_16 == null ? 0 : val_conv_16.ptr & ~1).toArray(number[]::new));
/* TODO 2 UpdateFailHTLC */;
}
public void set_update_fail_malformed_htlcs(UpdateFailMalformedHTLC[] val) {
- bindings.CommitmentUpdate_set_update_fail_malformed_htlcs(this.ptr, Arrays.stream(val).map(arr_conv_25 -> arr_conv_25 == null ? 0 : arr_conv_25.ptr & ~1).toArray(number[]::new));
+ bindings.CommitmentUpdate_set_update_fail_malformed_htlcs(this.ptr, Arrays.stream(val).map(val_conv_25 -> val_conv_25 == null ? 0 : val_conv_25.ptr & ~1).toArray(number[]::new));
/* TODO 2 UpdateFailMalformedHTLC */;
}
}
public static CommitmentUpdate constructor_new(UpdateAddHTLC[] update_add_htlcs_arg, UpdateFulfillHTLC[] update_fulfill_htlcs_arg, UpdateFailHTLC[] update_fail_htlcs_arg, UpdateFailMalformedHTLC[] update_fail_malformed_htlcs_arg, UpdateFee update_fee_arg, CommitmentSigned commitment_signed_arg) {
- number ret = bindings.CommitmentUpdate_new(Arrays.stream(update_add_htlcs_arg).map(arr_conv_15 -> arr_conv_15 == null ? 0 : arr_conv_15.ptr & ~1).toArray(number[]::new), Arrays.stream(update_fulfill_htlcs_arg).map(arr_conv_19 -> arr_conv_19 == null ? 0 : arr_conv_19.ptr & ~1).toArray(number[]::new), Arrays.stream(update_fail_htlcs_arg).map(arr_conv_16 -> arr_conv_16 == null ? 0 : arr_conv_16.ptr & ~1).toArray(number[]::new), Arrays.stream(update_fail_malformed_htlcs_arg).map(arr_conv_25 -> arr_conv_25 == null ? 0 : arr_conv_25.ptr & ~1).toArray(number[]::new), update_fee_arg == null ? 0 : update_fee_arg.ptr & ~1, commitment_signed_arg == null ? 0 : commitment_signed_arg.ptr & ~1);
+ number ret = bindings.CommitmentUpdate_new(Arrays.stream(update_add_htlcs_arg).map(update_add_htlcs_arg_conv_15 -> update_add_htlcs_arg_conv_15 == null ? 0 : update_add_htlcs_arg_conv_15.ptr & ~1).toArray(number[]::new), Arrays.stream(update_fulfill_htlcs_arg).map(update_fulfill_htlcs_arg_conv_19 -> update_fulfill_htlcs_arg_conv_19 == null ? 0 : update_fulfill_htlcs_arg_conv_19.ptr & ~1).toArray(number[]::new), Arrays.stream(update_fail_htlcs_arg).map(update_fail_htlcs_arg_conv_16 -> update_fail_htlcs_arg_conv_16 == null ? 0 : update_fail_htlcs_arg_conv_16.ptr & ~1).toArray(number[]::new), Arrays.stream(update_fail_malformed_htlcs_arg).map(update_fail_malformed_htlcs_arg_conv_25 -> update_fail_malformed_htlcs_arg_conv_25 == null ? 0 : update_fail_malformed_htlcs_arg_conv_25.ptr & ~1).toArray(number[]::new), update_fee_arg == null ? 0 : update_fee_arg.ptr & ~1, commitment_signed_arg == null ? 0 : commitment_signed_arg.ptr & ~1);
const ret_hu_conv: CommitmentUpdate = new CommitmentUpdate(null, ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
/* TODO 2 UpdateAddHTLC */;
--- /dev/null
+
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+
+
+ export default class DelayedPaymentOutputDescriptor extends CommonBase {
+ constructor(_dummy: object, ptr: number) {
+ super(ptr);
+ }
+
+
+ protected finalize() {
+ super.finalize();
+
+ if (this.ptr != 0) {
+ bindings.DelayedPaymentOutputDescriptor_free(this.ptr);
+ }
+ }
+ public OutPoint get_outpoint() {
+ number ret = bindings.DelayedPaymentOutputDescriptor_get_outpoint(this.ptr);
+ const ret_hu_conv: OutPoint = new OutPoint(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
+ public void set_outpoint(OutPoint val) {
+ bindings.DelayedPaymentOutputDescriptor_set_outpoint(this.ptr, val == null ? 0 : val.ptr & ~1);
+ this.ptrs_to.add(val);
+ }
+
+ public Uint8Array get_per_commitment_point() {
+ Uint8Array ret = bindings.DelayedPaymentOutputDescriptor_get_per_commitment_point(this.ptr);
+ return ret;
+ }
+
+ public void set_per_commitment_point(Uint8Array val) {
+ bindings.DelayedPaymentOutputDescriptor_set_per_commitment_point(this.ptr, val);
+ }
+
+ public number get_to_self_delay() {
+ number ret = bindings.DelayedPaymentOutputDescriptor_get_to_self_delay(this.ptr);
+ return ret;
+ }
+
+ public void set_to_self_delay(number val) {
+ bindings.DelayedPaymentOutputDescriptor_set_to_self_delay(this.ptr, val);
+ }
+
+ public void set_output(TxOut val) {
+ bindings.DelayedPaymentOutputDescriptor_set_output(this.ptr, val.ptr);
+ }
+
+ public Uint8Array get_revocation_pubkey() {
+ Uint8Array ret = bindings.DelayedPaymentOutputDescriptor_get_revocation_pubkey(this.ptr);
+ return ret;
+ }
+
+ public void set_revocation_pubkey(Uint8Array val) {
+ bindings.DelayedPaymentOutputDescriptor_set_revocation_pubkey(this.ptr, val);
+ }
+
+ public Uint8Array get_channel_keys_id() {
+ Uint8Array ret = bindings.DelayedPaymentOutputDescriptor_get_channel_keys_id(this.ptr);
+ return ret;
+ }
+
+ public void set_channel_keys_id(Uint8Array val) {
+ bindings.DelayedPaymentOutputDescriptor_set_channel_keys_id(this.ptr, val);
+ }
+
+ public number get_channel_value_satoshis() {
+ number ret = bindings.DelayedPaymentOutputDescriptor_get_channel_value_satoshis(this.ptr);
+ return ret;
+ }
+
+ public void set_channel_value_satoshis(number val) {
+ bindings.DelayedPaymentOutputDescriptor_set_channel_value_satoshis(this.ptr, val);
+ }
+
+ public static DelayedPaymentOutputDescriptor constructor_new(OutPoint outpoint_arg, Uint8Array per_commitment_point_arg, number to_self_delay_arg, TxOut output_arg, Uint8Array revocation_pubkey_arg, Uint8Array channel_keys_id_arg, number channel_value_satoshis_arg) {
+ number ret = bindings.DelayedPaymentOutputDescriptor_new(outpoint_arg == null ? 0 : outpoint_arg.ptr & ~1, per_commitment_point_arg, to_self_delay_arg, output_arg.ptr, revocation_pubkey_arg, channel_keys_id_arg, channel_value_satoshis_arg);
+ const ret_hu_conv: DelayedPaymentOutputDescriptor = new DelayedPaymentOutputDescriptor(null, ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ ret_hu_conv.ptrs_to.add(outpoint_arg);
+ return ret_hu_conv;
+ }
+
+ public DelayedPaymentOutputDescriptor clone() {
+ number ret = bindings.DelayedPaymentOutputDescriptor_clone(this.ptr);
+ const ret_hu_conv: DelayedPaymentOutputDescriptor = new DelayedPaymentOutputDescriptor(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
+}
private constructor(ptr: number, obj: bindings.LDKEvent.SpendableOutputs) {
super(null, ptr);
const outputs: number[] = obj.outputs;
- SpendableOutputDescriptor[] arr_conv_27_arr = new SpendableOutputDescriptor[outputs.length];
+ SpendableOutputDescriptor[] outputs_conv_27_arr = new SpendableOutputDescriptor[outputs.length];
for (int b = 0; b < outputs.length; b++) {
- number arr_conv_27 = outputs[b];
- SpendableOutputDescriptor arr_conv_27_hu_conv = SpendableOutputDescriptor.constr_from_ptr(arr_conv_27);
- arr_conv_27_hu_conv.ptrs_to.add(this);
- arr_conv_27_arr[b] = arr_conv_27_hu_conv;
+ number outputs_conv_27 = outputs[b];
+ SpendableOutputDescriptor outputs_conv_27_hu_conv = SpendableOutputDescriptor.constr_from_ptr(outputs_conv_27);
+ outputs_conv_27_hu_conv.ptrs_to.add(this);
+ outputs_conv_27_arr[b] = outputs_conv_27_hu_conv;
}
- this.outputs = arr_conv_27_arr;
+ this.outputs = outputs_conv_27_arr;
}
}
// todo: in-line interface filling
get_and_clear_pending_events (): number[] {
Event[] ret = arg.get_and_clear_pending_events();
- result: number[] = Arrays.stream(ret).map(arr_conv_7 -> arr_conv_7.ptr).toArray(number[]::new);
+ result: number[] = Arrays.stream(ret).map(ret_conv_7 -> ret_conv_7.ptr).toArray(number[]::new);
/* TODO 2 Event */;
return result;
},
}
public Event[] get_and_clear_pending_events() {
number[] ret = bindings.EventsProvider_get_and_clear_pending_events(this.ptr);
- Event[] arr_conv_7_arr = new Event[ret.length];
+ Event[] ret_conv_7_arr = new Event[ret.length];
for (int h = 0; h < ret.length; h++) {
- number arr_conv_7 = ret[h];
- Event arr_conv_7_hu_conv = Event.constr_from_ptr(arr_conv_7);
- arr_conv_7_hu_conv.ptrs_to.add(this);
- arr_conv_7_arr[h] = arr_conv_7_hu_conv;
+ number ret_conv_7 = ret[h];
+ Event ret_conv_7_hu_conv = Event.constr_from_ptr(ret_conv_7);
+ ret_conv_7_hu_conv.ptrs_to.add(this);
+ ret_conv_7_arr[h] = ret_conv_7_hu_conv;
}
- return arr_conv_7_arr;
+ return ret_conv_7_arr;
}
}
+++ /dev/null
-
-
-import CommonBase from './CommonBase';
-import * as bindings from '../bindings' // TODO: figure out location
-
-
-
- export default class InMemoryChannelKeys extends CommonBase {
- constructor(_dummy: object, ptr: number) {
- super(ptr);
- }
-
-
- protected finalize() {
- super.finalize();
-
- if (this.ptr != 0) {
- bindings.InMemoryChannelKeys_free(this.ptr);
- }
- }
- public Uint8Array get_funding_key() {
- Uint8Array ret = bindings.InMemoryChannelKeys_get_funding_key(this.ptr);
- return ret;
- }
-
- public void set_funding_key(Uint8Array val) {
- bindings.InMemoryChannelKeys_set_funding_key(this.ptr, val);
- }
-
- public Uint8Array get_revocation_base_key() {
- Uint8Array ret = bindings.InMemoryChannelKeys_get_revocation_base_key(this.ptr);
- return ret;
- }
-
- public void set_revocation_base_key(Uint8Array val) {
- bindings.InMemoryChannelKeys_set_revocation_base_key(this.ptr, val);
- }
-
- public Uint8Array get_payment_key() {
- Uint8Array ret = bindings.InMemoryChannelKeys_get_payment_key(this.ptr);
- return ret;
- }
-
- public void set_payment_key(Uint8Array val) {
- bindings.InMemoryChannelKeys_set_payment_key(this.ptr, val);
- }
-
- public Uint8Array get_delayed_payment_base_key() {
- Uint8Array ret = bindings.InMemoryChannelKeys_get_delayed_payment_base_key(this.ptr);
- return ret;
- }
-
- public void set_delayed_payment_base_key(Uint8Array val) {
- bindings.InMemoryChannelKeys_set_delayed_payment_base_key(this.ptr, val);
- }
-
- public Uint8Array get_htlc_base_key() {
- Uint8Array ret = bindings.InMemoryChannelKeys_get_htlc_base_key(this.ptr);
- return ret;
- }
-
- public void set_htlc_base_key(Uint8Array val) {
- bindings.InMemoryChannelKeys_set_htlc_base_key(this.ptr, val);
- }
-
- public Uint8Array get_commitment_seed() {
- Uint8Array ret = bindings.InMemoryChannelKeys_get_commitment_seed(this.ptr);
- return ret;
- }
-
- public void set_commitment_seed(Uint8Array val) {
- bindings.InMemoryChannelKeys_set_commitment_seed(this.ptr, val);
- }
-
- public InMemoryChannelKeys clone() {
- number ret = bindings.InMemoryChannelKeys_clone(this.ptr);
- const ret_hu_conv: InMemoryChannelKeys = new InMemoryChannelKeys(null, ret);
- ret_hu_conv.ptrs_to.add(this);
- return ret_hu_conv;
- }
-
- public static InMemoryChannelKeys constructor_new(Uint8Array funding_key, Uint8Array revocation_base_key, Uint8Array payment_key, Uint8Array delayed_payment_base_key, Uint8Array htlc_base_key, Uint8Array commitment_seed, number channel_value_satoshis, TwoTuple<Number, Number> key_derivation_params) {
- number ret = bindings.InMemoryChannelKeys_new(funding_key, revocation_base_key, payment_key, delayed_payment_base_key, htlc_base_key, commitment_seed, channel_value_satoshis, bindings.C2Tuple_u64u64Z_new(key_derivation_params.a, key_derivation_params.b));
- const ret_hu_conv: InMemoryChannelKeys = new InMemoryChannelKeys(null, ret);
- ret_hu_conv.ptrs_to.add(ret_hu_conv);
- return ret_hu_conv;
- }
-
- public ChannelPublicKeys counterparty_pubkeys() {
- number ret = bindings.InMemoryChannelKeys_counterparty_pubkeys(this.ptr);
- const ret_hu_conv: ChannelPublicKeys = new ChannelPublicKeys(null, ret);
- ret_hu_conv.ptrs_to.add(this);
- return ret_hu_conv;
- }
-
- public number counterparty_selected_contest_delay() {
- number ret = bindings.InMemoryChannelKeys_counterparty_selected_contest_delay(this.ptr);
- return ret;
- }
-
- public number holder_selected_contest_delay() {
- number ret = bindings.InMemoryChannelKeys_holder_selected_contest_delay(this.ptr);
- return ret;
- }
-
- public boolean is_outbound() {
- boolean ret = bindings.InMemoryChannelKeys_is_outbound(this.ptr);
- return ret;
- }
-
- public OutPoint funding_outpoint() {
- number ret = bindings.InMemoryChannelKeys_funding_outpoint(this.ptr);
- const ret_hu_conv: OutPoint = new OutPoint(null, ret);
- ret_hu_conv.ptrs_to.add(this);
- return ret_hu_conv;
- }
-
- public ChannelTransactionParameters get_channel_parameters() {
- number ret = bindings.InMemoryChannelKeys_get_channel_parameters(this.ptr);
- const ret_hu_conv: ChannelTransactionParameters = new ChannelTransactionParameters(null, ret);
- ret_hu_conv.ptrs_to.add(this);
- return ret_hu_conv;
- }
-
- public ChannelKeys as_ChannelKeys() {
- number ret = bindings.InMemoryChannelKeys_as_ChannelKeys(this.ptr);
- ChannelKeys ret_hu_conv = new ChannelKeys(null, ret);
- ret_hu_conv.ptrs_to.add(this);
- return ret_hu_conv;
- }
-
- public Uint8Array write() {
- Uint8Array ret = bindings.InMemoryChannelKeys_write(this.ptr);
- return ret;
- }
-
- public static Result_InMemoryChannelKeysDecodeErrorZ constructor_read(Uint8Array ser) {
- number ret = bindings.InMemoryChannelKeys_read(ser);
- Result_InMemoryChannelKeysDecodeErrorZ ret_hu_conv = Result_InMemoryChannelKeysDecodeErrorZ.constr_from_ptr(ret);
- return ret_hu_conv;
- }
-
-}
--- /dev/null
+
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+
+
+ export default class InMemorySigner extends CommonBase {
+ constructor(_dummy: object, ptr: number) {
+ super(ptr);
+ }
+
+
+ protected finalize() {
+ super.finalize();
+
+ if (this.ptr != 0) {
+ bindings.InMemorySigner_free(this.ptr);
+ }
+ }
+ public Uint8Array get_funding_key() {
+ Uint8Array ret = bindings.InMemorySigner_get_funding_key(this.ptr);
+ return ret;
+ }
+
+ public void set_funding_key(Uint8Array val) {
+ bindings.InMemorySigner_set_funding_key(this.ptr, val);
+ }
+
+ public Uint8Array get_revocation_base_key() {
+ Uint8Array ret = bindings.InMemorySigner_get_revocation_base_key(this.ptr);
+ return ret;
+ }
+
+ public void set_revocation_base_key(Uint8Array val) {
+ bindings.InMemorySigner_set_revocation_base_key(this.ptr, val);
+ }
+
+ public Uint8Array get_payment_key() {
+ Uint8Array ret = bindings.InMemorySigner_get_payment_key(this.ptr);
+ return ret;
+ }
+
+ public void set_payment_key(Uint8Array val) {
+ bindings.InMemorySigner_set_payment_key(this.ptr, val);
+ }
+
+ public Uint8Array get_delayed_payment_base_key() {
+ Uint8Array ret = bindings.InMemorySigner_get_delayed_payment_base_key(this.ptr);
+ return ret;
+ }
+
+ public void set_delayed_payment_base_key(Uint8Array val) {
+ bindings.InMemorySigner_set_delayed_payment_base_key(this.ptr, val);
+ }
+
+ public Uint8Array get_htlc_base_key() {
+ Uint8Array ret = bindings.InMemorySigner_get_htlc_base_key(this.ptr);
+ return ret;
+ }
+
+ public void set_htlc_base_key(Uint8Array val) {
+ bindings.InMemorySigner_set_htlc_base_key(this.ptr, val);
+ }
+
+ public Uint8Array get_commitment_seed() {
+ Uint8Array ret = bindings.InMemorySigner_get_commitment_seed(this.ptr);
+ return ret;
+ }
+
+ public void set_commitment_seed(Uint8Array val) {
+ bindings.InMemorySigner_set_commitment_seed(this.ptr, val);
+ }
+
+ public InMemorySigner clone() {
+ number ret = bindings.InMemorySigner_clone(this.ptr);
+ const ret_hu_conv: InMemorySigner = new InMemorySigner(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
+ public static InMemorySigner constructor_new(Uint8Array funding_key, Uint8Array revocation_base_key, Uint8Array payment_key, Uint8Array delayed_payment_base_key, Uint8Array htlc_base_key, Uint8Array commitment_seed, number channel_value_satoshis, Uint8Array channel_keys_id) {
+ number ret = bindings.InMemorySigner_new(funding_key, revocation_base_key, payment_key, delayed_payment_base_key, htlc_base_key, commitment_seed, channel_value_satoshis, channel_keys_id);
+ const ret_hu_conv: InMemorySigner = new InMemorySigner(null, ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ return ret_hu_conv;
+ }
+
+ public ChannelPublicKeys counterparty_pubkeys() {
+ number ret = bindings.InMemorySigner_counterparty_pubkeys(this.ptr);
+ const ret_hu_conv: ChannelPublicKeys = new ChannelPublicKeys(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
+ public number counterparty_selected_contest_delay() {
+ number ret = bindings.InMemorySigner_counterparty_selected_contest_delay(this.ptr);
+ return ret;
+ }
+
+ public number holder_selected_contest_delay() {
+ number ret = bindings.InMemorySigner_holder_selected_contest_delay(this.ptr);
+ return ret;
+ }
+
+ public boolean is_outbound() {
+ boolean ret = bindings.InMemorySigner_is_outbound(this.ptr);
+ return ret;
+ }
+
+ public OutPoint funding_outpoint() {
+ number ret = bindings.InMemorySigner_funding_outpoint(this.ptr);
+ const ret_hu_conv: OutPoint = new OutPoint(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
+ public ChannelTransactionParameters get_channel_parameters() {
+ number ret = bindings.InMemorySigner_get_channel_parameters(this.ptr);
+ const ret_hu_conv: ChannelTransactionParameters = new ChannelTransactionParameters(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
+ public Result_CVec_CVec_u8ZZNoneZ sign_counterparty_payment_input(Uint8Array spend_tx, number input_idx, StaticPaymentOutputDescriptor descriptor) {
+ number ret = bindings.InMemorySigner_sign_counterparty_payment_input(this.ptr, spend_tx, input_idx, descriptor == null ? 0 : descriptor.ptr & ~1);
+ Result_CVec_CVec_u8ZZNoneZ ret_hu_conv = Result_CVec_CVec_u8ZZNoneZ.constr_from_ptr(ret);
+ this.ptrs_to.add(descriptor);
+ return ret_hu_conv;
+ }
+
+ public Result_CVec_CVec_u8ZZNoneZ sign_dynamic_p2wsh_input(Uint8Array spend_tx, number input_idx, DelayedPaymentOutputDescriptor descriptor) {
+ number ret = bindings.InMemorySigner_sign_dynamic_p2wsh_input(this.ptr, spend_tx, input_idx, descriptor == null ? 0 : descriptor.ptr & ~1);
+ Result_CVec_CVec_u8ZZNoneZ ret_hu_conv = Result_CVec_CVec_u8ZZNoneZ.constr_from_ptr(ret);
+ this.ptrs_to.add(descriptor);
+ return ret_hu_conv;
+ }
+
+ public Sign as_Sign() {
+ number ret = bindings.InMemorySigner_as_Sign(this.ptr);
+ Sign ret_hu_conv = new Sign(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
+ public Uint8Array write() {
+ Uint8Array ret = bindings.InMemorySigner_write(this.ptr);
+ return ret;
+ }
+
+ public static Result_InMemorySignerDecodeErrorZ constructor_read(Uint8Array ser) {
+ number ret = bindings.InMemorySigner_read(ser);
+ Result_InMemorySignerDecodeErrorZ ret_hu_conv = Result_InMemorySignerDecodeErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+}
bindings.Init_free(this.ptr);
}
}
+ public InitFeatures get_features() {
+ number ret = bindings.Init_get_features(this.ptr);
+ const ret_hu_conv: InitFeatures = new InitFeatures(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
+ public void set_features(InitFeatures val) {
+ bindings.Init_set_features(this.ptr, val == null ? 0 : val.ptr & ~1);
+ this.ptrs_to.add(val);
+ }
+
+ public static Init constructor_new(InitFeatures features_arg) {
+ number ret = bindings.Init_new(features_arg == null ? 0 : features_arg.ptr & ~1);
+ const ret_hu_conv: Init = new Init(null, ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ ret_hu_conv.ptrs_to.add(features_arg);
+ return ret_hu_conv;
+ }
+
public Init clone() {
number ret = bindings.Init_clone(this.ptr);
const ret_hu_conv: Init = new Init(null, ret);
return ret;
},
- get_channel_keys (inbound: boolean, channel_value_satoshis: number): number {
- ChannelKeys ret = arg.get_channel_keys(inbound, channel_value_satoshis);
+ get_channel_signer (inbound: boolean, channel_value_satoshis: number): number {
+ Sign ret = arg.get_channel_signer(inbound, channel_value_satoshis);
result: number = ret == null ? 0 : ret.ptr;
impl_holder.held.ptrs_to.add(ret);
return result;
},
read_chan_signer (reader: Uint8Array): number {
- Result_ChannelKeysDecodeErrorZ ret = arg.read_chan_signer(reader);
+ Result_SignDecodeErrorZ ret = arg.read_chan_signer(reader);
result: number = ret != null ? ret.ptr : 0;
return result;
},
get_node_secret(): Uint8Array;
get_destination_script(): Uint8Array;
get_shutdown_pubkey(): Uint8Array;
- get_channel_keys(inbound: boolean, channel_value_satoshis: number): ChannelKeys;
+ get_channel_signer(inbound: boolean, channel_value_satoshis: number): Sign;
get_secure_random_bytes(): Uint8Array;
- read_chan_signer(reader: Uint8Array): Result_ChannelKeysDecodeErrorZ;
+ read_chan_signer(reader: Uint8Array): Result_SignDecodeErrorZ;
}
return ret;
}
- public ChannelKeys get_channel_keys(boolean inbound, number channel_value_satoshis) {
- number ret = bindings.KeysInterface_get_channel_keys(this.ptr, inbound, channel_value_satoshis);
- ChannelKeys ret_hu_conv = new ChannelKeys(null, ret);
+ public Sign get_channel_signer(boolean inbound, number channel_value_satoshis) {
+ number ret = bindings.KeysInterface_get_channel_signer(this.ptr, inbound, channel_value_satoshis);
+ Sign ret_hu_conv = new Sign(null, ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
}
return ret;
}
- public Result_ChannelKeysDecodeErrorZ read_chan_signer(Uint8Array reader) {
+ public Result_SignDecodeErrorZ read_chan_signer(Uint8Array reader) {
number ret = bindings.KeysInterface_read_chan_signer(this.ptr, reader);
- Result_ChannelKeysDecodeErrorZ ret_hu_conv = Result_ChannelKeysDecodeErrorZ.constr_from_ptr(ret);
+ Result_SignDecodeErrorZ ret_hu_conv = Result_SignDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
bindings.KeysManager_free(this.ptr);
}
}
- public static KeysManager constructor_new(Uint8Array seed, LDKNetwork network, number starting_time_secs, number starting_time_nanos) {
- number ret = bindings.KeysManager_new(seed, network, starting_time_secs, starting_time_nanos);
+ public static KeysManager constructor_new(Uint8Array seed, number starting_time_secs, number starting_time_nanos) {
+ number ret = bindings.KeysManager_new(seed, starting_time_secs, starting_time_nanos);
const ret_hu_conv: KeysManager = new KeysManager(null, ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
return ret_hu_conv;
}
- public InMemoryChannelKeys derive_channel_keys(number channel_value_satoshis, number params_1, number params_2) {
- number ret = bindings.KeysManager_derive_channel_keys(this.ptr, channel_value_satoshis, params_1, params_2);
- const ret_hu_conv: InMemoryChannelKeys = new InMemoryChannelKeys(null, ret);
+ public InMemorySigner derive_channel_keys(number channel_value_satoshis, Uint8Array params) {
+ number ret = bindings.KeysManager_derive_channel_keys(this.ptr, channel_value_satoshis, params);
+ const ret_hu_conv: InMemorySigner = new InMemorySigner(null, ret);
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
}
+ public Result_TransactionNoneZ spend_spendable_outputs(SpendableOutputDescriptor[] descriptors, TxOut[] outputs, Uint8Array change_destination_script, number feerate_sat_per_1000_weight) {
+ number ret = bindings.KeysManager_spend_spendable_outputs(this.ptr, Arrays.stream(descriptors).map(descriptors_conv_27 -> descriptors_conv_27.ptr).toArray(number[]::new), Arrays.stream(outputs).map(outputs_conv_7 -> outputs_conv_7.ptr).toArray(number[]::new), change_destination_script, feerate_sat_per_1000_weight);
+ Result_TransactionNoneZ ret_hu_conv = Result_TransactionNoneZ.constr_from_ptr(ret);
+ /* TODO 2 SpendableOutputDescriptor */;
+ /* TODO 2 TxOut */;
+ return ret_hu_conv;
+ }
+
public KeysInterface as_KeysInterface() {
number ret = bindings.KeysManager_as_KeysInterface(this.ptr);
KeysInterface ret_hu_conv = new KeysInterface(null, ret);
--- /dev/null
+
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+
+
+ export class Listen extends CommonBase {
+
+ bindings_instance?: bindings.LDKListen;
+
+ constructor(ptr?: number, arg?: bindings.LDKListen) {
+ if (Number.isFinite(ptr)) {
+ super(ptr);
+ this.bindings_instance = null;
+ } else {
+ // TODO: private constructor instantiation
+ super(bindings.LDKListen_new(arg));
+ this.ptrs_to.push(arg);
+
+ }
+ }
+
+ protected finalize() {
+ if (this.ptr != 0) {
+ bindings.Listen_free(this.ptr);
+ }
+ super.finalize();
+ }
+
+ static new_impl(arg: ListenInterface): Listen {
+ const impl_holder: LDKListenHolder = new LDKListenHolder();
+ let structImplementation = <bindings.LDKListen>{
+ // todo: in-line interface filling
+ block_connected (block: Uint8Array, height: number): void {
+ arg.block_connected(block, height);
+ },
+
+ block_disconnected (header: Uint8Array, height: number): void {
+ arg.block_disconnected(header, height);
+ },
+
+
+ };
+ impl_holder.held = new Listen (null, structImplementation);
+ }
+ }
+
+ export interface ListenInterface {
+ block_connected(block: Uint8Array, height: number): void;
+ block_disconnected(header: Uint8Array, height: number): void;
+
+ }
+
+ class LDKListenHolder {
+ held: Listen;
+ }
+ public void block_connected(Uint8Array block, number height) {
+ bindings.Listen_block_connected(this.ptr, block, height);
+ }
+
+ public void block_disconnected(Uint8Array header, number height) {
+ bindings.Listen_block_disconnected(this.ptr, header, height);
+ }
+
+}
// todo: in-line interface filling
get_and_clear_pending_msg_events (): number[] {
MessageSendEvent[] ret = arg.get_and_clear_pending_msg_events();
- result: number[] = Arrays.stream(ret).map(arr_conv_18 -> arr_conv_18.ptr).toArray(number[]::new);
+ result: number[] = Arrays.stream(ret).map(ret_conv_18 -> ret_conv_18.ptr).toArray(number[]::new);
/* TODO 2 MessageSendEvent */;
return result;
},
}
public MessageSendEvent[] get_and_clear_pending_msg_events() {
number[] ret = bindings.MessageSendEventsProvider_get_and_clear_pending_msg_events(this.ptr);
- MessageSendEvent[] arr_conv_18_arr = new MessageSendEvent[ret.length];
+ MessageSendEvent[] ret_conv_18_arr = new MessageSendEvent[ret.length];
for (int s = 0; s < ret.length; s++) {
- number arr_conv_18 = ret[s];
- MessageSendEvent arr_conv_18_hu_conv = MessageSendEvent.constr_from_ptr(arr_conv_18);
- arr_conv_18_hu_conv.ptrs_to.add(this);
- arr_conv_18_arr[s] = arr_conv_18_hu_conv;
+ number ret_conv_18 = ret[s];
+ MessageSendEvent ret_conv_18_hu_conv = MessageSendEvent.constr_from_ptr(ret_conv_18);
+ ret_conv_18_hu_conv.ptrs_to.add(this);
+ ret_conv_18_arr[s] = ret_conv_18_hu_conv;
}
- return arr_conv_18_arr;
+ return ret_conv_18_arr;
}
}
-
import CommonBase from './CommonBase';
import * as bindings from '../bindings' // TODO: figure out location
-
-
- export default class MonitorEvent extends CommonBase {
- constructor(_dummy: object, ptr: number) {
- super(ptr);
- }
-
-
- protected finalize() {
- super.finalize();
-
- if (this.ptr != 0) {
- bindings.MonitorEvent_free(this.ptr);
- }
- }
- public MonitorEvent clone() {
- number ret = bindings.MonitorEvent_clone(this.ptr);
- const ret_hu_conv: MonitorEvent = new MonitorEvent(null, ret);
- ret_hu_conv.ptrs_to.add(this);
- return ret_hu_conv;
+export default class MonitorEvent extends CommonBase {
+ protected constructor(_dummy: object, ptr: number) { super(ptr); }
+ protected finalize() {
+ super.finalize();
+ if (this.ptr != 0) { bindings.MonitorEvent_free(this.ptr); }
+ }
+ static constr_from_ptr(ptr: number): MonitorEvent {
+ const raw_val: bindings.LDKMonitorEvent = bindings.LDKMonitorEvent_ref_from_ptr(ptr);
+ if (raw_val instanceof bindings.LDKMonitorEvent.HTLCEvent) {
+ return new HTLCEvent(this.ptr, raw_val);
+ }
+ if (raw_val instanceof bindings.LDKMonitorEvent.CommitmentTxBroadcasted) {
+ return new CommitmentTxBroadcasted(this.ptr, raw_val);
+ }
+ throw new Error('oops, this should be unreachable'); // Unreachable without extending the (internal) bindings interface
}
}
+export class HTLCEvent extends MonitorEvent {
+ private constructor(ptr: number, obj: bindings.LDKMonitorEvent.HTLCEvent) {
+ super(null, ptr);
+ }
+}
+export class CommitmentTxBroadcasted extends MonitorEvent {
+ private constructor(ptr: number, obj: bindings.LDKMonitorEvent.CommitmentTxBroadcasted) {
+ super(null, ptr);
+ }
+}
return ret_hu_conv;
}
- public static NetGraphMsgHandler constructor_from_net_graph(Access chain_access, Logger logger, Uint8Array network_graph_genesis_hash) {
- number ret = bindings.NetGraphMsgHandler_from_net_graph(chain_access == null ? 0 : chain_access.ptr, logger == null ? 0 : logger.ptr, bindings.NetworkGraph_new(network_graph_genesis_hash));
+ public static NetGraphMsgHandler constructor_from_net_graph(Access chain_access, Logger logger, NetworkGraph network_graph) {
+ number ret = bindings.NetGraphMsgHandler_from_net_graph(chain_access == null ? 0 : chain_access.ptr, logger == null ? 0 : logger.ptr, network_graph == null ? 0 : network_graph.ptr & ~1);
const ret_hu_conv: NetGraphMsgHandler = new NetGraphMsgHandler(null, ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
ret_hu_conv.ptrs_to.add(chain_access);
ret_hu_conv.ptrs_to.add(logger);
+ ret_hu_conv.ptrs_to.add(network_graph);
return ret_hu_conv;
}
bindings.NetworkGraph_free(this.ptr);
}
}
+ public NetworkGraph clone() {
+ number ret = bindings.NetworkGraph_clone(this.ptr);
+ const ret_hu_conv: NetworkGraph = new NetworkGraph(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
public Uint8Array write() {
Uint8Array ret = bindings.NetworkGraph_write(this.ptr);
return ret;
}
public void set_addresses(NetAddress[] val) {
- bindings.NodeAnnouncementInfo_set_addresses(this.ptr, Arrays.stream(val).map(arr_conv_12 -> arr_conv_12.ptr).toArray(number[]::new));
+ bindings.NodeAnnouncementInfo_set_addresses(this.ptr, Arrays.stream(val).map(val_conv_12 -> val_conv_12.ptr).toArray(number[]::new));
/* TODO 2 NetAddress */;
}
}
public static NodeAnnouncementInfo constructor_new(NodeFeatures features_arg, number last_update_arg, Uint8Array rgb_arg, Uint8Array alias_arg, NetAddress[] addresses_arg, NodeAnnouncement announcement_message_arg) {
- number ret = bindings.NodeAnnouncementInfo_new(features_arg == null ? 0 : features_arg.ptr & ~1, last_update_arg, rgb_arg, alias_arg, Arrays.stream(addresses_arg).map(arr_conv_12 -> arr_conv_12.ptr).toArray(number[]::new), announcement_message_arg == null ? 0 : announcement_message_arg.ptr & ~1);
+ number ret = bindings.NodeAnnouncementInfo_new(features_arg == null ? 0 : features_arg.ptr & ~1, last_update_arg, rgb_arg, alias_arg, Arrays.stream(addresses_arg).map(addresses_arg_conv_12 -> addresses_arg_conv_12.ptr).toArray(number[]::new), announcement_message_arg == null ? 0 : announcement_message_arg.ptr & ~1);
const ret_hu_conv: NodeAnnouncementInfo = new NodeAnnouncementInfo(null, ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
ret_hu_conv.ptrs_to.add(features_arg);
-
import CommonBase from './CommonBase';
import * as bindings from '../bindings' // TODO: figure out location
-
-
- export default class PaymentSendFailure extends CommonBase {
- constructor(_dummy: object, ptr: number) {
- super(ptr);
- }
-
-
- protected finalize() {
- super.finalize();
-
- if (this.ptr != 0) {
- bindings.PaymentSendFailure_free(this.ptr);
- }
- }
- public PaymentSendFailure clone() {
- number ret = bindings.PaymentSendFailure_clone(this.ptr);
- const ret_hu_conv: PaymentSendFailure = new PaymentSendFailure(null, ret);
- ret_hu_conv.ptrs_to.add(this);
- return ret_hu_conv;
+export default class PaymentSendFailure extends CommonBase {
+ protected constructor(_dummy: object, ptr: number) { super(ptr); }
+ protected finalize() {
+ super.finalize();
+ if (this.ptr != 0) { bindings.PaymentSendFailure_free(this.ptr); }
+ }
+ static constr_from_ptr(ptr: number): PaymentSendFailure {
+ const raw_val: bindings.LDKPaymentSendFailure = bindings.LDKPaymentSendFailure_ref_from_ptr(ptr);
+ if (raw_val instanceof bindings.LDKPaymentSendFailure.ParameterError) {
+ return new ParameterError(this.ptr, raw_val);
+ }
+ if (raw_val instanceof bindings.LDKPaymentSendFailure.PathParameterError) {
+ return new PathParameterError(this.ptr, raw_val);
+ }
+ if (raw_val instanceof bindings.LDKPaymentSendFailure.AllFailedRetrySafe) {
+ return new AllFailedRetrySafe(this.ptr, raw_val);
+ }
+ if (raw_val instanceof bindings.LDKPaymentSendFailure.PartialFailure) {
+ return new PartialFailure(this.ptr, raw_val);
+ }
+ throw new Error('oops, this should be unreachable'); // Unreachable without extending the (internal) bindings interface
}
}
+export class ParameterError extends PaymentSendFailure {
+ private constructor(ptr: number, obj: bindings.LDKPaymentSendFailure.ParameterError) {
+ super(null, ptr);
+ }
+}
+export class PathParameterError extends PaymentSendFailure {
+ private constructor(ptr: number, obj: bindings.LDKPaymentSendFailure.PathParameterError) {
+ super(null, ptr);
+ }
+}
+export class AllFailedRetrySafe extends PaymentSendFailure {
+ private constructor(ptr: number, obj: bindings.LDKPaymentSendFailure.AllFailedRetrySafe) {
+ super(null, ptr);
+ }
+}
+export class PartialFailure extends PaymentSendFailure {
+ private constructor(ptr: number, obj: bindings.LDKPaymentSendFailure.PartialFailure) {
+ super(null, ptr);
+ }
+}
--- /dev/null
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+public class Result_AcceptChannelDecodeErrorZ extends CommonBase {
+ private Result_AcceptChannelDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_AcceptChannelDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_AcceptChannelDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_AcceptChannelDecodeErrorZ_result_ok(ptr)) {
+ return new Result_AcceptChannelDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_AcceptChannelDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_AcceptChannelDecodeErrorZ_OK extends Result_AcceptChannelDecodeErrorZ {
+ public final AcceptChannel res;
+ private Result_AcceptChannelDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number res = bindings.LDKCResult_AcceptChannelDecodeErrorZ_get_ok(ptr);
+ const res_hu_conv: AcceptChannel = new AcceptChannel(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_AcceptChannelDecodeErrorZ_OK(AcceptChannel res) {
+ this(null, bindings.CResult_AcceptChannelDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_AcceptChannelDecodeErrorZ_Err extends Result_AcceptChannelDecodeErrorZ {
+ public final DecodeError err;
+ private Result_AcceptChannelDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number err = bindings.LDKCResult_AcceptChannelDecodeErrorZ_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_AcceptChannelDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_AcceptChannelDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+public class Result_AnnouncementSignaturesDecodeErrorZ extends CommonBase {
+ private Result_AnnouncementSignaturesDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_AnnouncementSignaturesDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_AnnouncementSignaturesDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_AnnouncementSignaturesDecodeErrorZ_result_ok(ptr)) {
+ return new Result_AnnouncementSignaturesDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_AnnouncementSignaturesDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_AnnouncementSignaturesDecodeErrorZ_OK extends Result_AnnouncementSignaturesDecodeErrorZ {
+ public final AnnouncementSignatures res;
+ private Result_AnnouncementSignaturesDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number res = bindings.LDKCResult_AnnouncementSignaturesDecodeErrorZ_get_ok(ptr);
+ const res_hu_conv: AnnouncementSignatures = new AnnouncementSignatures(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_AnnouncementSignaturesDecodeErrorZ_OK(AnnouncementSignatures res) {
+ this(null, bindings.CResult_AnnouncementSignaturesDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_AnnouncementSignaturesDecodeErrorZ_Err extends Result_AnnouncementSignaturesDecodeErrorZ {
+ public final DecodeError err;
+ private Result_AnnouncementSignaturesDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number err = bindings.LDKCResult_AnnouncementSignaturesDecodeErrorZ_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_AnnouncementSignaturesDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_AnnouncementSignaturesDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+public class Result_BuiltCommitmentTransactionDecodeErrorZ extends CommonBase {
+ private Result_BuiltCommitmentTransactionDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_BuiltCommitmentTransactionDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_BuiltCommitmentTransactionDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_BuiltCommitmentTransactionDecodeErrorZ_result_ok(ptr)) {
+ return new Result_BuiltCommitmentTransactionDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_BuiltCommitmentTransactionDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_BuiltCommitmentTransactionDecodeErrorZ_OK extends Result_BuiltCommitmentTransactionDecodeErrorZ {
+ public final BuiltCommitmentTransaction res;
+ private Result_BuiltCommitmentTransactionDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number res = bindings.LDKCResult_BuiltCommitmentTransactionDecodeErrorZ_get_ok(ptr);
+ const res_hu_conv: BuiltCommitmentTransaction = new BuiltCommitmentTransaction(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_BuiltCommitmentTransactionDecodeErrorZ_OK(BuiltCommitmentTransaction res) {
+ this(null, bindings.CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_BuiltCommitmentTransactionDecodeErrorZ_Err extends Result_BuiltCommitmentTransactionDecodeErrorZ {
+ public final DecodeError err;
+ private Result_BuiltCommitmentTransactionDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number err = bindings.LDKCResult_BuiltCommitmentTransactionDecodeErrorZ_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_BuiltCommitmentTransactionDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_BuiltCommitmentTransactionDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+public class Result_CVec_CVec_u8ZZNoneZ extends CommonBase {
+ private Result_CVec_CVec_u8ZZNoneZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_CVec_CVec_u8ZZNoneZ_free(ptr); } super.finalize();
+ }
+
+ static Result_CVec_CVec_u8ZZNoneZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_CVec_CVec_u8ZZNoneZ_result_ok(ptr)) {
+ return new Result_CVec_CVec_u8ZZNoneZ_OK(null, ptr);
+ } else {
+ return new Result_CVec_CVec_u8ZZNoneZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_CVec_CVec_u8ZZNoneZ_OK extends Result_CVec_CVec_u8ZZNoneZ {
+ public final Uint8Array[] res;
+ private Result_CVec_CVec_u8ZZNoneZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ this.res = bindings.LDKCResult_CVec_CVec_u8ZZNoneZ_get_ok(ptr);
+ }
+ public Result_CVec_CVec_u8ZZNoneZ_OK(Uint8Array[] res) {
+ this(null, bindings.CResult_CVec_CVec_u8ZZNoneZ_ok(res));
+ }
+ }
+
+ public static final class Result_CVec_CVec_u8ZZNoneZ_Err extends Result_CVec_CVec_u8ZZNoneZ {
+ private Result_CVec_CVec_u8ZZNoneZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ }
+ public Result_CVec_CVec_u8ZZNoneZ_Err() {
+ this(null, bindings.CResult_CVec_CVec_u8ZZNoneZ_err());
+ }
+ }
+}
--- /dev/null
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+public class Result_ChannelAnnouncementDecodeErrorZ extends CommonBase {
+ private Result_ChannelAnnouncementDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_ChannelAnnouncementDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_ChannelAnnouncementDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_ChannelAnnouncementDecodeErrorZ_result_ok(ptr)) {
+ return new Result_ChannelAnnouncementDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_ChannelAnnouncementDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_ChannelAnnouncementDecodeErrorZ_OK extends Result_ChannelAnnouncementDecodeErrorZ {
+ public final ChannelAnnouncement res;
+ private Result_ChannelAnnouncementDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number res = bindings.LDKCResult_ChannelAnnouncementDecodeErrorZ_get_ok(ptr);
+ const res_hu_conv: ChannelAnnouncement = new ChannelAnnouncement(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_ChannelAnnouncementDecodeErrorZ_OK(ChannelAnnouncement res) {
+ this(null, bindings.CResult_ChannelAnnouncementDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_ChannelAnnouncementDecodeErrorZ_Err extends Result_ChannelAnnouncementDecodeErrorZ {
+ public final DecodeError err;
+ private Result_ChannelAnnouncementDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number err = bindings.LDKCResult_ChannelAnnouncementDecodeErrorZ_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_ChannelAnnouncementDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_ChannelAnnouncementDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+public class Result_ChannelConfigDecodeErrorZ extends CommonBase {
+ private Result_ChannelConfigDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_ChannelConfigDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_ChannelConfigDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_ChannelConfigDecodeErrorZ_result_ok(ptr)) {
+ return new Result_ChannelConfigDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_ChannelConfigDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_ChannelConfigDecodeErrorZ_OK extends Result_ChannelConfigDecodeErrorZ {
+ public final ChannelConfig res;
+ private Result_ChannelConfigDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number res = bindings.LDKCResult_ChannelConfigDecodeErrorZ_get_ok(ptr);
+ const res_hu_conv: ChannelConfig = new ChannelConfig(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_ChannelConfigDecodeErrorZ_OK(ChannelConfig res) {
+ this(null, bindings.CResult_ChannelConfigDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_ChannelConfigDecodeErrorZ_Err extends Result_ChannelConfigDecodeErrorZ {
+ public final DecodeError err;
+ private Result_ChannelConfigDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number err = bindings.LDKCResult_ChannelConfigDecodeErrorZ_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_ChannelConfigDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_ChannelConfigDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+public class Result_ChannelFeaturesDecodeErrorZ extends CommonBase {
+ private Result_ChannelFeaturesDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_ChannelFeaturesDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_ChannelFeaturesDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_ChannelFeaturesDecodeErrorZ_result_ok(ptr)) {
+ return new Result_ChannelFeaturesDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_ChannelFeaturesDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_ChannelFeaturesDecodeErrorZ_OK extends Result_ChannelFeaturesDecodeErrorZ {
+ public final ChannelFeatures res;
+ private Result_ChannelFeaturesDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number res = bindings.LDKCResult_ChannelFeaturesDecodeErrorZ_get_ok(ptr);
+ const res_hu_conv: ChannelFeatures = new ChannelFeatures(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_ChannelFeaturesDecodeErrorZ_OK(ChannelFeatures res) {
+ this(null, bindings.CResult_ChannelFeaturesDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_ChannelFeaturesDecodeErrorZ_Err extends Result_ChannelFeaturesDecodeErrorZ {
+ public final DecodeError err;
+ private Result_ChannelFeaturesDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number err = bindings.LDKCResult_ChannelFeaturesDecodeErrorZ_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_ChannelFeaturesDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_ChannelFeaturesDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+public class Result_ChannelInfoDecodeErrorZ extends CommonBase {
+ private Result_ChannelInfoDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_ChannelInfoDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_ChannelInfoDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_ChannelInfoDecodeErrorZ_result_ok(ptr)) {
+ return new Result_ChannelInfoDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_ChannelInfoDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_ChannelInfoDecodeErrorZ_OK extends Result_ChannelInfoDecodeErrorZ {
+ public final ChannelInfo res;
+ private Result_ChannelInfoDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number res = bindings.LDKCResult_ChannelInfoDecodeErrorZ_get_ok(ptr);
+ const res_hu_conv: ChannelInfo = new ChannelInfo(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_ChannelInfoDecodeErrorZ_OK(ChannelInfo res) {
+ this(null, bindings.CResult_ChannelInfoDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_ChannelInfoDecodeErrorZ_Err extends Result_ChannelInfoDecodeErrorZ {
+ public final DecodeError err;
+ private Result_ChannelInfoDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number err = bindings.LDKCResult_ChannelInfoDecodeErrorZ_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_ChannelInfoDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_ChannelInfoDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+public class Result_ChannelPublicKeysDecodeErrorZ extends CommonBase {
+ private Result_ChannelPublicKeysDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_ChannelPublicKeysDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_ChannelPublicKeysDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_ChannelPublicKeysDecodeErrorZ_result_ok(ptr)) {
+ return new Result_ChannelPublicKeysDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_ChannelPublicKeysDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_ChannelPublicKeysDecodeErrorZ_OK extends Result_ChannelPublicKeysDecodeErrorZ {
+ public final ChannelPublicKeys res;
+ private Result_ChannelPublicKeysDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number res = bindings.LDKCResult_ChannelPublicKeysDecodeErrorZ_get_ok(ptr);
+ const res_hu_conv: ChannelPublicKeys = new ChannelPublicKeys(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_ChannelPublicKeysDecodeErrorZ_OK(ChannelPublicKeys res) {
+ this(null, bindings.CResult_ChannelPublicKeysDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_ChannelPublicKeysDecodeErrorZ_Err extends Result_ChannelPublicKeysDecodeErrorZ {
+ public final DecodeError err;
+ private Result_ChannelPublicKeysDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number err = bindings.LDKCResult_ChannelPublicKeysDecodeErrorZ_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_ChannelPublicKeysDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_ChannelPublicKeysDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+public class Result_ChannelTransactionParametersDecodeErrorZ extends CommonBase {
+ private Result_ChannelTransactionParametersDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_ChannelTransactionParametersDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_ChannelTransactionParametersDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_ChannelTransactionParametersDecodeErrorZ_result_ok(ptr)) {
+ return new Result_ChannelTransactionParametersDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_ChannelTransactionParametersDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_ChannelTransactionParametersDecodeErrorZ_OK extends Result_ChannelTransactionParametersDecodeErrorZ {
+ public final ChannelTransactionParameters res;
+ private Result_ChannelTransactionParametersDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number res = bindings.LDKCResult_ChannelTransactionParametersDecodeErrorZ_get_ok(ptr);
+ const res_hu_conv: ChannelTransactionParameters = new ChannelTransactionParameters(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_ChannelTransactionParametersDecodeErrorZ_OK(ChannelTransactionParameters res) {
+ this(null, bindings.CResult_ChannelTransactionParametersDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_ChannelTransactionParametersDecodeErrorZ_Err extends Result_ChannelTransactionParametersDecodeErrorZ {
+ public final DecodeError err;
+ private Result_ChannelTransactionParametersDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number err = bindings.LDKCResult_ChannelTransactionParametersDecodeErrorZ_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_ChannelTransactionParametersDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_ChannelTransactionParametersDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+public class Result_ChannelUpdateDecodeErrorZ extends CommonBase {
+ private Result_ChannelUpdateDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_ChannelUpdateDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_ChannelUpdateDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_ChannelUpdateDecodeErrorZ_result_ok(ptr)) {
+ return new Result_ChannelUpdateDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_ChannelUpdateDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_ChannelUpdateDecodeErrorZ_OK extends Result_ChannelUpdateDecodeErrorZ {
+ public final ChannelUpdate res;
+ private Result_ChannelUpdateDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number res = bindings.LDKCResult_ChannelUpdateDecodeErrorZ_get_ok(ptr);
+ const res_hu_conv: ChannelUpdate = new ChannelUpdate(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_ChannelUpdateDecodeErrorZ_OK(ChannelUpdate res) {
+ this(null, bindings.CResult_ChannelUpdateDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_ChannelUpdateDecodeErrorZ_Err extends Result_ChannelUpdateDecodeErrorZ {
+ public final DecodeError err;
+ private Result_ChannelUpdateDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number err = bindings.LDKCResult_ChannelUpdateDecodeErrorZ_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_ChannelUpdateDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_ChannelUpdateDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+public class Result_ClosingSignedDecodeErrorZ extends CommonBase {
+ private Result_ClosingSignedDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_ClosingSignedDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_ClosingSignedDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_ClosingSignedDecodeErrorZ_result_ok(ptr)) {
+ return new Result_ClosingSignedDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_ClosingSignedDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_ClosingSignedDecodeErrorZ_OK extends Result_ClosingSignedDecodeErrorZ {
+ public final ClosingSigned res;
+ private Result_ClosingSignedDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number res = bindings.LDKCResult_ClosingSignedDecodeErrorZ_get_ok(ptr);
+ const res_hu_conv: ClosingSigned = new ClosingSigned(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_ClosingSignedDecodeErrorZ_OK(ClosingSigned res) {
+ this(null, bindings.CResult_ClosingSignedDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_ClosingSignedDecodeErrorZ_Err extends Result_ClosingSignedDecodeErrorZ {
+ public final DecodeError err;
+ private Result_ClosingSignedDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number err = bindings.LDKCResult_ClosingSignedDecodeErrorZ_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_ClosingSignedDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_ClosingSignedDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+public class Result_CommitmentSignedDecodeErrorZ extends CommonBase {
+ private Result_CommitmentSignedDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_CommitmentSignedDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_CommitmentSignedDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_CommitmentSignedDecodeErrorZ_result_ok(ptr)) {
+ return new Result_CommitmentSignedDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_CommitmentSignedDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_CommitmentSignedDecodeErrorZ_OK extends Result_CommitmentSignedDecodeErrorZ {
+ public final CommitmentSigned res;
+ private Result_CommitmentSignedDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number res = bindings.LDKCResult_CommitmentSignedDecodeErrorZ_get_ok(ptr);
+ const res_hu_conv: CommitmentSigned = new CommitmentSigned(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_CommitmentSignedDecodeErrorZ_OK(CommitmentSigned res) {
+ this(null, bindings.CResult_CommitmentSignedDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_CommitmentSignedDecodeErrorZ_Err extends Result_CommitmentSignedDecodeErrorZ {
+ public final DecodeError err;
+ private Result_CommitmentSignedDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number err = bindings.LDKCResult_CommitmentSignedDecodeErrorZ_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_CommitmentSignedDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_CommitmentSignedDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+public class Result_CommitmentTransactionDecodeErrorZ extends CommonBase {
+ private Result_CommitmentTransactionDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_CommitmentTransactionDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_CommitmentTransactionDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_CommitmentTransactionDecodeErrorZ_result_ok(ptr)) {
+ return new Result_CommitmentTransactionDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_CommitmentTransactionDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_CommitmentTransactionDecodeErrorZ_OK extends Result_CommitmentTransactionDecodeErrorZ {
+ public final CommitmentTransaction res;
+ private Result_CommitmentTransactionDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number res = bindings.LDKCResult_CommitmentTransactionDecodeErrorZ_get_ok(ptr);
+ const res_hu_conv: CommitmentTransaction = new CommitmentTransaction(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_CommitmentTransactionDecodeErrorZ_OK(CommitmentTransaction res) {
+ this(null, bindings.CResult_CommitmentTransactionDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_CommitmentTransactionDecodeErrorZ_Err extends Result_CommitmentTransactionDecodeErrorZ {
+ public final DecodeError err;
+ private Result_CommitmentTransactionDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number err = bindings.LDKCResult_CommitmentTransactionDecodeErrorZ_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_CommitmentTransactionDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_CommitmentTransactionDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+public class Result_CounterpartyChannelTransactionParametersDecodeErrorZ extends CommonBase {
+ private Result_CounterpartyChannelTransactionParametersDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_CounterpartyChannelTransactionParametersDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ_result_ok(ptr)) {
+ return new Result_CounterpartyChannelTransactionParametersDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_CounterpartyChannelTransactionParametersDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_CounterpartyChannelTransactionParametersDecodeErrorZ_OK extends Result_CounterpartyChannelTransactionParametersDecodeErrorZ {
+ public final CounterpartyChannelTransactionParameters res;
+ private Result_CounterpartyChannelTransactionParametersDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number res = bindings.LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_ok(ptr);
+ const res_hu_conv: CounterpartyChannelTransactionParameters = new CounterpartyChannelTransactionParameters(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_CounterpartyChannelTransactionParametersDecodeErrorZ_OK(CounterpartyChannelTransactionParameters res) {
+ this(null, bindings.CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_CounterpartyChannelTransactionParametersDecodeErrorZ_Err extends Result_CounterpartyChannelTransactionParametersDecodeErrorZ {
+ public final DecodeError err;
+ private Result_CounterpartyChannelTransactionParametersDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number err = bindings.LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ_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_CounterpartyChannelTransactionParametersDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+public class Result_DirectionalChannelInfoDecodeErrorZ extends CommonBase {
+ private Result_DirectionalChannelInfoDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_DirectionalChannelInfoDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_DirectionalChannelInfoDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_DirectionalChannelInfoDecodeErrorZ_result_ok(ptr)) {
+ return new Result_DirectionalChannelInfoDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_DirectionalChannelInfoDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_DirectionalChannelInfoDecodeErrorZ_OK extends Result_DirectionalChannelInfoDecodeErrorZ {
+ public final DirectionalChannelInfo res;
+ private Result_DirectionalChannelInfoDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number res = bindings.LDKCResult_DirectionalChannelInfoDecodeErrorZ_get_ok(ptr);
+ const res_hu_conv: DirectionalChannelInfo = new DirectionalChannelInfo(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_DirectionalChannelInfoDecodeErrorZ_OK(DirectionalChannelInfo res) {
+ this(null, bindings.CResult_DirectionalChannelInfoDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_DirectionalChannelInfoDecodeErrorZ_Err extends Result_DirectionalChannelInfoDecodeErrorZ {
+ public final DecodeError err;
+ private Result_DirectionalChannelInfoDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number err = bindings.LDKCResult_DirectionalChannelInfoDecodeErrorZ_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_DirectionalChannelInfoDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_DirectionalChannelInfoDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+public class Result_FundingCreatedDecodeErrorZ extends CommonBase {
+ private Result_FundingCreatedDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_FundingCreatedDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_FundingCreatedDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_FundingCreatedDecodeErrorZ_result_ok(ptr)) {
+ return new Result_FundingCreatedDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_FundingCreatedDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_FundingCreatedDecodeErrorZ_OK extends Result_FundingCreatedDecodeErrorZ {
+ public final FundingCreated res;
+ private Result_FundingCreatedDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number res = bindings.LDKCResult_FundingCreatedDecodeErrorZ_get_ok(ptr);
+ const res_hu_conv: FundingCreated = new FundingCreated(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_FundingCreatedDecodeErrorZ_OK(FundingCreated res) {
+ this(null, bindings.CResult_FundingCreatedDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_FundingCreatedDecodeErrorZ_Err extends Result_FundingCreatedDecodeErrorZ {
+ public final DecodeError err;
+ private Result_FundingCreatedDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number err = bindings.LDKCResult_FundingCreatedDecodeErrorZ_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_FundingCreatedDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_FundingCreatedDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+public class Result_FundingLockedDecodeErrorZ extends CommonBase {
+ private Result_FundingLockedDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_FundingLockedDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_FundingLockedDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_FundingLockedDecodeErrorZ_result_ok(ptr)) {
+ return new Result_FundingLockedDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_FundingLockedDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_FundingLockedDecodeErrorZ_OK extends Result_FundingLockedDecodeErrorZ {
+ public final FundingLocked res;
+ private Result_FundingLockedDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number res = bindings.LDKCResult_FundingLockedDecodeErrorZ_get_ok(ptr);
+ const res_hu_conv: FundingLocked = new FundingLocked(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_FundingLockedDecodeErrorZ_OK(FundingLocked res) {
+ this(null, bindings.CResult_FundingLockedDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_FundingLockedDecodeErrorZ_Err extends Result_FundingLockedDecodeErrorZ {
+ public final DecodeError err;
+ private Result_FundingLockedDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number err = bindings.LDKCResult_FundingLockedDecodeErrorZ_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_FundingLockedDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_FundingLockedDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+public class Result_FundingSignedDecodeErrorZ extends CommonBase {
+ private Result_FundingSignedDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_FundingSignedDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_FundingSignedDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_FundingSignedDecodeErrorZ_result_ok(ptr)) {
+ return new Result_FundingSignedDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_FundingSignedDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_FundingSignedDecodeErrorZ_OK extends Result_FundingSignedDecodeErrorZ {
+ public final FundingSigned res;
+ private Result_FundingSignedDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number res = bindings.LDKCResult_FundingSignedDecodeErrorZ_get_ok(ptr);
+ const res_hu_conv: FundingSigned = new FundingSigned(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_FundingSignedDecodeErrorZ_OK(FundingSigned res) {
+ this(null, bindings.CResult_FundingSignedDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_FundingSignedDecodeErrorZ_Err extends Result_FundingSignedDecodeErrorZ {
+ public final DecodeError err;
+ private Result_FundingSignedDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number err = bindings.LDKCResult_FundingSignedDecodeErrorZ_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_FundingSignedDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_FundingSignedDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+public class Result_HTLCOutputInCommitmentDecodeErrorZ extends CommonBase {
+ private Result_HTLCOutputInCommitmentDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_HTLCOutputInCommitmentDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_HTLCOutputInCommitmentDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_HTLCOutputInCommitmentDecodeErrorZ_result_ok(ptr)) {
+ return new Result_HTLCOutputInCommitmentDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_HTLCOutputInCommitmentDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_HTLCOutputInCommitmentDecodeErrorZ_OK extends Result_HTLCOutputInCommitmentDecodeErrorZ {
+ public final HTLCOutputInCommitment res;
+ private Result_HTLCOutputInCommitmentDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number res = bindings.LDKCResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok(ptr);
+ const res_hu_conv: HTLCOutputInCommitment = new HTLCOutputInCommitment(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_HTLCOutputInCommitmentDecodeErrorZ_OK(HTLCOutputInCommitment res) {
+ this(null, bindings.CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_HTLCOutputInCommitmentDecodeErrorZ_Err extends Result_HTLCOutputInCommitmentDecodeErrorZ {
+ public final DecodeError err;
+ private Result_HTLCOutputInCommitmentDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number err = bindings.LDKCResult_HTLCOutputInCommitmentDecodeErrorZ_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_HTLCOutputInCommitmentDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_HTLCOutputInCommitmentDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+public class Result_HTLCUpdateDecodeErrorZ extends CommonBase {
+ private Result_HTLCUpdateDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_HTLCUpdateDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_HTLCUpdateDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_HTLCUpdateDecodeErrorZ_result_ok(ptr)) {
+ return new Result_HTLCUpdateDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_HTLCUpdateDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_HTLCUpdateDecodeErrorZ_OK extends Result_HTLCUpdateDecodeErrorZ {
+ public final HTLCUpdate res;
+ private Result_HTLCUpdateDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number res = bindings.LDKCResult_HTLCUpdateDecodeErrorZ_get_ok(ptr);
+ const res_hu_conv: HTLCUpdate = new HTLCUpdate(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_HTLCUpdateDecodeErrorZ_OK(HTLCUpdate res) {
+ this(null, bindings.CResult_HTLCUpdateDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_HTLCUpdateDecodeErrorZ_Err extends Result_HTLCUpdateDecodeErrorZ {
+ public final DecodeError err;
+ private Result_HTLCUpdateDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number err = bindings.LDKCResult_HTLCUpdateDecodeErrorZ_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_HTLCUpdateDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_HTLCUpdateDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+public class Result_HolderCommitmentTransactionDecodeErrorZ extends CommonBase {
+ private Result_HolderCommitmentTransactionDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_HolderCommitmentTransactionDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_HolderCommitmentTransactionDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_HolderCommitmentTransactionDecodeErrorZ_result_ok(ptr)) {
+ return new Result_HolderCommitmentTransactionDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_HolderCommitmentTransactionDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_HolderCommitmentTransactionDecodeErrorZ_OK extends Result_HolderCommitmentTransactionDecodeErrorZ {
+ public final HolderCommitmentTransaction res;
+ private Result_HolderCommitmentTransactionDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number res = bindings.LDKCResult_HolderCommitmentTransactionDecodeErrorZ_get_ok(ptr);
+ const res_hu_conv: HolderCommitmentTransaction = new HolderCommitmentTransaction(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_HolderCommitmentTransactionDecodeErrorZ_OK(HolderCommitmentTransaction res) {
+ this(null, bindings.CResult_HolderCommitmentTransactionDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_HolderCommitmentTransactionDecodeErrorZ_Err extends Result_HolderCommitmentTransactionDecodeErrorZ {
+ public final DecodeError err;
+ private Result_HolderCommitmentTransactionDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number err = bindings.LDKCResult_HolderCommitmentTransactionDecodeErrorZ_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_HolderCommitmentTransactionDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_HolderCommitmentTransactionDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
+++ /dev/null
-
-import CommonBase from './CommonBase';
-import * as bindings from '../bindings' // TODO: figure out location
-
-public class Result_InMemoryChannelKeysDecodeErrorZ extends CommonBase {
- private Result_InMemoryChannelKeysDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
- protected void finalize() throws Throwable {
- if (ptr != 0) { bindings.CResult_InMemoryChannelKeysDecodeErrorZ_free(ptr); } super.finalize();
- }
-
- static Result_InMemoryChannelKeysDecodeErrorZ constr_from_ptr(long ptr) {
- if (bindings.LDKCResult_InMemoryChannelKeysDecodeErrorZ_result_ok(ptr)) {
- return new Result_InMemoryChannelKeysDecodeErrorZ_OK(null, ptr);
- } else {
- return new Result_InMemoryChannelKeysDecodeErrorZ_Err(null, ptr);
- }
- }
- public static final class Result_InMemoryChannelKeysDecodeErrorZ_OK extends Result_InMemoryChannelKeysDecodeErrorZ {
- public final InMemoryChannelKeys res;
- private Result_InMemoryChannelKeysDecodeErrorZ_OK(Object _dummy, long ptr) {
- super(_dummy, ptr);
- number res = bindings.LDKCResult_InMemoryChannelKeysDecodeErrorZ_get_ok(ptr);
- const res_hu_conv: InMemoryChannelKeys = new InMemoryChannelKeys(null, res);
- res_hu_conv.ptrs_to.add(this);
- this.res = res_hu_conv;
- }
- public Result_InMemoryChannelKeysDecodeErrorZ_OK(InMemoryChannelKeys res) {
- this(null, bindings.CResult_InMemoryChannelKeysDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
- this.ptrs_to.add(res);
- }
- }
-
- public static final class Result_InMemoryChannelKeysDecodeErrorZ_Err extends Result_InMemoryChannelKeysDecodeErrorZ {
- public final DecodeError err;
- private Result_InMemoryChannelKeysDecodeErrorZ_Err(Object _dummy, long ptr) {
- super(_dummy, ptr);
- number err = bindings.LDKCResult_InMemoryChannelKeysDecodeErrorZ_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_InMemoryChannelKeysDecodeErrorZ_Err(DecodeError err) {
- this(null, bindings.CResult_InMemoryChannelKeysDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
- this.ptrs_to.add(err);
- }
- }
-}
--- /dev/null
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+public class Result_InMemorySignerDecodeErrorZ extends CommonBase {
+ private Result_InMemorySignerDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_InMemorySignerDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_InMemorySignerDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_InMemorySignerDecodeErrorZ_result_ok(ptr)) {
+ return new Result_InMemorySignerDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_InMemorySignerDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_InMemorySignerDecodeErrorZ_OK extends Result_InMemorySignerDecodeErrorZ {
+ public final InMemorySigner res;
+ private Result_InMemorySignerDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number res = bindings.LDKCResult_InMemorySignerDecodeErrorZ_get_ok(ptr);
+ const res_hu_conv: InMemorySigner = new InMemorySigner(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_InMemorySignerDecodeErrorZ_OK(InMemorySigner res) {
+ this(null, bindings.CResult_InMemorySignerDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_InMemorySignerDecodeErrorZ_Err extends Result_InMemorySignerDecodeErrorZ {
+ public final DecodeError err;
+ private Result_InMemorySignerDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number err = bindings.LDKCResult_InMemorySignerDecodeErrorZ_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_InMemorySignerDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_InMemorySignerDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+public class Result_InitFeaturesDecodeErrorZ extends CommonBase {
+ private Result_InitFeaturesDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_InitFeaturesDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_InitFeaturesDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_InitFeaturesDecodeErrorZ_result_ok(ptr)) {
+ return new Result_InitFeaturesDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_InitFeaturesDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_InitFeaturesDecodeErrorZ_OK extends Result_InitFeaturesDecodeErrorZ {
+ public final InitFeatures res;
+ private Result_InitFeaturesDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number res = bindings.LDKCResult_InitFeaturesDecodeErrorZ_get_ok(ptr);
+ const res_hu_conv: InitFeatures = new InitFeatures(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_InitFeaturesDecodeErrorZ_OK(InitFeatures res) {
+ this(null, bindings.CResult_InitFeaturesDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_InitFeaturesDecodeErrorZ_Err extends Result_InitFeaturesDecodeErrorZ {
+ public final DecodeError err;
+ private Result_InitFeaturesDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number err = bindings.LDKCResult_InitFeaturesDecodeErrorZ_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_InitFeaturesDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_InitFeaturesDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
public Result_NetworkGraphDecodeErrorZ_OK(NetworkGraph res) {
this(null, bindings.CResult_NetworkGraphDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
this.ptrs_to.add(res);
- // Due to rust's strict-ownership memory model, in some cases we need to "move"
- // an object to pass exclusive ownership to the function being called.
- // In most cases, we avoid this being visible in GC'd languages by cloning the object
- // at the FFI layer, creating a new object which Rust can claim ownership of
- // However, in some cases (eg here), there is no way to clone an object, and thus
- // we actually have to pass full ownership to Rust.
- // Thus, after this call, res is reset to null and is now a dummy object.
- res.ptr = 0;
}
}
--- /dev/null
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+public class Result_NodeAnnouncementDecodeErrorZ extends CommonBase {
+ private Result_NodeAnnouncementDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_NodeAnnouncementDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_NodeAnnouncementDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_NodeAnnouncementDecodeErrorZ_result_ok(ptr)) {
+ return new Result_NodeAnnouncementDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_NodeAnnouncementDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_NodeAnnouncementDecodeErrorZ_OK extends Result_NodeAnnouncementDecodeErrorZ {
+ public final NodeAnnouncement res;
+ private Result_NodeAnnouncementDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number res = bindings.LDKCResult_NodeAnnouncementDecodeErrorZ_get_ok(ptr);
+ const res_hu_conv: NodeAnnouncement = new NodeAnnouncement(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_NodeAnnouncementDecodeErrorZ_OK(NodeAnnouncement res) {
+ this(null, bindings.CResult_NodeAnnouncementDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_NodeAnnouncementDecodeErrorZ_Err extends Result_NodeAnnouncementDecodeErrorZ {
+ public final DecodeError err;
+ private Result_NodeAnnouncementDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number err = bindings.LDKCResult_NodeAnnouncementDecodeErrorZ_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_NodeAnnouncementDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_NodeAnnouncementDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+public class Result_NodeFeaturesDecodeErrorZ extends CommonBase {
+ private Result_NodeFeaturesDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_NodeFeaturesDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_NodeFeaturesDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_NodeFeaturesDecodeErrorZ_result_ok(ptr)) {
+ return new Result_NodeFeaturesDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_NodeFeaturesDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_NodeFeaturesDecodeErrorZ_OK extends Result_NodeFeaturesDecodeErrorZ {
+ public final NodeFeatures res;
+ private Result_NodeFeaturesDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number res = bindings.LDKCResult_NodeFeaturesDecodeErrorZ_get_ok(ptr);
+ const res_hu_conv: NodeFeatures = new NodeFeatures(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_NodeFeaturesDecodeErrorZ_OK(NodeFeatures res) {
+ this(null, bindings.CResult_NodeFeaturesDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_NodeFeaturesDecodeErrorZ_Err extends Result_NodeFeaturesDecodeErrorZ {
+ public final DecodeError err;
+ private Result_NodeFeaturesDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number err = bindings.LDKCResult_NodeFeaturesDecodeErrorZ_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_NodeFeaturesDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_NodeFeaturesDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
private Result_NonePaymentSendFailureZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
number err = bindings.LDKCResult_NonePaymentSendFailureZ_get_err(ptr);
- const err_hu_conv: PaymentSendFailure = new PaymentSendFailure(null, err);
+ PaymentSendFailure err_hu_conv = PaymentSendFailure.constr_from_ptr(err);
err_hu_conv.ptrs_to.add(this);
this.err = err_hu_conv;
}
public Result_NonePaymentSendFailureZ_Err(PaymentSendFailure err) {
- this(null, bindings.CResult_NonePaymentSendFailureZ_err(err == null ? 0 : err.ptr & ~1));
- this.ptrs_to.add(err);
+ this(null, bindings.CResult_NonePaymentSendFailureZ_err(err.ptr));
}
}
}
--- /dev/null
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+public class Result_OpenChannelDecodeErrorZ extends CommonBase {
+ private Result_OpenChannelDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_OpenChannelDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_OpenChannelDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_OpenChannelDecodeErrorZ_result_ok(ptr)) {
+ return new Result_OpenChannelDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_OpenChannelDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_OpenChannelDecodeErrorZ_OK extends Result_OpenChannelDecodeErrorZ {
+ public final OpenChannel res;
+ private Result_OpenChannelDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number res = bindings.LDKCResult_OpenChannelDecodeErrorZ_get_ok(ptr);
+ const res_hu_conv: OpenChannel = new OpenChannel(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_OpenChannelDecodeErrorZ_OK(OpenChannel res) {
+ this(null, bindings.CResult_OpenChannelDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_OpenChannelDecodeErrorZ_Err extends Result_OpenChannelDecodeErrorZ {
+ public final DecodeError err;
+ private Result_OpenChannelDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number err = bindings.LDKCResult_OpenChannelDecodeErrorZ_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_OpenChannelDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_OpenChannelDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+public class Result_OutPointDecodeErrorZ extends CommonBase {
+ private Result_OutPointDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_OutPointDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_OutPointDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_OutPointDecodeErrorZ_result_ok(ptr)) {
+ return new Result_OutPointDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_OutPointDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_OutPointDecodeErrorZ_OK extends Result_OutPointDecodeErrorZ {
+ public final OutPoint res;
+ private Result_OutPointDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number res = bindings.LDKCResult_OutPointDecodeErrorZ_get_ok(ptr);
+ const res_hu_conv: OutPoint = new OutPoint(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_OutPointDecodeErrorZ_OK(OutPoint res) {
+ this(null, bindings.CResult_OutPointDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_OutPointDecodeErrorZ_Err extends Result_OutPointDecodeErrorZ {
+ public final DecodeError err;
+ private Result_OutPointDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number err = bindings.LDKCResult_OutPointDecodeErrorZ_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_OutPointDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_OutPointDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+public class Result_PublicKeyErrorZ extends CommonBase {
+ private Result_PublicKeyErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_PublicKeyErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_PublicKeyErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_PublicKeyErrorZ_result_ok(ptr)) {
+ return new Result_PublicKeyErrorZ_OK(null, ptr);
+ } else {
+ return new Result_PublicKeyErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_PublicKeyErrorZ_OK extends Result_PublicKeyErrorZ {
+ public final Uint8Array res;
+ private Result_PublicKeyErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ this.res = bindings.LDKCResult_PublicKeyErrorZ_get_ok(ptr);
+ }
+ public Result_PublicKeyErrorZ_OK(Uint8Array res) {
+ this(null, bindings.CResult_PublicKeyErrorZ_ok(res));
+ }
+ }
+
+ public static final class Result_PublicKeyErrorZ_Err extends Result_PublicKeyErrorZ {
+ public final LDKSecp256k1Error err;
+ private Result_PublicKeyErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ this.err = bindings.LDKCResult_PublicKeyErrorZ_get_err(ptr);
+ }
+ public Result_PublicKeyErrorZ_Err(LDKSecp256k1Error err) {
+ this(null, bindings.CResult_PublicKeyErrorZ_err(err));
+ }
+ }
+}
--- /dev/null
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+public class Result_RevokeAndACKDecodeErrorZ extends CommonBase {
+ private Result_RevokeAndACKDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_RevokeAndACKDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_RevokeAndACKDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_RevokeAndACKDecodeErrorZ_result_ok(ptr)) {
+ return new Result_RevokeAndACKDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_RevokeAndACKDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_RevokeAndACKDecodeErrorZ_OK extends Result_RevokeAndACKDecodeErrorZ {
+ public final RevokeAndACK res;
+ private Result_RevokeAndACKDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number res = bindings.LDKCResult_RevokeAndACKDecodeErrorZ_get_ok(ptr);
+ const res_hu_conv: RevokeAndACK = new RevokeAndACK(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_RevokeAndACKDecodeErrorZ_OK(RevokeAndACK res) {
+ this(null, bindings.CResult_RevokeAndACKDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_RevokeAndACKDecodeErrorZ_Err extends Result_RevokeAndACKDecodeErrorZ {
+ public final DecodeError err;
+ private Result_RevokeAndACKDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number err = bindings.LDKCResult_RevokeAndACKDecodeErrorZ_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_RevokeAndACKDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_RevokeAndACKDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+public class Result_SecretKeyErrorZ extends CommonBase {
+ private Result_SecretKeyErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_SecretKeyErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_SecretKeyErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_SecretKeyErrorZ_result_ok(ptr)) {
+ return new Result_SecretKeyErrorZ_OK(null, ptr);
+ } else {
+ return new Result_SecretKeyErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_SecretKeyErrorZ_OK extends Result_SecretKeyErrorZ {
+ public final Uint8Array res;
+ private Result_SecretKeyErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ this.res = bindings.LDKCResult_SecretKeyErrorZ_get_ok(ptr);
+ }
+ public Result_SecretKeyErrorZ_OK(Uint8Array res) {
+ this(null, bindings.CResult_SecretKeyErrorZ_ok(res));
+ }
+ }
+
+ public static final class Result_SecretKeyErrorZ_Err extends Result_SecretKeyErrorZ {
+ public final LDKSecp256k1Error err;
+ private Result_SecretKeyErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ this.err = bindings.LDKCResult_SecretKeyErrorZ_get_err(ptr);
+ }
+ public Result_SecretKeyErrorZ_Err(LDKSecp256k1Error err) {
+ this(null, bindings.CResult_SecretKeyErrorZ_err(err));
+ }
+ }
+}
--- /dev/null
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+public class Result_ShutdownDecodeErrorZ extends CommonBase {
+ private Result_ShutdownDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_ShutdownDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_ShutdownDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_ShutdownDecodeErrorZ_result_ok(ptr)) {
+ return new Result_ShutdownDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_ShutdownDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_ShutdownDecodeErrorZ_OK extends Result_ShutdownDecodeErrorZ {
+ public final Shutdown res;
+ private Result_ShutdownDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number res = bindings.LDKCResult_ShutdownDecodeErrorZ_get_ok(ptr);
+ const res_hu_conv: Shutdown = new Shutdown(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_ShutdownDecodeErrorZ_OK(Shutdown res) {
+ this(null, bindings.CResult_ShutdownDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_ShutdownDecodeErrorZ_Err extends Result_ShutdownDecodeErrorZ {
+ public final DecodeError err;
+ private Result_ShutdownDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number err = bindings.LDKCResult_ShutdownDecodeErrorZ_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_ShutdownDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_ShutdownDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+public class Result_SignDecodeErrorZ extends CommonBase {
+ private Result_SignDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_SignDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_SignDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_SignDecodeErrorZ_result_ok(ptr)) {
+ return new Result_SignDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_SignDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_SignDecodeErrorZ_OK extends Result_SignDecodeErrorZ {
+ public final Sign res;
+ private Result_SignDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number res = bindings.LDKCResult_SignDecodeErrorZ_get_ok(ptr);
+ Sign ret_hu_conv = new Sign(null, res);
+ ret_hu_conv.ptrs_to.add(this);
+ this.res = ret_hu_conv;
+ }
+ public Result_SignDecodeErrorZ_OK(Sign res) {
+ this(null, bindings.CResult_SignDecodeErrorZ_ok(res == null ? 0 : res.ptr));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_SignDecodeErrorZ_Err extends Result_SignDecodeErrorZ {
+ public final DecodeError err;
+ private Result_SignDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number err = bindings.LDKCResult_SignDecodeErrorZ_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_SignDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_SignDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+public class Result_TransactionNoneZ extends CommonBase {
+ private Result_TransactionNoneZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_TransactionNoneZ_free(ptr); } super.finalize();
+ }
+
+ static Result_TransactionNoneZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_TransactionNoneZ_result_ok(ptr)) {
+ return new Result_TransactionNoneZ_OK(null, ptr);
+ } else {
+ return new Result_TransactionNoneZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_TransactionNoneZ_OK extends Result_TransactionNoneZ {
+ public final Uint8Array res;
+ private Result_TransactionNoneZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ this.res = bindings.LDKCResult_TransactionNoneZ_get_ok(ptr);
+ }
+ public Result_TransactionNoneZ_OK(Uint8Array res) {
+ this(null, bindings.CResult_TransactionNoneZ_ok(res));
+ }
+ }
+
+ public static final class Result_TransactionNoneZ_Err extends Result_TransactionNoneZ {
+ private Result_TransactionNoneZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ }
+ public Result_TransactionNoneZ_Err() {
+ this(null, bindings.CResult_TransactionNoneZ_err());
+ }
+ }
+}
--- /dev/null
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+public class Result_TxCreationKeysDecodeErrorZ extends CommonBase {
+ private Result_TxCreationKeysDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_TxCreationKeysDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_TxCreationKeysDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_TxCreationKeysDecodeErrorZ_result_ok(ptr)) {
+ return new Result_TxCreationKeysDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_TxCreationKeysDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_TxCreationKeysDecodeErrorZ_OK extends Result_TxCreationKeysDecodeErrorZ {
+ public final TxCreationKeys res;
+ private Result_TxCreationKeysDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number res = bindings.LDKCResult_TxCreationKeysDecodeErrorZ_get_ok(ptr);
+ const res_hu_conv: TxCreationKeys = new TxCreationKeys(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_TxCreationKeysDecodeErrorZ_OK(TxCreationKeys res) {
+ this(null, bindings.CResult_TxCreationKeysDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_TxCreationKeysDecodeErrorZ_Err extends Result_TxCreationKeysDecodeErrorZ {
+ public final DecodeError err;
+ private Result_TxCreationKeysDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number err = bindings.LDKCResult_TxCreationKeysDecodeErrorZ_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_TxCreationKeysDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_TxCreationKeysDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+public class Result_TxCreationKeysErrorZ extends CommonBase {
+ private Result_TxCreationKeysErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_TxCreationKeysErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_TxCreationKeysErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_TxCreationKeysErrorZ_result_ok(ptr)) {
+ return new Result_TxCreationKeysErrorZ_OK(null, ptr);
+ } else {
+ return new Result_TxCreationKeysErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_TxCreationKeysErrorZ_OK extends Result_TxCreationKeysErrorZ {
+ public final TxCreationKeys res;
+ private Result_TxCreationKeysErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number res = bindings.LDKCResult_TxCreationKeysErrorZ_get_ok(ptr);
+ const res_hu_conv: TxCreationKeys = new TxCreationKeys(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_TxCreationKeysErrorZ_OK(TxCreationKeys res) {
+ this(null, bindings.CResult_TxCreationKeysErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_TxCreationKeysErrorZ_Err extends Result_TxCreationKeysErrorZ {
+ public final LDKSecp256k1Error err;
+ private Result_TxCreationKeysErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ this.err = bindings.LDKCResult_TxCreationKeysErrorZ_get_err(ptr);
+ }
+ public Result_TxCreationKeysErrorZ_Err(LDKSecp256k1Error err) {
+ this(null, bindings.CResult_TxCreationKeysErrorZ_err(err));
+ }
+ }
+}
--- /dev/null
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+public class Result_UpdateAddHTLCDecodeErrorZ extends CommonBase {
+ private Result_UpdateAddHTLCDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_UpdateAddHTLCDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_UpdateAddHTLCDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_UpdateAddHTLCDecodeErrorZ_result_ok(ptr)) {
+ return new Result_UpdateAddHTLCDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_UpdateAddHTLCDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_UpdateAddHTLCDecodeErrorZ_OK extends Result_UpdateAddHTLCDecodeErrorZ {
+ public final UpdateAddHTLC res;
+ private Result_UpdateAddHTLCDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number res = bindings.LDKCResult_UpdateAddHTLCDecodeErrorZ_get_ok(ptr);
+ const res_hu_conv: UpdateAddHTLC = new UpdateAddHTLC(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_UpdateAddHTLCDecodeErrorZ_OK(UpdateAddHTLC res) {
+ this(null, bindings.CResult_UpdateAddHTLCDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_UpdateAddHTLCDecodeErrorZ_Err extends Result_UpdateAddHTLCDecodeErrorZ {
+ public final DecodeError err;
+ private Result_UpdateAddHTLCDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number err = bindings.LDKCResult_UpdateAddHTLCDecodeErrorZ_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_UpdateAddHTLCDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_UpdateAddHTLCDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+public class Result_UpdateFailHTLCDecodeErrorZ extends CommonBase {
+ private Result_UpdateFailHTLCDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_UpdateFailHTLCDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_UpdateFailHTLCDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_UpdateFailHTLCDecodeErrorZ_result_ok(ptr)) {
+ return new Result_UpdateFailHTLCDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_UpdateFailHTLCDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_UpdateFailHTLCDecodeErrorZ_OK extends Result_UpdateFailHTLCDecodeErrorZ {
+ public final UpdateFailHTLC res;
+ private Result_UpdateFailHTLCDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number res = bindings.LDKCResult_UpdateFailHTLCDecodeErrorZ_get_ok(ptr);
+ const res_hu_conv: UpdateFailHTLC = new UpdateFailHTLC(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_UpdateFailHTLCDecodeErrorZ_OK(UpdateFailHTLC res) {
+ this(null, bindings.CResult_UpdateFailHTLCDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_UpdateFailHTLCDecodeErrorZ_Err extends Result_UpdateFailHTLCDecodeErrorZ {
+ public final DecodeError err;
+ private Result_UpdateFailHTLCDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number err = bindings.LDKCResult_UpdateFailHTLCDecodeErrorZ_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_UpdateFailHTLCDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_UpdateFailHTLCDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+public class Result_UpdateFailMalformedHTLCDecodeErrorZ extends CommonBase {
+ private Result_UpdateFailMalformedHTLCDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_UpdateFailMalformedHTLCDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ_result_ok(ptr)) {
+ return new Result_UpdateFailMalformedHTLCDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_UpdateFailMalformedHTLCDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_UpdateFailMalformedHTLCDecodeErrorZ_OK extends Result_UpdateFailMalformedHTLCDecodeErrorZ {
+ public final UpdateFailMalformedHTLC res;
+ private Result_UpdateFailMalformedHTLCDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number res = bindings.LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ_get_ok(ptr);
+ const res_hu_conv: UpdateFailMalformedHTLC = new UpdateFailMalformedHTLC(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_UpdateFailMalformedHTLCDecodeErrorZ_OK(UpdateFailMalformedHTLC res) {
+ this(null, bindings.CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_UpdateFailMalformedHTLCDecodeErrorZ_Err extends Result_UpdateFailMalformedHTLCDecodeErrorZ {
+ public final DecodeError err;
+ private Result_UpdateFailMalformedHTLCDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number err = bindings.LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ_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_UpdateFailMalformedHTLCDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+public class Result_UpdateFeeDecodeErrorZ extends CommonBase {
+ private Result_UpdateFeeDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_UpdateFeeDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_UpdateFeeDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_UpdateFeeDecodeErrorZ_result_ok(ptr)) {
+ return new Result_UpdateFeeDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_UpdateFeeDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_UpdateFeeDecodeErrorZ_OK extends Result_UpdateFeeDecodeErrorZ {
+ public final UpdateFee res;
+ private Result_UpdateFeeDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number res = bindings.LDKCResult_UpdateFeeDecodeErrorZ_get_ok(ptr);
+ const res_hu_conv: UpdateFee = new UpdateFee(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_UpdateFeeDecodeErrorZ_OK(UpdateFee res) {
+ this(null, bindings.CResult_UpdateFeeDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_UpdateFeeDecodeErrorZ_Err extends Result_UpdateFeeDecodeErrorZ {
+ public final DecodeError err;
+ private Result_UpdateFeeDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number err = bindings.LDKCResult_UpdateFeeDecodeErrorZ_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_UpdateFeeDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_UpdateFeeDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
--- /dev/null
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+public class Result_UpdateFulfillHTLCDecodeErrorZ extends CommonBase {
+ private Result_UpdateFulfillHTLCDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_UpdateFulfillHTLCDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_UpdateFulfillHTLCDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.LDKCResult_UpdateFulfillHTLCDecodeErrorZ_result_ok(ptr)) {
+ return new Result_UpdateFulfillHTLCDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_UpdateFulfillHTLCDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_UpdateFulfillHTLCDecodeErrorZ_OK extends Result_UpdateFulfillHTLCDecodeErrorZ {
+ public final UpdateFulfillHTLC res;
+ private Result_UpdateFulfillHTLCDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number res = bindings.LDKCResult_UpdateFulfillHTLCDecodeErrorZ_get_ok(ptr);
+ const res_hu_conv: UpdateFulfillHTLC = new UpdateFulfillHTLC(null, res);
+ res_hu_conv.ptrs_to.add(this);
+ this.res = res_hu_conv;
+ }
+ public Result_UpdateFulfillHTLCDecodeErrorZ_OK(UpdateFulfillHTLC res) {
+ this(null, bindings.CResult_UpdateFulfillHTLCDecodeErrorZ_ok(res == null ? 0 : res.ptr & ~1));
+ this.ptrs_to.add(res);
+ }
+ }
+
+ public static final class Result_UpdateFulfillHTLCDecodeErrorZ_Err extends Result_UpdateFulfillHTLCDecodeErrorZ {
+ public final DecodeError err;
+ private Result_UpdateFulfillHTLCDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ number err = bindings.LDKCResult_UpdateFulfillHTLCDecodeErrorZ_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_UpdateFulfillHTLCDecodeErrorZ_Err(DecodeError err) {
+ this(null, bindings.CResult_UpdateFulfillHTLCDecodeErrorZ_err(err == null ? 0 : err.ptr & ~1));
+ this.ptrs_to.add(err);
+ }
+ }
+}
}
}
public void set_paths(RouteHop[][] val) {
- bindings.Route_set_paths(this.ptr, Arrays.stream(val).map(arr_conv_12 -> Arrays.stream(arr_conv_12).map(arr_conv_10 -> arr_conv_10 == null ? 0 : arr_conv_10.ptr & ~1).toArray(number[]::new)).toArray(number[][]::new));
+ bindings.Route_set_paths(this.ptr, Arrays.stream(val).map(val_conv_12 -> Arrays.stream(val_conv_12).map(val_conv_12_conv_10 -> val_conv_12_conv_10 == null ? 0 : val_conv_12_conv_10.ptr & ~1).toArray(number[]::new)).toArray(number[][]::new));
/* TODO 2 RouteHop[] */;
}
public static Route constructor_new(RouteHop[][] paths_arg) {
- number ret = bindings.Route_new(Arrays.stream(paths_arg).map(arr_conv_12 -> Arrays.stream(arr_conv_12).map(arr_conv_10 -> arr_conv_10 == null ? 0 : arr_conv_10.ptr & ~1).toArray(number[]::new)).toArray(number[][]::new));
+ number ret = bindings.Route_new(Arrays.stream(paths_arg).map(paths_arg_conv_12 -> Arrays.stream(paths_arg_conv_12).map(paths_arg_conv_12_conv_10 -> paths_arg_conv_12_conv_10 == null ? 0 : paths_arg_conv_12_conv_10.ptr & ~1).toArray(number[]::new)).toArray(number[][]::new));
const ret_hu_conv: Route = new Route(null, ret);
ret_hu_conv.ptrs_to.add(ret_hu_conv);
/* TODO 2 RouteHop[] */;
get_next_channel_announcements (starting_point: number, batch_amount: number): number[] {
ThreeTuple<ChannelAnnouncement, ChannelUpdate, ChannelUpdate>[] ret = arg.get_next_channel_announcements(starting_point, batch_amount);
- result: number[] = Arrays.stream(ret).map(arr_conv_63 -> bindings.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(arr_conv_63.a == null ? 0 : arr_conv_63.a.ptr & ~1, arr_conv_63.b == null ? 0 : arr_conv_63.b.ptr & ~1, arr_conv_63.c == null ? 0 : arr_conv_63.c.ptr & ~1)).toArray(number[]::new);
+ result: number[] = Arrays.stream(ret).map(ret_conv_63 -> bindings.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(ret_conv_63.a == null ? 0 : ret_conv_63.a.ptr & ~1, ret_conv_63.b == null ? 0 : ret_conv_63.b.ptr & ~1, ret_conv_63.c == null ? 0 : ret_conv_63.c.ptr & ~1)).toArray(number[]::new);
/* TODO 2 ThreeTuple<ChannelAnnouncement, ChannelUpdate, ChannelUpdate> */;
return result;
},
get_next_node_announcements (starting_point: Uint8Array, batch_amount: number): number[] {
NodeAnnouncement[] ret = arg.get_next_node_announcements(starting_point, batch_amount);
- result: number[] = Arrays.stream(ret).map(arr_conv_18 -> arr_conv_18 == null ? 0 : arr_conv_18.ptr & ~1).toArray(number[]::new);
+ result: number[] = Arrays.stream(ret).map(ret_conv_18 -> ret_conv_18 == null ? 0 : ret_conv_18.ptr & ~1).toArray(number[]::new);
/* TODO 2 NodeAnnouncement */;
return result;
},
public ThreeTuple<ChannelAnnouncement, ChannelUpdate, ChannelUpdate>[] get_next_channel_announcements(number starting_point, number batch_amount) {
number[] ret = bindings.RoutingMessageHandler_get_next_channel_announcements(this.ptr, starting_point, batch_amount);
- ThreeTuple<ChannelAnnouncement, ChannelUpdate, ChannelUpdate>[] arr_conv_63_arr = new ThreeTuple[ret.length];
+ ThreeTuple<ChannelAnnouncement, ChannelUpdate, ChannelUpdate>[] ret_conv_63_arr = new ThreeTuple[ret.length];
for (int l = 0; l < ret.length; l++) {
- number arr_conv_63 = ret[l];
- number arr_conv_63_a = bindings.LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(arr_conv_63);
- const arr_conv_63_a_hu_conv: ChannelAnnouncement = new ChannelAnnouncement(null, arr_conv_63_a);
- arr_conv_63_a_hu_conv.ptrs_to.add(this);;
- number arr_conv_63_b = bindings.LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(arr_conv_63);
- const arr_conv_63_b_hu_conv: ChannelUpdate = new ChannelUpdate(null, arr_conv_63_b);
- arr_conv_63_b_hu_conv.ptrs_to.add(this);;
- number arr_conv_63_c = bindings.LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(arr_conv_63);
- const arr_conv_63_c_hu_conv: ChannelUpdate = new ChannelUpdate(null, arr_conv_63_c);
- arr_conv_63_c_hu_conv.ptrs_to.add(this);;
- ThreeTuple<ChannelAnnouncement, ChannelUpdate, ChannelUpdate> arr_conv_63_conv = new ThreeTuple<ChannelAnnouncement, ChannelUpdate, ChannelUpdate>(arr_conv_63_a_hu_conv, arr_conv_63_b_hu_conv, arr_conv_63_c_hu_conv, () -> {
- bindings.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(arr_conv_63);
+ number ret_conv_63 = ret[l];
+ number ret_conv_63_a = bindings.LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(ret_conv_63);
+ const ret_conv_63_a_hu_conv: ChannelAnnouncement = new ChannelAnnouncement(null, ret_conv_63_a);
+ ret_conv_63_a_hu_conv.ptrs_to.add(this);;
+ number ret_conv_63_b = bindings.LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(ret_conv_63);
+ const ret_conv_63_b_hu_conv: ChannelUpdate = new ChannelUpdate(null, ret_conv_63_b);
+ ret_conv_63_b_hu_conv.ptrs_to.add(this);;
+ number ret_conv_63_c = bindings.LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(ret_conv_63);
+ const ret_conv_63_c_hu_conv: ChannelUpdate = new ChannelUpdate(null, ret_conv_63_c);
+ ret_conv_63_c_hu_conv.ptrs_to.add(this);;
+ ThreeTuple<ChannelAnnouncement, ChannelUpdate, ChannelUpdate> ret_conv_63_conv = new ThreeTuple<ChannelAnnouncement, ChannelUpdate, ChannelUpdate>(ret_conv_63_a_hu_conv, ret_conv_63_b_hu_conv, ret_conv_63_c_hu_conv, () -> {
+ bindings.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(ret_conv_63);
});
- arr_conv_63_a_hu_conv.ptrs_to.add(arr_conv_63_conv);
- arr_conv_63_b_hu_conv.ptrs_to.add(arr_conv_63_conv);
- arr_conv_63_c_hu_conv.ptrs_to.add(arr_conv_63_conv);
- arr_conv_63_arr[l] = arr_conv_63_conv;
+ ret_conv_63_a_hu_conv.ptrs_to.add(ret_conv_63_conv);
+ ret_conv_63_b_hu_conv.ptrs_to.add(ret_conv_63_conv);
+ ret_conv_63_c_hu_conv.ptrs_to.add(ret_conv_63_conv);
+ ret_conv_63_arr[l] = ret_conv_63_conv;
}
- return arr_conv_63_arr;
+ return ret_conv_63_arr;
}
public NodeAnnouncement[] get_next_node_announcements(Uint8Array starting_point, number batch_amount) {
number[] ret = bindings.RoutingMessageHandler_get_next_node_announcements(this.ptr, starting_point, batch_amount);
- NodeAnnouncement[] arr_conv_18_arr = new NodeAnnouncement[ret.length];
+ NodeAnnouncement[] ret_conv_18_arr = new NodeAnnouncement[ret.length];
for (int s = 0; s < ret.length; s++) {
- number arr_conv_18 = ret[s];
- const arr_conv_18_hu_conv: NodeAnnouncement = new NodeAnnouncement(null, arr_conv_18);
- arr_conv_18_hu_conv.ptrs_to.add(this);
- arr_conv_18_arr[s] = arr_conv_18_hu_conv;
+ number ret_conv_18 = ret[s];
+ const ret_conv_18_hu_conv: NodeAnnouncement = new NodeAnnouncement(null, ret_conv_18);
+ ret_conv_18_hu_conv.ptrs_to.add(this);
+ ret_conv_18_arr[s] = ret_conv_18_hu_conv;
}
- return arr_conv_18_arr;
+ return ret_conv_18_arr;
}
public void sync_routing_table(Uint8Array their_node_id, Init init) {
--- /dev/null
+
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+
+
+ export class Sign extends CommonBase {
+
+ bindings_instance?: bindings.LDKSign;
+
+ constructor(ptr?: number, arg?: bindings.LDKSign, pubkeys?: ChannelPublicKeys) {
+ if (Number.isFinite(ptr)) {
+ super(ptr);
+ this.bindings_instance = null;
+ } else {
+ // TODO: private constructor instantiation
+ super(bindings.LDKSign_new(arg, pubkeys == null ? 0 : pubkeys.ptr & ~1));
+ this.ptrs_to.push(arg);
+ this.ptrs_to.add(pubkeys);
+
+ }
+ }
+
+ protected finalize() {
+ if (this.ptr != 0) {
+ bindings.Sign_free(this.ptr);
+ }
+ super.finalize();
+ }
+
+ static new_impl(arg: SignInterface, pubkeys: ChannelPublicKeys): Sign {
+ const impl_holder: LDKSignHolder = new LDKSignHolder();
+ let structImplementation = <bindings.LDKSign>{
+ // todo: in-line interface filling
+ get_per_commitment_point (idx: number): Uint8Array {
+ Uint8Array ret = arg.get_per_commitment_point(idx);
+ return ret;
+ },
+
+ release_commitment_secret (idx: number): Uint8Array {
+ Uint8Array ret = arg.release_commitment_secret(idx);
+ return ret;
+ },
+
+ channel_keys_id (): Uint8Array {
+ Uint8Array ret = arg.channel_keys_id();
+ return ret;
+ },
+
+ sign_counterparty_commitment (commitment_tx: number): number {
+ const commitment_tx_hu_conv: CommitmentTransaction = new CommitmentTransaction(null, commitment_tx);
+ Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret = arg.sign_counterparty_commitment(commitment_tx_hu_conv);
+ result: number = ret != null ? ret.ptr : 0;
+ return result;
+ },
+
+ sign_holder_commitment_and_htlcs (commitment_tx: number): number {
+ const commitment_tx_hu_conv: HolderCommitmentTransaction = new HolderCommitmentTransaction(null, commitment_tx);
+ Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret = arg.sign_holder_commitment_and_htlcs(commitment_tx_hu_conv);
+ result: number = ret != null ? ret.ptr : 0;
+ return result;
+ },
+
+ sign_justice_transaction (justice_tx: Uint8Array, input: number, amount: number, per_commitment_key: Uint8Array, htlc: number): number {
+ const htlc_hu_conv: HTLCOutputInCommitment = new HTLCOutputInCommitment(null, htlc);
+ Result_SignatureNoneZ ret = arg.sign_justice_transaction(justice_tx, input, amount, per_commitment_key, htlc_hu_conv);
+ result: number = ret != null ? ret.ptr : 0;
+ return result;
+ },
+
+ sign_counterparty_htlc_transaction (htlc_tx: Uint8Array, input: number, amount: number, per_commitment_point: Uint8Array, htlc: number): number {
+ const htlc_hu_conv: HTLCOutputInCommitment = new HTLCOutputInCommitment(null, htlc);
+ Result_SignatureNoneZ ret = arg.sign_counterparty_htlc_transaction(htlc_tx, input, amount, per_commitment_point, htlc_hu_conv);
+ result: number = ret != null ? ret.ptr : 0;
+ return result;
+ },
+
+ sign_closing_transaction (closing_tx: Uint8Array): number {
+ Result_SignatureNoneZ ret = arg.sign_closing_transaction(closing_tx);
+ result: number = ret != null ? ret.ptr : 0;
+ return result;
+ },
+
+ sign_channel_announcement (msg: number): number {
+ const msg_hu_conv: UnsignedChannelAnnouncement = new UnsignedChannelAnnouncement(null, msg);
+ Result_SignatureNoneZ ret = arg.sign_channel_announcement(msg_hu_conv);
+ result: number = ret != null ? ret.ptr : 0;
+ return result;
+ },
+
+ ready_channel (channel_parameters: number): void {
+ const channel_parameters_hu_conv: ChannelTransactionParameters = new ChannelTransactionParameters(null, channel_parameters);
+ arg.ready_channel(channel_parameters_hu_conv);
+ },
+
+ write (): Uint8Array {
+ Uint8Array ret = arg.write();
+ return ret;
+ },
+
+
+ };
+ impl_holder.held = new Sign (null, structImplementation, pubkeys);
+ }
+ }
+
+ export interface SignInterface {
+ get_per_commitment_point(idx: number): Uint8Array;
+ release_commitment_secret(idx: number): Uint8Array;
+ channel_keys_id(): Uint8Array;
+ sign_counterparty_commitment(commitment_tx: CommitmentTransaction): Result_C2Tuple_SignatureCVec_SignatureZZNoneZ;
+ sign_holder_commitment_and_htlcs(commitment_tx: HolderCommitmentTransaction): Result_C2Tuple_SignatureCVec_SignatureZZNoneZ;
+ sign_justice_transaction(justice_tx: Uint8Array, input: number, amount: number, per_commitment_key: Uint8Array, htlc: HTLCOutputInCommitment): Result_SignatureNoneZ;
+ sign_counterparty_htlc_transaction(htlc_tx: Uint8Array, input: number, amount: number, per_commitment_point: Uint8Array, htlc: HTLCOutputInCommitment): Result_SignatureNoneZ;
+ sign_closing_transaction(closing_tx: Uint8Array): Result_SignatureNoneZ;
+ sign_channel_announcement(msg: UnsignedChannelAnnouncement): Result_SignatureNoneZ;
+ ready_channel(channel_parameters: ChannelTransactionParameters): void;
+ write(): Uint8Array;
+
+ }
+
+ class LDKSignHolder {
+ held: Sign;
+ }
+ public Uint8Array get_per_commitment_point(number idx) {
+ Uint8Array ret = bindings.Sign_get_per_commitment_point(this.ptr, idx);
+ return ret;
+ }
+
+ public Uint8Array release_commitment_secret(number idx) {
+ Uint8Array ret = bindings.Sign_release_commitment_secret(this.ptr, idx);
+ return ret;
+ }
+
+ public Uint8Array channel_keys_id() {
+ Uint8Array ret = bindings.Sign_channel_keys_id(this.ptr);
+ return ret;
+ }
+
+ public Result_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment(CommitmentTransaction commitment_tx) {
+ number ret = bindings.Sign_sign_counterparty_commitment(this.ptr, commitment_tx == null ? 0 : commitment_tx.ptr & ~1);
+ Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_hu_conv = Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.constr_from_ptr(ret);
+ this.ptrs_to.add(commitment_tx);
+ return ret_hu_conv;
+ }
+
+ public Result_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htlcs(HolderCommitmentTransaction commitment_tx) {
+ number ret = bindings.Sign_sign_holder_commitment_and_htlcs(this.ptr, commitment_tx == null ? 0 : commitment_tx.ptr & ~1);
+ Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_hu_conv = Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.constr_from_ptr(ret);
+ this.ptrs_to.add(commitment_tx);
+ return ret_hu_conv;
+ }
+
+ public Result_SignatureNoneZ sign_justice_transaction(Uint8Array justice_tx, number input, number amount, Uint8Array per_commitment_key, HTLCOutputInCommitment htlc) {
+ number ret = bindings.Sign_sign_justice_transaction(this.ptr, justice_tx, input, amount, per_commitment_key, htlc == null ? 0 : htlc.ptr & ~1);
+ Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret);
+ this.ptrs_to.add(htlc);
+ return ret_hu_conv;
+ }
+
+ public Result_SignatureNoneZ sign_counterparty_htlc_transaction(Uint8Array htlc_tx, number input, number amount, Uint8Array per_commitment_point, HTLCOutputInCommitment htlc) {
+ number ret = bindings.Sign_sign_counterparty_htlc_transaction(this.ptr, htlc_tx, input, amount, per_commitment_point, htlc == null ? 0 : htlc.ptr & ~1);
+ Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret);
+ this.ptrs_to.add(htlc);
+ return ret_hu_conv;
+ }
+
+ public Result_SignatureNoneZ sign_closing_transaction(Uint8Array closing_tx) {
+ number ret = bindings.Sign_sign_closing_transaction(this.ptr, closing_tx);
+ Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ public Result_SignatureNoneZ sign_channel_announcement(UnsignedChannelAnnouncement msg) {
+ number ret = bindings.Sign_sign_channel_announcement(this.ptr, msg == null ? 0 : msg.ptr & ~1);
+ Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret);
+ this.ptrs_to.add(msg);
+ return ret_hu_conv;
+ }
+
+ public void ready_channel(ChannelTransactionParameters channel_parameters) {
+ bindings.Sign_ready_channel(this.ptr, channel_parameters == null ? 0 : channel_parameters.ptr & ~1);
+ this.ptrs_to.add(channel_parameters);
+ }
+
+ public Uint8Array write() {
+ Uint8Array ret = bindings.Sign_write(this.ptr);
+ return ret;
+ }
+
+ public ChannelPublicKeys get_pubkeys() {
+ number ret = bindings.Sign_get_pubkeys(this.ptr);
+ const ret_hu_conv: ChannelPublicKeys = new ChannelPublicKeys(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
+ public Sign clone() {
+ number ret = bindings.Sign_clone(this.ptr);
+ Sign ret_hu_conv = new Sign(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
+}
if (raw_val instanceof bindings.LDKSpendableOutputDescriptor.StaticOutput) {
return new StaticOutput(this.ptr, raw_val);
}
- if (raw_val instanceof bindings.LDKSpendableOutputDescriptor.DynamicOutputP2WSH) {
- return new DynamicOutputP2WSH(this.ptr, raw_val);
+ if (raw_val instanceof bindings.LDKSpendableOutputDescriptor.DelayedPaymentOutput) {
+ return new DelayedPaymentOutput(this.ptr, raw_val);
}
- if (raw_val instanceof bindings.LDKSpendableOutputDescriptor.StaticOutputCounterpartyPayment) {
- return new StaticOutputCounterpartyPayment(this.ptr, raw_val);
+ if (raw_val instanceof bindings.LDKSpendableOutputDescriptor.StaticPaymentOutput) {
+ return new StaticPaymentOutput(this.ptr, raw_val);
}
throw new Error('oops, this should be unreachable'); // Unreachable without extending the (internal) bindings interface
}
this.output = output_conv;
}
}
-export class DynamicOutputP2WSH extends SpendableOutputDescriptor {
- public outpoint: OutPoint;
- public per_commitment_point: Uint8Array;
- public to_self_delay: number;
- public output: TxOut;
- public key_derivation_params: TwoTuple<Number, Number>;
- public revocation_pubkey: Uint8Array;
- private constructor(ptr: number, obj: bindings.LDKSpendableOutputDescriptor.DynamicOutputP2WSH) {
+export class DelayedPaymentOutput extends SpendableOutputDescriptor {
+ private constructor(ptr: number, obj: bindings.LDKSpendableOutputDescriptor.DelayedPaymentOutput) {
super(null, ptr);
- const outpoint: number = obj.outpoint;
- const outpoint_hu_conv: OutPoint = new OutPoint(null, outpoint);
- outpoint_hu_conv.ptrs_to.add(this);
- this.outpoint = outpoint_hu_conv;
- this.per_commitment_point = obj.per_commitment_point;
- this.to_self_delay = obj.to_self_delay;
- const output: number = obj.output;
- TxOut output_conv = new TxOut(null, output);
- this.output = output_conv;
- const key_derivation_params: number = obj.key_derivation_params;
- number key_derivation_params_a = bindings.LDKC2Tuple_u64u64Z_get_a(key_derivation_params);
- number key_derivation_params_b = bindings.LDKC2Tuple_u64u64Z_get_b(key_derivation_params);
- TwoTuple<Number, Number> key_derivation_params_conv = new TwoTuple<Number, Number>(key_derivation_params_a, key_derivation_params_b, () -> {
- bindings.C2Tuple_u64u64Z_free(key_derivation_params);
- });
- this.key_derivation_params = key_derivation_params_conv;
- this.revocation_pubkey = obj.revocation_pubkey;
}
}
-export class StaticOutputCounterpartyPayment extends SpendableOutputDescriptor {
- public outpoint: OutPoint;
- public output: TxOut;
- public key_derivation_params: TwoTuple<Number, Number>;
- private constructor(ptr: number, obj: bindings.LDKSpendableOutputDescriptor.StaticOutputCounterpartyPayment) {
+export class StaticPaymentOutput extends SpendableOutputDescriptor {
+ private constructor(ptr: number, obj: bindings.LDKSpendableOutputDescriptor.StaticPaymentOutput) {
super(null, ptr);
- const outpoint: number = obj.outpoint;
- const outpoint_hu_conv: OutPoint = new OutPoint(null, outpoint);
- outpoint_hu_conv.ptrs_to.add(this);
- this.outpoint = outpoint_hu_conv;
- const output: number = obj.output;
- TxOut output_conv = new TxOut(null, output);
- this.output = output_conv;
- const key_derivation_params: number = obj.key_derivation_params;
- number key_derivation_params_a = bindings.LDKC2Tuple_u64u64Z_get_a(key_derivation_params);
- number key_derivation_params_b = bindings.LDKC2Tuple_u64u64Z_get_b(key_derivation_params);
- TwoTuple<Number, Number> key_derivation_params_conv = new TwoTuple<Number, Number>(key_derivation_params_a, key_derivation_params_b, () -> {
- bindings.C2Tuple_u64u64Z_free(key_derivation_params);
- });
- this.key_derivation_params = key_derivation_params_conv;
}
}
--- /dev/null
+
+
+import CommonBase from './CommonBase';
+import * as bindings from '../bindings' // TODO: figure out location
+
+
+
+ export default class StaticPaymentOutputDescriptor extends CommonBase {
+ constructor(_dummy: object, ptr: number) {
+ super(ptr);
+ }
+
+
+ protected finalize() {
+ super.finalize();
+
+ if (this.ptr != 0) {
+ bindings.StaticPaymentOutputDescriptor_free(this.ptr);
+ }
+ }
+ public OutPoint get_outpoint() {
+ number ret = bindings.StaticPaymentOutputDescriptor_get_outpoint(this.ptr);
+ const ret_hu_conv: OutPoint = new OutPoint(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
+ public void set_outpoint(OutPoint val) {
+ bindings.StaticPaymentOutputDescriptor_set_outpoint(this.ptr, val == null ? 0 : val.ptr & ~1);
+ this.ptrs_to.add(val);
+ }
+
+ public void set_output(TxOut val) {
+ bindings.StaticPaymentOutputDescriptor_set_output(this.ptr, val.ptr);
+ }
+
+ public Uint8Array get_channel_keys_id() {
+ Uint8Array ret = bindings.StaticPaymentOutputDescriptor_get_channel_keys_id(this.ptr);
+ return ret;
+ }
+
+ public void set_channel_keys_id(Uint8Array val) {
+ bindings.StaticPaymentOutputDescriptor_set_channel_keys_id(this.ptr, val);
+ }
+
+ public number get_channel_value_satoshis() {
+ number ret = bindings.StaticPaymentOutputDescriptor_get_channel_value_satoshis(this.ptr);
+ return ret;
+ }
+
+ public void set_channel_value_satoshis(number val) {
+ bindings.StaticPaymentOutputDescriptor_set_channel_value_satoshis(this.ptr, val);
+ }
+
+ public static StaticPaymentOutputDescriptor constructor_new(OutPoint outpoint_arg, TxOut output_arg, Uint8Array channel_keys_id_arg, number channel_value_satoshis_arg) {
+ number ret = bindings.StaticPaymentOutputDescriptor_new(outpoint_arg == null ? 0 : outpoint_arg.ptr & ~1, output_arg.ptr, channel_keys_id_arg, channel_value_satoshis_arg);
+ const ret_hu_conv: StaticPaymentOutputDescriptor = new StaticPaymentOutputDescriptor(null, ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ ret_hu_conv.ptrs_to.add(outpoint_arg);
+ return ret_hu_conv;
+ }
+
+ public StaticPaymentOutputDescriptor clone() {
+ number ret = bindings.StaticPaymentOutputDescriptor_clone(this.ptr);
+ const ret_hu_conv: StaticPaymentOutputDescriptor = new StaticPaymentOutputDescriptor(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
+}
}
public void set_addresses(NetAddress[] val) {
- bindings.UnsignedNodeAnnouncement_set_addresses(this.ptr, Arrays.stream(val).map(arr_conv_12 -> arr_conv_12.ptr).toArray(number[]::new));
+ bindings.UnsignedNodeAnnouncement_set_addresses(this.ptr, Arrays.stream(val).map(val_conv_12 -> val_conv_12.ptr).toArray(number[]::new));
/* TODO 2 NetAddress */;
}
}
public static Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ constructor_BlockHashChannelManagerZ_read(Uint8Array ser, KeysInterface arg_keys_manager, FeeEstimator arg_fee_estimator, Watch arg_chain_monitor, BroadcasterInterface arg_tx_broadcaster, Logger arg_logger, UserConfig arg_default_config, ChannelMonitor[] arg_channel_monitors) {
- number ret = bindings.C2Tuple_BlockHashChannelManagerZ_read(ser, bindings.ChannelManagerReadArgs_new(arg_keys_manager == null ? 0 : arg_keys_manager.ptr, arg_fee_estimator == null ? 0 : arg_fee_estimator.ptr, arg_chain_monitor == null ? 0 : arg_chain_monitor.ptr, arg_tx_broadcaster == null ? 0 : arg_tx_broadcaster.ptr, arg_logger == null ? 0 : arg_logger.ptr, arg_default_config == null ? 0 : arg_default_config.ptr & ~1, Arrays.stream(arg_channel_monitors).map(arr_conv_16 -> arr_conv_16 == null ? 0 : arr_conv_16.ptr & ~1).toArray(number[]::new)));
+ number ret = bindings.C2Tuple_BlockHashChannelManagerZ_read(ser, bindings.ChannelManagerReadArgs_new(arg_keys_manager == null ? 0 : arg_keys_manager.ptr, arg_fee_estimator == null ? 0 : arg_fee_estimator.ptr, arg_chain_monitor == null ? 0 : arg_chain_monitor.ptr, arg_tx_broadcaster == null ? 0 : arg_tx_broadcaster.ptr, arg_logger == null ? 0 : arg_logger.ptr, arg_default_config == null ? 0 : arg_default_config.ptr & ~1, Arrays.stream(arg_channel_monitors).map(arg_channel_monitors_conv_16 -> arg_channel_monitors_conv_16 == null ? 0 : arg_channel_monitors_conv_16.ptr & ~1).toArray(number[]::new)));
Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ ret_hu_conv = Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.constr_from_ptr(ret);
ret_hu_conv.ptrs_to.add(arg_keys_manager);
ret_hu_conv.ptrs_to.add(arg_fee_estimator);
release_pending_monitor_events (): number[] {
MonitorEvent[] ret = arg.release_pending_monitor_events();
- result: number[] = Arrays.stream(ret).map(arr_conv_14 -> arr_conv_14 == null ? 0 : arr_conv_14.ptr & ~1).toArray(number[]::new);
+ result: number[] = Arrays.stream(ret).map(ret_conv_14 -> ret_conv_14.ptr).toArray(number[]::new);
/* TODO 2 MonitorEvent */;
return result;
},
public MonitorEvent[] release_pending_monitor_events() {
number[] ret = bindings.Watch_release_pending_monitor_events(this.ptr);
- MonitorEvent[] arr_conv_14_arr = new MonitorEvent[ret.length];
+ MonitorEvent[] ret_conv_14_arr = new MonitorEvent[ret.length];
for (int o = 0; o < ret.length; o++) {
- number arr_conv_14 = ret[o];
- const arr_conv_14_hu_conv: MonitorEvent = new MonitorEvent(null, arr_conv_14);
- arr_conv_14_hu_conv.ptrs_to.add(this);
- arr_conv_14_arr[o] = arr_conv_14_hu_conv;
+ number ret_conv_14 = ret[o];
+ MonitorEvent ret_conv_14_hu_conv = MonitorEvent.constr_from_ptr(ret_conv_14);
+ ret_conv_14_hu_conv.ptrs_to.add(this);
+ ret_conv_14_arr[o] = ret_conv_14_hu_conv;
}
- return arr_conv_14_arr;
+ return ret_conv_14_arr;
}
}