lightningdevkit
Version:
Lightning Development Kit
132 lines (131 loc) • 5.76 kB
text/typescript
import { Option_u64Z } from '../structs/Option_u64Z.mjs';
import { PendingHTLCRouting } from '../structs/PendingHTLCRouting.mjs';
import { Result_PendingHTLCInfoDecodeErrorZ } from '../structs/Result_PendingHTLCInfoDecodeErrorZ.mjs';
import { CommonBase } from './CommonBase.mjs';
/**
* Information about an incoming HTLC, including the [`PendingHTLCRouting`] describing where it
* should go next.
*/
export declare class PendingHTLCInfo extends CommonBase {
/**
* Further routing details based on whether the HTLC is being forwarded or received.
*/
get_routing(): PendingHTLCRouting;
/**
* Further routing details based on whether the HTLC is being forwarded or received.
*/
set_routing(val: PendingHTLCRouting): void;
/**
* The onion shared secret we build with the sender used to decrypt the onion.
*
* This is later used to encrypt failure packets in the event that the HTLC is failed.
*/
get_incoming_shared_secret(): Uint8Array;
/**
* The onion shared secret we build with the sender used to decrypt the onion.
*
* This is later used to encrypt failure packets in the event that the HTLC is failed.
*/
set_incoming_shared_secret(val: Uint8Array): void;
/**
* Hash of the payment preimage, to lock the payment until the receiver releases the preimage.
*/
get_payment_hash(): Uint8Array;
/**
* Hash of the payment preimage, to lock the payment until the receiver releases the preimage.
*/
set_payment_hash(val: Uint8Array): void;
/**
* Amount received in the incoming HTLC.
*
* This field was added in LDK 0.0.113 and will be `None` for objects written by prior
* versions.
*/
get_incoming_amt_msat(): Option_u64Z;
/**
* Amount received in the incoming HTLC.
*
* This field was added in LDK 0.0.113 and will be `None` for objects written by prior
* versions.
*/
set_incoming_amt_msat(val: Option_u64Z): void;
/**
* The amount the sender indicated should be forwarded on to the next hop or amount the sender
* intended for us to receive for received payments.
*
* If the received amount is less than this for received payments, an intermediary hop has
* attempted to steal some of our funds and we should fail the HTLC (the sender should retry
* it along another path).
*
* Because nodes can take less than their required fees, and because senders may wish to
* improve their own privacy, this amount may be less than [`Self::incoming_amt_msat`] for
* received payments. In such cases, recipients must handle this HTLC as if it had received
* [`Self::outgoing_amt_msat`].
*/
get_outgoing_amt_msat(): bigint;
/**
* The amount the sender indicated should be forwarded on to the next hop or amount the sender
* intended for us to receive for received payments.
*
* If the received amount is less than this for received payments, an intermediary hop has
* attempted to steal some of our funds and we should fail the HTLC (the sender should retry
* it along another path).
*
* Because nodes can take less than their required fees, and because senders may wish to
* improve their own privacy, this amount may be less than [`Self::incoming_amt_msat`] for
* received payments. In such cases, recipients must handle this HTLC as if it had received
* [`Self::outgoing_amt_msat`].
*/
set_outgoing_amt_msat(val: bigint): void;
/**
* The CLTV the sender has indicated we should set on the forwarded HTLC (or has indicated
* should have been set on the received HTLC for received payments).
*/
get_outgoing_cltv_value(): number;
/**
* The CLTV the sender has indicated we should set on the forwarded HTLC (or has indicated
* should have been set on the received HTLC for received payments).
*/
set_outgoing_cltv_value(val: number): void;
/**
* The fee taken for this HTLC in addition to the standard protocol HTLC fees.
*
* If this is a payment for forwarding, this is the fee we are taking before forwarding the
* HTLC.
*
* If this is a received payment, this is the fee that our counterparty took.
*
* This is used to allow LSPs to take fees as a part of payments, without the sender having to
* shoulder them.
*/
get_skimmed_fee_msat(): Option_u64Z;
/**
* The fee taken for this HTLC in addition to the standard protocol HTLC fees.
*
* If this is a payment for forwarding, this is the fee we are taking before forwarding the
* HTLC.
*
* If this is a received payment, this is the fee that our counterparty took.
*
* This is used to allow LSPs to take fees as a part of payments, without the sender having to
* shoulder them.
*/
set_skimmed_fee_msat(val: Option_u64Z): void;
/**
* Constructs a new PendingHTLCInfo given each field
*/
static constructor_new(routing_arg: PendingHTLCRouting, incoming_shared_secret_arg: Uint8Array, payment_hash_arg: Uint8Array, incoming_amt_msat_arg: Option_u64Z, outgoing_amt_msat_arg: bigint, outgoing_cltv_value_arg: number, skimmed_fee_msat_arg: Option_u64Z): PendingHTLCInfo;
clone_ptr(): bigint;
/**
* Creates a copy of the PendingHTLCInfo
*/
clone(): PendingHTLCInfo;
/**
* Serialize the PendingHTLCInfo object into a byte array which can be read by PendingHTLCInfo_read
*/
write(): Uint8Array;
/**
* Read a PendingHTLCInfo from a byte array, created by PendingHTLCInfo_write
*/
static constructor_read(ser: Uint8Array): Result_PendingHTLCInfoDecodeErrorZ;
}