+ /**
+ * Creates an unsigned [`PartiallySignedTransaction`] which spends the given descriptors to
+ * the given outputs, plus an output to the given change destination (if sufficient
+ * change value remains). The PSBT will have a feerate, at least, of the given value.
+ *
+ * The `locktime` argument is used to set the transaction's locktime. If `None`, the
+ * transaction will have a locktime of 0. It it recommended to set this to the current block
+ * height to avoid fee sniping, unless you have some specific reason to use a different
+ * locktime.
+ *
+ * Returns the PSBT and expected max transaction weight.
+ *
+ * Returns `Err(())` if the output value is greater than the input value minus required fee,
+ * if a descriptor was duplicated, or if an output descriptor `script_pubkey`
+ * does not match the one we can spend.
+ *
+ * We do not enforce that outputs meet the dust limit or that any output scripts are standard.
+ */
+ public static constructor_SpendableOutputDescriptor_create_spendable_outputs_psbt(descriptors: SpendableOutputDescriptor[], outputs: TxOut[], change_destination_script: Uint8Array, feerate_sat_per_1000_weight: number, locktime: Option_u32Z): Result_C2Tuple_CVec_u8ZusizeZNoneZ {
+ const ret: bigint = bindings.SpendableOutputDescriptor_create_spendable_outputs_psbt(bindings.encodeUint64Array(descriptors.map(descriptors_conv_27 => CommonBase.get_ptr_of(descriptors_conv_27))), bindings.encodeUint64Array(outputs.map(outputs_conv_7 => CommonBase.get_ptr_of(outputs_conv_7))), bindings.encodeUint8Array(change_destination_script), feerate_sat_per_1000_weight, CommonBase.get_ptr_of(locktime));
+ const ret_hu_conv: Result_C2Tuple_CVec_u8ZusizeZNoneZ = Result_C2Tuple_CVec_u8ZusizeZNoneZ.constr_from_ptr(ret);
+ descriptors.forEach((descriptors_conv_27: SpendableOutputDescriptor) => { CommonBase.add_ref_from(ret_hu_conv, descriptors_conv_27); });
+ CommonBase.add_ref_from(ret_hu_conv, locktime);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Creates an [`OnionMessage`] with the given `contents` for sending to the destination of
+ * `path`.
+ *
+ * Returns both the node id of the peer to send the message to and the message itself.
+ *
+ * Note that reply_path (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ public static constructor_create_onion_message(entropy_source: EntropySource, node_signer: NodeSigner, path: OnionMessagePath, contents: OnionMessageContents, reply_path: BlindedPath|null): Result_C2Tuple_PublicKeyOnionMessageZSendErrorZ {
+ const ret: bigint = bindings.create_onion_message(CommonBase.get_ptr_of(entropy_source), CommonBase.get_ptr_of(node_signer), path == null ? 0n : CommonBase.get_ptr_of(path), CommonBase.get_ptr_of(contents), reply_path == null ? 0n : CommonBase.get_ptr_of(reply_path));
+ const ret_hu_conv: Result_C2Tuple_PublicKeyOnionMessageZSendErrorZ = Result_C2Tuple_PublicKeyOnionMessageZSendErrorZ.constr_from_ptr(ret);
+ CommonBase.add_ref_from(ret_hu_conv, entropy_source);
+ CommonBase.add_ref_from(ret_hu_conv, node_signer);
+ CommonBase.add_ref_from(ret_hu_conv, path);
+ CommonBase.add_ref_from(ret_hu_conv, contents);
+ CommonBase.add_ref_from(ret_hu_conv, reply_path);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Decode one layer of an incoming [`OnionMessage`].
+ *
+ * Returns either the next layer of the onion for forwarding or the decrypted content for the
+ * receiver.
+ */
+ public static constructor_peel_onion_message(msg: OnionMessage, node_signer: NodeSigner, logger: Logger, custom_handler: CustomOnionMessageHandler): Result_PeeledOnionNoneZ {
+ const ret: bigint = bindings.peel_onion_message(msg == null ? 0n : CommonBase.get_ptr_of(msg), CommonBase.get_ptr_of(node_signer), CommonBase.get_ptr_of(logger), CommonBase.get_ptr_of(custom_handler));
+ const ret_hu_conv: Result_PeeledOnionNoneZ = Result_PeeledOnionNoneZ.constr_from_ptr(ret);
+ CommonBase.add_ref_from(ret_hu_conv, msg);
+ CommonBase.add_ref_from(ret_hu_conv, node_signer);
+ CommonBase.add_ref_from(ret_hu_conv, logger);
+ CommonBase.add_ref_from(ret_hu_conv, custom_handler);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Returns whether `tlv_type` corresponds to a TLV record for Offers.
+ */
+ public static constructor_OffersMessage_is_known_type(tlv_type: bigint): boolean {
+ const ret: boolean = bindings.OffersMessage_is_known_type(tlv_type);
+ return ret;
+ }
+
+ /**
+ * Create a one-hop blinded path for a payment.
+ */
+ public static constructor_BlindedPath_one_hop_for_payment(payee_node_id: Uint8Array, payee_tlvs: ReceiveTlvs, entropy_source: EntropySource): Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ {
+ const ret: bigint = bindings.BlindedPath_one_hop_for_payment(bindings.encodeUint8Array(bindings.check_arr_len(payee_node_id, 33)), payee_tlvs == null ? 0n : CommonBase.get_ptr_of(payee_tlvs), CommonBase.get_ptr_of(entropy_source));
+ const ret_hu_conv: Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ = Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ.constr_from_ptr(ret);
+ CommonBase.add_ref_from(ret_hu_conv, payee_tlvs);
+ CommonBase.add_ref_from(ret_hu_conv, entropy_source);
+ return ret_hu_conv;
+ }
+