Skip to main content

Module payment

Module payment 

Source
Expand description

Payment-related types.

Structs§

Attempt
A payment attempt.
BasicMppPaymentData
Bolt04 basic MPP payment data record
CurrentPaymentHopData
The decrypted hop data for the current hop, without the next_hop field.
HopHint
A hop hint is a hint for a node to use a specific channel, usually used for the last hop to the target node.
PaymentCustomRecords
The custom records to be included in the payment. The key is hex encoded of u32, and the value is hex encoded of Vec<u8> with 0x as prefix.
PaymentHopData
The data for a single hop in a payment route.
PaymentSession
A payment session tracking the state of a payment attempt.
RouterHop
A router hop information for a payment, a paymenter router is an array of RouterHop, a router hop generally implies hop target will receive amount_received with channel_outpoint of channel. Improper hop hint may make payment fail, for example the specified channel do not have enough capacity.
SendPaymentData
Data for sending a payment.
SessionRoute
The router is a list of nodes that the payment will go through. We store in the payment session and then will use it to track the payment history. The router is a list of nodes that the payment will go through. For example: A(amount, channel) -> B -> C -> D means A will send amount with channel to B.
SessionRouteNode
The node and channel information in a payment route hop
TimedResult
A timed payment result for a channel direction, used to track success/failure history for probability-based routing.
TlcErr
Structured TLC error with error code and optional extra data.
TrampolineContext
Context for trampoline routing payments.

Enums§

AttemptStatus
The status of a payment attempt.
Direction
The direction of a channel payment. Forward means from node_a to node_b; Backward means from node_b to node_a.
PaymentStatus
The status of a payment, will update as the payment progresses. The transfer path for payment status is Created -> Inflight -> Success | Failed.
TlcErrData
Extra data attached to a TLC error.
TlcErrorCode
Error codes for TLC (Time-Locked Contract) failures.

Constants§

DEFAULT_MAX_PARTS
Default maximum number of parts for a multi-part payment.
DEFAULT_PAYMENT_MPP_ATTEMPT_TRY_LIMIT
Default retry limit per attempt in MPP mode.
USER_CUSTOM_RECORDS_MAX_INDEX
0 ~ 65535 is reserved for endpoint usage, index above 65535 is reserved for internal usage