Skip to main content

SendPaymentCommandParams

Struct SendPaymentCommandParams 

Source
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 The key is the record type, and the value is the serialized data For example:

"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:

  1. this is only used for the private channels with the last hop.
  2. hop_hints is only a hint for 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

Source§

fn clone(&self) -> SendPaymentCommandParams

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SendPaymentCommandParams

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for SendPaymentCommandParams

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl JsonSchema for SendPaymentCommandParams

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

impl Serialize for SendPaymentCommandParams

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V