move @snort/nostr code into System
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import { HexKey, RelaySettings } from "@snort/nostr";
|
||||
import { HexKey, RelaySettings } from "System";
|
||||
import * as secp from "@noble/curves/secp256k1";
|
||||
import * as utils from "@noble/curves/abstract/utils";
|
||||
|
||||
@ -8,6 +8,7 @@ import { generateBip39Entropy, entropyToPrivateKey } from "nip6";
|
||||
import { bech32ToHex, dedupeById, randomSample, sanitizeRelayUrl, unixNowMs, unwrap } from "SnortUtils";
|
||||
import { SubscriptionEvent } from "Subscription";
|
||||
import { EventPublisher } from "System/EventPublisher";
|
||||
import { System } from "index";
|
||||
|
||||
export function setRelays(state: LoginSession, relays: Record<string, RelaySettings>, createdAt: number) {
|
||||
if (state.relays.timestamp >= createdAt) {
|
||||
@ -78,7 +79,7 @@ export async function generateNewLogin() {
|
||||
}
|
||||
|
||||
const publicKey = utils.bytesToHex(secp.schnorr.getPublicKey(privateKey));
|
||||
const publisher = new EventPublisher(publicKey, privateKey);
|
||||
const publisher = new EventPublisher(System, publicKey, privateKey);
|
||||
const ev = await publisher.contactList([bech32ToHex(SnortPubKey), publicKey], newRelays);
|
||||
publisher.broadcast(ev);
|
||||
|
||||
|
Reference in New Issue
Block a user