We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 992ca72 commit d627989Copy full SHA for d627989
bot/modules/nostr/config.ts
@@ -1,7 +1,8 @@
1
-const notsrPure = require('nostr-tools/pure');
2
-const { SimplePool } = require('nostr-tools/pool');
+import notsrPure from 'nostr-tools';
+import { SimplePool } from 'nostr-tools';
3
4
-const sk = process.env.NOSTR_SK || notsrPure.generateSecretKey();
+const nostrSkEnvVar = process.env.NOSTR_SK
5
+const sk = nostrSkEnvVar ? Buffer.from(nostrSkEnvVar, 'hex') : notsrPure.generateSecretKey();
6
const pk = notsrPure.getPublicKey(sk);
7
8
export const getPrivateKey = () => sk;
bot/modules/nostr/events.ts
@@ -1,4 +1,4 @@
-const { finalizeEvent, verifyEvent } = require('nostr-tools/pure');
+import { finalizeEvent, verifyEvent } from 'nostr-tools';
import * as Config from './config';
import { Community } from '../../../models';
0 commit comments