@ -1,7 +1,6 @@
import {
import {
ExtendedKind ,
ExtendedKind ,
FAST_READ_RELAY_URLS ,
FAST_READ_RELAY_URLS ,
FAST_WRITE_RELAY_URLS ,
MAX_CONCURRENT_RELAY_CONNECTIONS ,
MAX_CONCURRENT_RELAY_CONNECTIONS ,
METADATA_BATCH_AUTHORS_CHUNK ,
METADATA_BATCH_AUTHORS_CHUNK ,
METADATA_BATCH_QUERY_EOSE_TIMEOUT_MS ,
METADATA_BATCH_QUERY_EOSE_TIMEOUT_MS ,
@ -653,8 +652,8 @@ export class ReplaceableEventService {
includeFastReadRelays : true ,
includeFastReadRelays : true ,
includeFavoriteRelays : true ,
includeFavoriteRelays : true ,
includeLocalRelays : true ,
includeLocalRelays : true ,
/** Many users publish kind 0 to NIP-65 write relays; batch path skipped these before . */
/** Many users publish kind 0 to NIP-65 write relays; batch path includes public read mirrors via {@link buildComprehensiveRelayList} . */
includeFastWriteRelays : tru e,
includeFastWriteRelays : fals e,
includeSearchableRelays : false ,
includeSearchableRelays : false ,
preferPublicReadRelaysEarly : true
preferPublicReadRelaysEarly : true
} )
} )
@ -677,52 +676,39 @@ export class ReplaceableEventService {
)
)
) . filter ( Boolean )
) . filter ( Boolean )
} else if ( kind === kinds . Contacts ) {
} else if ( kind === kinds . Contacts ) {
// Contacts (kind 3): often on write relays; aggregators/profile mirrors also carry copies .
// Contacts (kind 3): aggregators + profile mirrors + fast read .
relayUrls = Array . from (
relayUrls = Array . from (
new Set (
new Set (
[
[ . . . READ_ONLY_RELAY_URLS , . . . PROFILE_FETCH_RELAY_URLS , . . . FAST_READ_RELAY_URLS ] . map (
. . . FAST_WRITE_RELAY_URLS ,
( u ) = > normalizeUrl ( u ) || u
. . . READ_ONLY_RELAY_URLS ,
)
. . . PROFILE_FETCH_RELAY_URLS ,
. . . FAST_READ_RELAY_URLS
] . map ( ( u ) = > normalizeUrl ( u ) || u )
)
)
) . filter ( Boolean )
) . filter ( Boolean )
} else if ( kind === kinds . RelayList ) {
} else if ( kind === kinds . RelayList ) {
// NIP-65 (10002): almost always on the author's write/outbox relays; FAST_READ-only misses most users .
// NIP-65 (10002): aggregators + profile mirrors + fast read .
relayUrls = Array . from (
relayUrls = Array . from (
new Set (
new Set (
[
[ . . . READ_ONLY_RELAY_URLS , . . . PROFILE_FETCH_RELAY_URLS , . . . FAST_READ_RELAY_URLS ] . map (
. . . FAST_WRITE_RELAY_URLS ,
( u ) = > normalizeUrl ( u ) || u
. . . READ_ONLY_RELAY_URLS ,
)
. . . PROFILE_FETCH_RELAY_URLS ,
. . . FAST_READ_RELAY_URLS
] . map ( ( u ) = > normalizeUrl ( u ) || u )
)
)
) . filter ( Boolean )
) . filter ( Boolean )
} else if ( kind === kinds . Mutelist || kind === kinds . BookmarkList ) {
} else if ( kind === kinds . Mutelist || kind === kinds . BookmarkList ) {
// Mute / bookmark lists: same distribution as contacts (writes + mirrors); FAST_READ-only misses many copie s.
// Mute / bookmark lists: same distribution as contacts; FAST_READ + mirror s.
relayUrls = Array . from (
relayUrls = Array . from (
new Set (
new Set (
[
[ . . . READ_ONLY_RELAY_URLS , . . . PROFILE_FETCH_RELAY_URLS , . . . FAST_READ_RELAY_URLS ] . map (
. . . FAST_WRITE_RELAY_URLS ,
( u ) = > normalizeUrl ( u ) || u
. . . READ_ONLY_RELAY_URLS ,
)
. . . PROFILE_FETCH_RELAY_URLS ,
. . . FAST_READ_RELAY_URLS
] . map ( ( u ) = > normalizeUrl ( u ) || u )
)
)
) . filter ( Boolean )
) . filter ( Boolean )
} else if ( kind === ExtendedKind . PAYMENT_INFO ) {
} else if ( kind === ExtendedKind . PAYMENT_INFO ) {
// NIP-A3 kind 10133: often published to the user's write relays only; FAST_READ alone misses many copies.
// NIP-A3 kind 10133: aggregators + profile mirrors + fast read.
// Mirror contacts + pin-list coverage (writes + profile mirrors + aggregators + fast read).
relayUrls = Array . from (
relayUrls = Array . from (
new Set (
new Set (
[
[ . . . READ_ONLY_RELAY_URLS , . . . PROFILE_FETCH_RELAY_URLS , . . . FAST_READ_RELAY_URLS ] . map (
. . . FAST_WRITE_RELAY_URLS ,
( u ) = > normalizeUrl ( u ) || u
. . . READ_ONLY_RELAY_URLS ,
)
. . . PROFILE_FETCH_RELAY_URLS ,
. . . FAST_READ_RELAY_URLS
] . map ( ( u ) = > normalizeUrl ( u ) || u )
)
)
) . filter ( Boolean )
) . filter ( Boolean )
} else {
} else {
@ -1174,7 +1160,7 @@ export class ReplaceableEventService {
includeFavoriteRelays : true ,
includeFavoriteRelays : true ,
includeProfileFetchRelays : true ,
includeProfileFetchRelays : true ,
includeFastReadRelays : true ,
includeFastReadRelays : true ,
includeFastWriteRelays : tru e,
includeFastWriteRelays : fals e,
includeSearchableRelays : true ,
includeSearchableRelays : true ,
includeLocalRelays : true
includeLocalRelays : true
} )
} )
@ -1400,7 +1386,7 @@ export class ReplaceableEventService {
/ * *
/ * *
* Fetch follow list event .
* Fetch follow list event .
* When relayUrls are provided ( e . g . user write + search relays ) , queries those directly .
* When relayUrls are provided ( e . g . user write + search relays ) , queries those directly .
* Otherwise uses the default relay set ( FAST_WRITE + PROFILE_FETCH + FAST_READ ) .
* Otherwise uses the default relay set ( READ_ONLY + PROFILE_FETCH + FAST_READ ) .
* /
* /
/** Hard cap: {@link fetchReplaceableEvent} can otherwise wedge the DataLoader chain when relays never answer. */
/** Hard cap: {@link fetchReplaceableEvent} can otherwise wedge the DataLoader chain when relays never answer. */
private static readonly FETCH_FOLLOW_LIST_REPLACEABLE_TIMEOUT_MS = 14 _000
private static readonly FETCH_FOLLOW_LIST_REPLACEABLE_TIMEOUT_MS = 14 _000
@ -1557,7 +1543,7 @@ export class ReplaceableEventService {
includeFavoriteRelays : true ,
includeFavoriteRelays : true ,
includeProfileFetchRelays : true ,
includeProfileFetchRelays : true ,
includeFastReadRelays : true ,
includeFastReadRelays : true ,
includeFastWriteRelays : tru e,
includeFastWriteRelays : fals e,
includeSearchableRelays : true ,
includeSearchableRelays : true ,
includeLocalRelays : true
includeLocalRelays : true
} )
} )