Add ping policy

This commit is contained in:
Jon Staab
2026-01-06 21:18:15 -08:00
parent de9d137b57
commit c850ab405c
3 changed files with 40 additions and 155 deletions
+3 -2
View File
@@ -5,6 +5,7 @@ import {
TrustedEvent,
getRelaysFromList,
RelayMode,
Filter,
} from "@welshman/util"
import {
deriveItemsByKey,
@@ -52,9 +53,9 @@ export const deriveRelayList = makeDeriveItem(relayListsByPubkey, loadRelayList)
// Outbox loader
export const makeOutboxLoader =
(kind: number) =>
(kind: number, filter: Filter = {}) =>
async (pubkey: string, relayHints: string[] = []) => {
const filters = [{kinds: [kind], authors: [pubkey]}]
const filters = [{...filter, kinds: [kind], authors: [pubkey]}]
const relays = Router.get().FromRelays(relayHints).policy(addMinimalFallbacks).getUrls()
await Promise.all([