mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 03:19:46 +00:00
18 lines
484 B
TypeScript
18 lines
484 B
TypeScript
// deno-lint-ignore-file require-await
|
|
import { HTTPException } from '@hono/hono/http-exception';
|
|
|
|
import type { NostrEvent, NostrSigner } from '@nostrify/nostrify';
|
|
|
|
export class ReadOnlySigner implements NostrSigner {
|
|
constructor(private pubkey: string) {}
|
|
|
|
async signEvent(): Promise<NostrEvent> {
|
|
throw new HTTPException(401, {
|
|
message: 'Log in with Nostr Connect to sign events',
|
|
});
|
|
}
|
|
|
|
async getPublicKey(): Promise<string> {
|
|
return this.pubkey;
|
|
}
|
|
}
|