buildTrampolineToLegacyPacket

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.

Return

a (firstAmount, firstExpiry, onion) triple where:

  • firstAmount is the amount for the trampoline node in the route

  • firstExpiry is the cltv expiry for the first trampoline node in the route

  • the trampoline onion to include in final payload of a normal onion

Parameters

invoice

Bolt 11 invoice (features and routing hints will be provided to the next-to-last node).

hops

the trampoline hops (including ourselves in the first hop, and the non-trampoline final recipient in the last hop).

finalPayload

payload data for the final node (amount, expiry, etc)