refactor: export SignedRegistryEntry
This commit is contained in:
parent
af36a49257
commit
5d26f1ec61
|
@ -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 { AbstractLevel, AbstractSublevel } from "abstract-level";
|
||||||
import {
|
import {
|
||||||
mkeyEd25519,
|
mkeyEd25519,
|
||||||
|
@ -16,13 +16,6 @@ import { EventEmitter } from "events";
|
||||||
import KeyPairEd25519 from "#ed25519.js";
|
import KeyPairEd25519 from "#ed25519.js";
|
||||||
import { S5Node, stringifyBytes } from "#node.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 {
|
export class RegistryService {
|
||||||
private db?: AbstractSublevel<
|
private db?: AbstractSublevel<
|
||||||
AbstractLevel<Uint8Array, string, Uint8Array>,
|
AbstractLevel<Uint8Array, string, Uint8Array>,
|
||||||
|
|
|
@ -97,3 +97,10 @@ export type P2PSignedMessageHandler = (
|
||||||
message: SignedMessage,
|
message: SignedMessage,
|
||||||
verifyId: boolean,
|
verifyId: boolean,
|
||||||
) => Promise<void>;
|
) => Promise<void>;
|
||||||
|
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue