Package org.ldk.structs
Class PaymentParameters
- java.lang.Object
-
- org.ldk.structs.PaymentParameters
-
public class PaymentParameters extends Object
The recipient of a payment.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description PaymentParametersclone()Creates a copy of the PaymentParametersbooleaneq(PaymentParameters b)Checks if two PaymentParameterss contain equal inner contents.booleanequals(Object o)protected voidfinalize()static PaymentParametersfor_keysend(byte[] payee_pubkey)Creates a payee with the node id of the given `pubkey` to use for keysend payments.static PaymentParametersfrom_node_id(byte[] payee_pubkey)Creates a payee with the node id of the given `pubkey`.Option_u64Zget_expiry_time()Expiration of a payment to the payee, in seconds relative to the UNIX epoch.InvoiceFeaturesget_features()Features supported by the payee.intget_max_total_cltv_expiry_delta()The maximum total CLTV delta we accept for the route.byte[]get_payee_pubkey()The node id of the payee.RouteHint[]get_route_hints()Hints for routing to the payee, containing channels connecting the payee to public nodes.longhash()Checks if two PaymentParameterss contain equal inner contents.inthashCode()static PaymentParametersof(byte[] payee_pubkey_arg, InvoiceFeatures features_arg, RouteHint[] route_hints_arg, Option_u64Z expiry_time_arg, int max_total_cltv_expiry_delta_arg)Constructs a new PaymentParameters given each fieldstatic Result_PaymentParametersDecodeErrorZread(byte[] ser)Read a PaymentParameters from a byte array, created by PaymentParameters_writevoidset_expiry_time(Option_u64Z val)Expiration of a payment to the payee, in seconds relative to the UNIX epoch.voidset_features(InvoiceFeatures val)Features supported by the payee.voidset_max_total_cltv_expiry_delta(int val)The maximum total CLTV delta we accept for the route.voidset_payee_pubkey(byte[] val)The node id of the payee.voidset_route_hints(RouteHint[] val)Hints for routing to the payee, containing channels connecting the payee to public nodes.byte[]write()Serialize the PaymentParameters object into a byte array which can be read by PaymentParameters_read
-
-
-
Method Detail
-
finalize
protected void finalize() throws Throwable
-
get_payee_pubkey
public byte[] get_payee_pubkey()
The node id of the payee.
-
set_payee_pubkey
public void set_payee_pubkey(byte[] val)
The node id of the payee.
-
get_features
@Nullable public InvoiceFeatures get_features()
Features supported by the payee. May be set from the payee's invoice or via [`for_keysend`]. May be `None` if the invoice does not contain any features. [`for_keysend`]: Self::for_keysend Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
-
set_features
public void set_features(@Nullable InvoiceFeatures val)
Features supported by the payee. May be set from the payee's invoice or via [`for_keysend`]. May be `None` if the invoice does not contain any features. [`for_keysend`]: Self::for_keysend Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
-
get_route_hints
public RouteHint[] get_route_hints()
Hints for routing to the payee, containing channels connecting the payee to public nodes.
-
set_route_hints
public void set_route_hints(RouteHint[] val)
Hints for routing to the payee, containing channels connecting the payee to public nodes.
-
get_expiry_time
public Option_u64Z get_expiry_time()
Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
-
set_expiry_time
public void set_expiry_time(Option_u64Z val)
Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
-
get_max_total_cltv_expiry_delta
public int get_max_total_cltv_expiry_delta()
The maximum total CLTV delta we accept for the route.
-
set_max_total_cltv_expiry_delta
public void set_max_total_cltv_expiry_delta(int val)
The maximum total CLTV delta we accept for the route.
-
of
public static PaymentParameters of(byte[] payee_pubkey_arg, InvoiceFeatures features_arg, RouteHint[] route_hints_arg, Option_u64Z expiry_time_arg, int max_total_cltv_expiry_delta_arg)
Constructs a new PaymentParameters given each field
-
clone
public PaymentParameters clone()
Creates a copy of the PaymentParameters
-
hash
public long hash()
Checks if two PaymentParameterss contain equal inner contents.
-
eq
public boolean eq(PaymentParameters b)
Checks if two PaymentParameterss contain equal inner contents. This ignores pointers and is_owned flags and looks at the values in fields. Two objects with NULL inner values will be considered "equal" here.
-
write
public byte[] write()
Serialize the PaymentParameters object into a byte array which can be read by PaymentParameters_read
-
read
public static Result_PaymentParametersDecodeErrorZ read(byte[] ser)
Read a PaymentParameters from a byte array, created by PaymentParameters_write
-
from_node_id
public static PaymentParameters from_node_id(byte[] payee_pubkey)
Creates a payee with the node id of the given `pubkey`.
-
for_keysend
public static PaymentParameters for_keysend(byte[] payee_pubkey)
Creates a payee with the node id of the given `pubkey` to use for keysend payments.
-
-