create

fun create(sessionKey: PrivateKey, publicKeys: List<PublicKey>, payloads: List<ByteArray>, associatedData: ByteVector32, packetLength: Int): PacketAndSecrets

Create an encrypted onion packet that contains payloads for all nodes in the list.

Return

An onion packet with all shared secrets. The onion packet can be sent to the first node in the list, and the shared secrets (one per node) can be used to parse returned failure messages if needed.

Parameters

sessionKey

session key.

publicKeys

node public keys (one per node).

payloads

payloads (one per node).

associatedData

associated data.

packetLength

length of the onion-encrypted payload (1300 for payment onions, 400 for trampoline onions).