diff --git a/packages/app/src/router.ts b/packages/app/src/router.ts index 421bd8e..9a1326e 100644 --- a/packages/app/src/router.ts +++ b/packages/app/src/router.ts @@ -1,36 +1,36 @@ import { intersection, first, - switcher, throttleWithValue, clamp, - last, - splitAt, - identity, sortBy, - uniq, shuffle, pushToMapKey, - now, - assoc, ctx, - sample, + always, + inc, + add, + ago, + take, + chunks, + MINUTE, + HOUR, + DAY, + WEEK, } from "@welshman/lib" import { - Tags, getFilterId, - unionFilters, isShareableRelayUrl, - isContextAddress, PROFILE, RELAYS, INBOX_RELAYS, FOLLOWS, LOCAL_RELAY_URL, WRAP, + getAncestorTags, + getPubkeyTagValues } from "@welshman/util" import type {TrustedEvent, Filter} from "@welshman/util" -import {ConnectionStatus, AuthStatus} from "@welshman/net" import type {RelaysAndFilters} from "@welshman/net" import {pubkey} from "./session" import { diff --git a/packages/net/src/Socket.ts b/packages/net/src/Socket.ts index af075ea..d99cdb8 100644 --- a/packages/net/src/Socket.ts +++ b/packages/net/src/Socket.ts @@ -63,9 +63,6 @@ export class Socket { } close = async () => { - if (this.cxn.url === 'wss://filter.nostr.wine/') { - console.trace('closing') - } this.worker.pause() this.ws?.close() diff --git a/packages/util/src/Address.ts b/packages/util/src/Address.ts index 8c95d9f..1684901 100644 --- a/packages/util/src/Address.ts +++ b/packages/util/src/Address.ts @@ -29,7 +29,7 @@ export class Address { let type let data = {} as any try { - ;({type, data} = nip19.decode(naddr) as { + ({type, data} = nip19.decode(naddr) as { type: "naddr" data: any }) diff --git a/packages/util/src/Tags.ts b/packages/util/src/Tags.ts index 5eec40b..5b350e1 100644 --- a/packages/util/src/Tags.ts +++ b/packages/util/src/Tags.ts @@ -116,8 +116,6 @@ export class Tags extends (Fluent as OmitStatics, "from" return parents.get("e") || parents.get("a") } - context = () => this.whereKey("a").filter(t => t.isContext()) - asObject = () => { const result: Record = {} @@ -146,14 +144,6 @@ export class Tags extends (Fluent as OmitStatics, "from" setTag = (k: string, ...args: string[]) => this.rejectByKey([k]).addTag(k, ...args) - // Context - - addContext = (addresses: string[]) => this.concat(addresses.map(a => Tag.from(["a", a]))) - - removeContext = () => this.reject(t => t.isContext()) - - setContext = (addresses: string[]) => this.removeContext().addContext(addresses) - // Images addImages = (imeta: Tags[]) =>