Skip to content

Commit

Permalink
use nostrify types
Browse files Browse the repository at this point in the history
  • Loading branch information
shuesken committed Aug 11, 2024
1 parent 3542c54 commit fe23bb2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/nostr/relays.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export const _publish = async (event: NostrEvent): Promise<void> => {

type SubscribeParams = {
filters: Filter[];
onEvent: (event: nostrify.NostrEvent) => void;
onEvent: (event: NostrEvent) => void;
};
export const _query = async ({
filters,
Expand Down
4 changes: 2 additions & 2 deletions src/nostr/subscribe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ export const subscribe = async ({
: eventsBaseFilter;
const eventsFilterWithLimit = { ...eventsFilter, limit };

const noteEventsQueue: nostrify.NostrEvent[] = [];
const noteEventsQueue: NostrEvent[] = [];

const onNoteEvent = (event: nostrify.NostrEvent) => {
const onNoteEvent = (event: NostrEvent) => {
// if (isDev()) console.log("#gITVd2 gotNoteEvent", event);

if (
Expand Down
2 changes: 1 addition & 1 deletion src/nostr/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const filterForTag = (key: string) => (tags: string[]) =>

type GetTagFirstValueFromEventParams = {
/** The event to extract the tag value from */
event: nostrify.NostrEvent;
event: NostrEvent;
/** The name (key) of the tag to get the value of */
tag: string;
};
Expand Down
6 changes: 3 additions & 3 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Event } from "nostr-tools";
import * as nostrify from "@nostrify/nostrify";

export type MaybeLocalStorage = Partial<WindowLocalStorage>;

export type NostrEvent = Required<Event>;
export type NostrEvent = nostrify.NostrEvent;

export type UnsignedEvent = Omit<Event, "created_at" | "pubkey">;
export type UnsignedEvent = Omit<NostrEvent, "created_at" | "pubkey">;

export type Note = {
id: string;
Expand Down

0 comments on commit fe23bb2

Please sign in to comment.