+ /**
+ * Gets the list of channels we have with a given counterparty, in random order.
+ */
+ public list_channels_with_counterparty(counterparty_node_id: Uint8Array): ChannelDetails[] {
+ const ret: number = bindings.ChannelManager_list_channels_with_counterparty(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(counterparty_node_id, 33)));
+ const ret_conv_16_len: number = bindings.getArrayLength(ret);
+ const ret_conv_16_arr: ChannelDetails[] = new Array(ret_conv_16_len).fill(null);
+ for (var q = 0; q < ret_conv_16_len; q++) {
+ const ret_conv_16: bigint = bindings.getU64ArrayElem(ret, q);
+ const ret_conv_16_hu_conv: ChannelDetails = new ChannelDetails(null, ret_conv_16);
+ CommonBase.add_ref_from(ret_conv_16_hu_conv, this);
+ ret_conv_16_arr[q] = ret_conv_16_hu_conv;
+ }
+ bindings.freeWasmMemory(ret)
+ return ret_conv_16_arr;
+ }
+
+ /**
+ * Returns in an undefined order recent payments that -- if not fulfilled -- have yet to find a
+ * successful path, or have unresolved HTLCs.
+ *
+ * This can be useful for payments that may have been prepared, but ultimately not sent, as a
+ * result of a crash. If such a payment exists, is not listed here, and an
+ * [`Event::PaymentSent`] has not been received, you may consider resending the payment.
+ *
+ * [`Event::PaymentSent`]: events::Event::PaymentSent
+ */
+ public list_recent_payments(): RecentPaymentDetails[] {
+ const ret: number = bindings.ChannelManager_list_recent_payments(this.ptr);
+ const ret_conv_22_len: number = bindings.getArrayLength(ret);
+ const ret_conv_22_arr: RecentPaymentDetails[] = new Array(ret_conv_22_len).fill(null);
+ for (var w = 0; w < ret_conv_22_len; w++) {
+ const ret_conv_22: bigint = bindings.getU64ArrayElem(ret, w);
+ const ret_conv_22_hu_conv: RecentPaymentDetails = RecentPaymentDetails.constr_from_ptr(ret_conv_22);
+ CommonBase.add_ref_from(ret_conv_22_hu_conv, this);
+ ret_conv_22_arr[w] = ret_conv_22_hu_conv;
+ }
+ bindings.freeWasmMemory(ret)
+ return ret_conv_22_arr;
+ }
+