Browse Source

graph working now

master
limina1 8 months ago
parent
commit
8f3807324a
  1. 545
      package-lock.json
  2. 6
      src/lib/navigator/EventNetwork/utils/networkBuilder.ts
  3. 3
      src/lib/utils/event_search.ts
  4. 3
      src/lib/utils/search_types.ts

545
package-lock.json generated

File diff suppressed because it is too large Load Diff

6
src/lib/navigator/EventNetwork/utils/networkBuilder.ts

@ -8,7 +8,7 @@
import type { NDKEvent } from "@nostr-dev-kit/ndk"; import type { NDKEvent } from "@nostr-dev-kit/ndk";
import type { NetworkNode, NetworkLink, GraphData, GraphState } from "../types"; import type { NetworkNode, NetworkLink, GraphData, GraphState } from "../types";
import { nip19 } from "nostr-tools"; import { nip19 } from "nostr-tools";
import { standardRelays } from "$lib/consts"; import { communityRelays } from "$lib/consts";
import { getMatchingTags } from '$lib/utils/nostrUtils'; import { getMatchingTags } from '$lib/utils/nostrUtils';
import { getDisplayNameSync } from '$lib/utils/profileCache'; import { getDisplayNameSync } from '$lib/utils/profileCache';
import { createDebugFunction } from "./common"; import { createDebugFunction } from "./common";
@ -62,13 +62,13 @@ export function createNetworkNode(
pubkey: event.pubkey, pubkey: event.pubkey,
identifier: dTag, identifier: dTag,
kind: event.kind, kind: event.kind,
relays: standardRelays, relays: communityRelays,
}); });
// Create nevent (NIP-19 event reference) for the event // Create nevent (NIP-19 event reference) for the event
node.nevent = nip19.neventEncode({ node.nevent = nip19.neventEncode({
id: event.id, id: event.id,
relays: standardRelays, relays: communityRelays,
kind: event.kind, kind: event.kind,
}); });
} catch (error) { } catch (error) {

3
src/lib/utils/event_search.ts

@ -1,7 +1,8 @@
import { ndkInstance } from "../ndk.ts"; import { ndkInstance } from "../ndk.ts";
import { fetchEventWithFallback } from "./nostrUtils.ts"; import { fetchEventWithFallback } from "./nostrUtils.ts";
import { nip19 } from "nostr-tools"; import { nip19 } from "nostr-tools";
import { NDKEvent, NDKFilter } from "@nostr-dev-kit/ndk"; import { NDKEvent } from "@nostr-dev-kit/ndk";
import type { NDKFilter } from "@nostr-dev-kit/ndk";
import { get } from "svelte/store"; import { get } from "svelte/store";
import { wellKnownUrl, isValidNip05Address } from "./search_utils.ts"; import { wellKnownUrl, isValidNip05Address } from "./search_utils.ts";
import { TIMEOUTS, VALIDATION } from "./search_constants.ts"; import { TIMEOUTS, VALIDATION } from "./search_constants.ts";

3
src/lib/utils/search_types.ts

@ -1,4 +1,5 @@
import { NDKEvent, NDKFilter, NDKSubscription } from "@nostr-dev-kit/ndk"; import { NDKEvent, NDKSubscription } from "@nostr-dev-kit/ndk";
import type { NDKFilter } from "@nostr-dev-kit/ndk";
/** /**
* Extended NostrProfile interface for search results * Extended NostrProfile interface for search results

Loading…
Cancel
Save