@@ -6,8 +6,7 @@ import { anySignal } from 'any-signal'
66import toIt from 'browser-readablestream-to-it'
77import { unmarshal , type IPNSRecord , marshal , peerIdToRoutingKey } from 'ipns'
88import { ipnsValidator } from 'ipns/validator'
9- // @ts -expect-error no types
10- import ndjson from 'iterable-ndjson'
9+ import { parse as ndjson } from 'it-ndjson'
1110import defer from 'p-defer'
1211import PQueue from 'p-queue'
1312import type { DelegatedRoutingV1HttpApiClient , DelegatedRoutingV1HttpApiClientInit , PeerRecord } from './index.js'
@@ -107,7 +106,7 @@ export class DefaultDelegatedRoutingV1HttpApiClient implements DelegatedRoutingV
107106 }
108107 }
109108
110- async * getPeerInfo ( peerId : PeerId , options : AbortOptions | undefined = { } ) : AsyncGenerator < PeerRecord , any , unknown > {
109+ async * getPeers ( peerId : PeerId , options : AbortOptions | undefined = { } ) : AsyncGenerator < PeerRecord , any , unknown > {
111110 log ( 'getPeers starts: %c' , peerId )
112111
113112 const signal = anySignal ( [ this . shutDownController . signal , options . signal , AbortSignal . timeout ( this . timeout ) ] )
@@ -228,6 +227,7 @@ export class DefaultDelegatedRoutingV1HttpApiClient implements DelegatedRoutingV
228227 // Peer schema can have additional, user-defined, fields.
229228 record . ID = peerIdFromString ( record . ID )
230229 record . Addrs = record . Addrs . map ( multiaddr )
230+ record . Protocols = record . Protocols ?? [ ]
231231 return record
232232 }
233233
0 commit comments