mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
17 lines
478 B
TypeScript
17 lines
478 B
TypeScript
// deno-lint-ignore-file require-await
|
|
import { HTTPException } from '@hono/hono/http-exception';
|
|
import { 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;
|
|
}
|
|
}
|