mirror of
https://github.com/aljazceru/ditto.git
synced 2026-01-07 15:44:22 +01:00
18 lines
452 B
TypeScript
18 lines
452 B
TypeScript
// deno-lint-ignore-file require-await
|
|
import { NostrEvent, NostrSigner } from '@nostrify/nostrify';
|
|
import { HTTPException } from 'hono';
|
|
|
|
export class ReadOnlySigner implements NostrSigner {
|
|
constructor(private pubkey: string) {}
|
|
|
|
async signEvent(): Promise<NostrEvent> {
|
|
throw new HTTPException(401, {
|
|
message: "Can't sign events with just an npub",
|
|
});
|
|
}
|
|
|
|
async getPublicKey(): Promise<string> {
|
|
return this.pubkey;
|
|
}
|
|
}
|