UNPKG

@libp2p/floodsub

Version:

libp2p-floodsub, also known as pubsub-flood or just dumbsub, this implementation of pubsub focused on delivering an API for Publish/Subscribe, but with no CastTree Forming (it just floods the network).

23 lines 966 B
import type { PubSubRPCMessage } from './floodsub.ts'; import type { SignedMessage } from './index.ts'; import type { PeerId, PrivateKey, PublicKey } from '@libp2p/interface'; export declare const SignPrefix: Uint8Array<ArrayBufferLike>; /** * Signs the provided message with the given `peerId` */ export declare function signMessage(privateKey: PrivateKey, message: { from: PeerId; topic: string; data: Uint8Array; sequenceNumber: bigint; }, encode: (rpc: PubSubRPCMessage) => Uint8Array): Promise<SignedMessage>; /** * Verifies the signature of the given message */ export declare function verifySignature(message: SignedMessage, encode: (rpc: PubSubRPCMessage) => Uint8Array): Promise<boolean>; /** * Returns the PublicKey associated with the given message. * If no valid PublicKey can be retrieved an error will be returned. */ export declare function messagePublicKey(message: SignedMessage): PublicKey; //# sourceMappingURL=sign.d.ts.map