*/
public byte[] channel_id;
internal HTLCDestination_NextHopChannel(long ptr) : base(null, ptr) {
- this.node_id = bindings.LDKHTLCDestination_NextHopChannel_get_node_id(ptr);
- this.channel_id = bindings.LDKHTLCDestination_NextHopChannel_get_channel_id(ptr);
+ long node_id = bindings.LDKHTLCDestination_NextHopChannel_get_node_id(ptr);
+ byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id);
+ this.node_id = node_id_conv;
+ long channel_id = bindings.LDKHTLCDestination_NextHopChannel_get_channel_id(ptr);
+ byte[] channel_id_conv = InternalUtils.decodeUint8Array(channel_id);
+ this.channel_id = channel_id_conv;
}
}
/** A HTLCDestination of type UnknownNextHop */
*/
public byte[] payment_hash;
internal HTLCDestination_FailedPayment(long ptr) : base(null, ptr) {
- this.payment_hash = bindings.LDKHTLCDestination_FailedPayment_get_payment_hash(ptr);
+ long payment_hash = bindings.LDKHTLCDestination_FailedPayment_get_payment_hash(ptr);
+ byte[] payment_hash_conv = InternalUtils.decodeUint8Array(payment_hash);
+ this.payment_hash = payment_hash_conv;
}
}
internal long clone_ptr() {
* Utility method to constructs a new NextHopChannel-variant HTLCDestination
*/
public static HTLCDestination next_hop_channel(byte[] node_id, byte[] channel_id) {
- long ret = bindings.HTLCDestination_next_hop_channel(InternalUtils.check_arr_len(node_id, 33), InternalUtils.check_arr_len(channel_id, 32));
+ long ret = bindings.HTLCDestination_next_hop_channel(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_id, 32)));
GC.KeepAlive(node_id);
GC.KeepAlive(channel_id);
if (ret >= 0 && ret <= 4096) { return null; }
* Utility method to constructs a new FailedPayment-variant HTLCDestination
*/
public static HTLCDestination failed_payment(byte[] payment_hash) {
- long ret = bindings.HTLCDestination_failed_payment(InternalUtils.check_arr_len(payment_hash, 32));
+ long ret = bindings.HTLCDestination_failed_payment(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_hash, 32)));
GC.KeepAlive(payment_hash);
if (ret >= 0 && ret <= 4096) { return null; }
org.ldk.structs.HTLCDestination ret_hu_conv = org.ldk.structs.HTLCDestination.constr_from_ptr(ret);
* Serialize the HTLCDestination object into a byte array which can be read by HTLCDestination_read
*/
public byte[] write() {
- byte[] ret = bindings.HTLCDestination_write(this.ptr);
+ long ret = bindings.HTLCDestination_write(this.ptr);
GC.KeepAlive(this);
- return ret;
+ if (ret >= 0 && ret <= 4096) { return null; }
+ byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
+ return ret_conv;
}
}