Add APISigner and AdminSigner classes, implement NostrSigner interface

This commit is contained in:
Alex Gleason
2024-02-12 11:52:05 -06:00
parent 1e3f637358
commit 59d53c4a2f
9 changed files with 146 additions and 133 deletions

View File

@@ -15,7 +15,7 @@ import { eventAge, isRelay, nostrDate, nostrNow, Time } from '@/utils.ts';
import { fetchWorker } from '@/workers/fetch.ts';
import { TrendsWorker } from '@/workers/trends.ts';
import { verifyEventWorker } from '@/workers/verify.ts';
import { signAdminEvent } from '@/sign.ts';
import { AdminSigner } from '@/signers/AdminSigner.ts';
import { lnurlCache } from '@/utils/lnurl.ts';
const debug = Debug('ditto:pipeline');
@@ -194,7 +194,9 @@ async function payZap(event: DittoEvent, signal: AbortSignal) {
{ fetch: fetchWorker, signal },
);
const nwcRequestEvent = await signAdminEvent({
const signer = new AdminSigner();
const nwcRequestEvent = await signer.signEvent({
kind: 23194,
content: await encryptAdmin(
event.pubkey,