Create a sender for a single file.
The P2P sub-client of a configured Not3Client.
The file name announced to the receiver (encrypted on the wire).
The file size in bytes.
Optionalopts: { seed?: string }Optionalseed?: stringReuse a seed to restart a broken transfer in a new session.
Cancel the transfer, telling a connected peer about it.
A promise resolving once the abort was attempted.
Get the seed the file is encrypted with. Needed to build the share link.
The seed, handle with care.
Set a hook that is called whenever the transfer progress changes.
The hook to call.
Create the session and serve the file to whoever joins with the seed.
The source of file bytes.
A promise resolving once a receiver confirmed the full transfer.
Sends a single file of any size to a P2PReceiver over a WebRTC data channel, end-to-end encrypted with a seed the server never sees.
The session outlives a single peer: if the channel dies or a joiner cannot prove it holds the seed, the sender drops that peer and waits for the next one, which lets a receiver re-join and resume from its validated offset. Memory stays bounded — one chunk is read through
getBytesat a time and sending pauses whenever the channel's send buffer fills up.See