OutgoingPaymentPacket

object OutgoingPaymentPacket

Functions

buildCommand
Link copied to clipboard
common
fun buildCommand(paymentId: UUID, paymentHash: ByteVector32, hops: List<ChannelHop>, finalPayload: PaymentOnion.FinalPayload): Pair<CMD_ADD_HTLC, SharedSecrets>

Build the command to add an HTLC with the given final payload and using the provided hops.

buildHtlcFailure
Link copied to clipboard
common
fun buildHtlcFailure(nodeSecret: PrivateKey, paymentHash: ByteVector32, onion: OnionRoutingPacket, reason: CMD_FAIL_HTLC.Reason): Either<FailureMessage, ByteVector>
buildPacket
Link copied to clipboard
common
fun buildPacket(paymentHash: ByteVector32, hops: List<Hop>, finalPayload: PaymentOnion.FinalPayload, payloadLength: Int): Triple<MilliSatoshi, CltvExpiry, PacketAndSecrets>

Build an encrypted onion packet with the given final payload.

buildTrampolineToLegacyPacket
Link copied to clipboard
common

Build an encrypted trampoline onion packet when the final recipient doesn't support trampoline. The next-to-last trampoline node payload will contain instructions to convert to a legacy payment.