diff --git a/src/service/registry.ts b/src/service/registry.ts index 0f31650..2062c2d 100644 --- a/src/service/registry.ts +++ b/src/service/registry.ts @@ -1,4 +1,4 @@ -import { Logger, Peer, S5Config } from "#types.js"; +import { Logger, Peer, S5Config, SignedRegistryEntry } from "#types.js"; import { AbstractLevel, AbstractSublevel } from "abstract-level"; import { mkeyEd25519, @@ -16,13 +16,6 @@ import { EventEmitter } from "events"; import KeyPairEd25519 from "#ed25519.js"; import { S5Node, stringifyBytes } from "#node.js"; -export interface SignedRegistryEntry { - pk: Uint8Array; // public key with multicodec prefix - revision: number; // revision number of this entry, maximum is (256^8)-1 - data: Uint8Array; // data stored in this entry, can have a maximum length of 48 bytes - signature: Uint8Array; // signature of this registry entry -} - export class RegistryService { private db?: AbstractSublevel< AbstractLevel, diff --git a/src/types.ts b/src/types.ts index 454f544..2e3e2b0 100644 --- a/src/types.ts +++ b/src/types.ts @@ -97,3 +97,10 @@ export type P2PSignedMessageHandler = ( message: SignedMessage, verifyId: boolean, ) => Promise; + +export interface SignedRegistryEntry { + pk: Uint8Array; // public key with multicodec prefix + revision: number; // revision number of this entry, maximum is (256^8)-1 + data: Uint8Array; // data stored in this entry, can have a maximum length of 48 bytes + signature: Uint8Array; // signature of this registry entry +}