export declare const NET_PACKET_ONION_ANNOUNCE_REQUEST = 131; export declare const NET_PACKET_ONION_ANNOUNCE_RESPONSE = 132; export declare const NET_PACKET_ONION_DATA_REQUEST = 133; export declare const NET_PACKET_ONION_DATA_RESPONSE = 134; export declare const ONION_FRIEND_REQUEST_ID = 32; export declare const NET_PACKET_ONION_REQUEST_0 = 128; export type OnionAnnounceResponse = { sendBack: Uint8Array; isStored: number; pingOrDataPublicKey: Uint8Array; nodes: Uint8Array; }; export declare function createOnionAnnounceRequest(opts: { senderPublicKey: Uint8Array; senderSecretKey: Uint8Array; nodePublicKey: Uint8Array; pingId: Uint8Array; searchPublicKey: Uint8Array; dataPublicKey: Uint8Array; sendBack: Uint8Array; }): Uint8Array; export declare function openOnionAnnounceResponse(packet: Uint8Array, opts: { requesterSecretKey: Uint8Array; nodePublicKey: Uint8Array; }): OnionAnnounceResponse | undefined; export declare function createOnionDataRequest(opts: { destinationPublicKey: Uint8Array; routePublicKey: Uint8Array; nonce: Uint8Array; onionDataPacket: Uint8Array; }): Uint8Array; export declare function createOnionDataPacket(opts: { senderPublicKey: Uint8Array; senderSecretKey: Uint8Array; receiverPublicKey: Uint8Array; nonce: Uint8Array; innerPacketId: number; innerPayload: Uint8Array; }): Uint8Array; export declare function createOnionRequest0(opts: { nodeAPublicKey: Uint8Array; nodeBHost: string; nodeBPort: number; nodeBPublicKey: Uint8Array; nodeCHost: string; nodeCPort: number; nodeCPublicKey: Uint8Array; nodeDHost: string; nodeDPort: number; payloadForNodeD: Uint8Array; }): Uint8Array; /** * Build an onion request to send OVER A TCP RELAY (toxcore * onion.c::create_onion_packet_tcp). When the onion path's first hop is a TCP * relay we're already connected to, the relay itself acts as node A — so the * packet OMITS node A's layer and is sent as the payload of TCP_PACKET_ONION_ * REQUEST. The relay forwards it to node B over UDP and routes the response * back to us over the same TCP connection (TCP_PACKET_ONION_RESPONSE). * * This is the NAT-resilient discovery path native Beagle uses as primary: * self-announce and friend-route lookups survive a NAT that drops the UDP * onion return path, because the TCP relay handles the round-trip. * * Layout (== create_onion_packet_tcp): the UDP builder's inner `bPart` with a * bare nonce prepended (no NET_PACKET_ONION_REQUEST_0 type byte, no node-A box): * [nonce 24][ipport(B)][tempPubB 32][box_B([ipport(C)][tempPubC 32][box_C([ipport(D)][payload])])] */ export declare function createOnionRequest0Tcp(opts: { nodeBHost: string; nodeBPort: number; nodeBPublicKey: Uint8Array; nodeCHost: string; nodeCPort: number; nodeCPublicKey: Uint8Array; nodeDHost: string; nodeDPort: number; payloadForNodeD: Uint8Array; }): Uint8Array; export declare function openOnionDataResponse(packet: Uint8Array, opts: { dataSecretKey: Uint8Array; }): { nonce: Uint8Array; sourceTempPublicKey: Uint8Array; payload: Uint8Array; } | undefined; export declare function openOnionDataPacket(payload: Uint8Array, opts: { receiverSecretKey: Uint8Array; nonce: Uint8Array; }): { senderPublicKey: Uint8Array; innerPacketId: number; innerPayload: Uint8Array; } | undefined;