pub struct SendPaymentCommandParams {Show 17 fields
pub target_pubkey: Option<Pubkey>,
pub amount: Option<u128>,
pub payment_hash: Option<Hash256>,
pub final_tlc_expiry_delta: Option<u64>,
pub tlc_expiry_limit: Option<u64>,
pub invoice: Option<String>,
pub timeout: Option<u64>,
pub max_fee_amount: Option<u128>,
pub max_fee_rate: Option<u64>,
pub max_parts: Option<u64>,
pub trampoline_hops: Option<Vec<Pubkey>>,
pub keysend: Option<bool>,
pub udt_type_script: Option<Script>,
pub allow_self_payment: Option<bool>,
pub custom_records: Option<PaymentCustomRecords>,
pub hop_hints: Option<Vec<HopHint>>,
pub dry_run: Option<bool>,
}Expand description
Parameters for sending a payment.
Fields§
§target_pubkey: Option<Pubkey>The public key (Pubkey) of the payment target node, serialized as a hex string.
You can obtain a node’s pubkey via the node_info or graph_nodes RPC.
amount: Option<u128>the amount of the payment, the unit is Shannons for non UDT payment If not set and there is a invoice, the amount will be set to the invoice amount
payment_hash: Option<Hash256>the hash to use within the payment’s HTLC.
If not set and keysend is set to true, a random hash will be generated.
If not set and there is a payment_hash in the invoice, it will be used.
Otherwise, payment_hash need to be set.
final_tlc_expiry_delta: Option<u64>the TLC expiry delta should be used to set the timelock for the final hop, in milliseconds
tlc_expiry_limit: Option<u64>the TLC expiry limit for the whole payment, in milliseconds, each hop is with a default tlc delta of 1 day suppose the payment router is with N hops, the total tlc expiry limit is at least (N-1) days this is also the default value for the payment if this parameter is not provided
invoice: Option<String>the encoded invoice to send to the recipient
timeout: Option<u64>the payment timeout in seconds, if the payment is not completed within this time, it will be cancelled
max_fee_amount: Option<u128>the maximum fee amounts in shannons that the sender is willing to pay. Note: In trampoline routing mode, the sender will use the max_fee_amount as the total fee as much as possible.
max_fee_rate: Option<u64>the maximum fee rate per thousand, default is 5 (0.5%)
max_parts: Option<u64>max parts for the payment, only used for multi-part payments
trampoline_hops: Option<Vec<Pubkey>>Optional explicit trampoline hops.
When set to a non-empty list [t1, t2, ...], routing will only find a path from the
payer to t1, and the inner trampoline onion will encode t1 -> t2 -> ... -> final.
keysend: Option<bool>keysend payment
udt_type_script: Option<Script>udt type script for the payment
allow_self_payment: Option<bool>Allow paying yourself through a circular route, default is false.
This is useful for channel rebalancing: the payment flows out of one channel and
back through another, shifting liquidity between your channels without changing your
total balance (only routing fees are deducted).
Set target_pubkey to your own node pubkey and keysend to true to perform a rebalance.
Note: allow_self_payment is not compatible with trampoline routing.
custom_records: Option<PaymentCustomRecords>Some custom records for the payment which contains a map of u32 to Vec
"custom_records": {
"0x1": "0x01020304",
"0x2": "0x05060708",
"0x3": "0x090a0b0c",
"0x4": "0x0d0e0f10010d090a0b0c"
}hop_hints: Option<Vec<HopHint>>Optional route hints to reach the destination through private channels. Note:
- this is only used for the private channels with the last hop.
hop_hintsis only ahintfor routing algorithm, it is not a guarantee that the payment will be routed through the specified channels, it is up to the routing algorithm to decide whether to use the hints or not.
For example (pubkey, channel_outpoint, fee_rate, tlc_expiry_delta) suggest path router
to use the channel of channel_outpoint at hop with pubkey to forward the payment
and the fee rate is fee_rate and tlc_expiry_delta is tlc_expiry_delta.
dry_run: Option<bool>dry_run for payment, used for check whether we can build valid router and the fee for this payment, it’s useful for the sender to double check the payment before sending it to the network, default is false
Trait Implementations§
Source§impl Clone for SendPaymentCommandParams
impl Clone for SendPaymentCommandParams
Source§fn clone(&self) -> SendPaymentCommandParams
fn clone(&self) -> SendPaymentCommandParams
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SendPaymentCommandParams
impl Debug for SendPaymentCommandParams
Source§impl<'de> Deserialize<'de> for SendPaymentCommandParams
impl<'de> Deserialize<'de> for SendPaymentCommandParams
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for SendPaymentCommandParams
impl JsonSchema for SendPaymentCommandParams
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more