+ /**
+ * Because much of the lightning network does not yet support forwarding onion messages, we
+ * may need to directly connect to a node which will forward a message for us. In such a case,
+ * this method will return the set of nodes which need connection by node_id and the
+ * corresponding socket addresses where they may accept incoming connections.
+ *
+ * Thus, this method should be polled regularly to detect messages await such a direct
+ * connection.
+ */
+ public get_and_clear_connections_needed(): TwoTuple_PublicKeyCVec_SocketAddressZZ[] {
+ const ret: number = bindings.OnionMessageHandler_get_and_clear_connections_needed(this.ptr);
+ const ret_conv_40_len: number = bindings.getArrayLength(ret);
+ const ret_conv_40_arr: TwoTuple_PublicKeyCVec_SocketAddressZZ[] = new Array(ret_conv_40_len).fill(null);
+ for (var o = 0; o < ret_conv_40_len; o++) {
+ const ret_conv_40: bigint = bindings.getU64ArrayElem(ret, o);
+ const ret_conv_40_hu_conv: TwoTuple_PublicKeyCVec_SocketAddressZZ = new TwoTuple_PublicKeyCVec_SocketAddressZZ(null, ret_conv_40);
+ CommonBase.add_ref_from(ret_conv_40_hu_conv, this);
+ ret_conv_40_arr[o] = ret_conv_40_hu_conv;
+ }
+ bindings.freeWasmMemory(ret)
+ return ret_conv_40_arr;
+ }
+