Skip to content

Commit 84d7323

Browse files
committed
feat: add identify field support to swarm.peers
includes the Identify object from the swarm/peers API response when the identify option is set to true. this enables consumers to access peer information like AgentVersion, Protocols, and PublicKey.
1 parent 7cc03b8 commit 84d7323

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/swarm/peers.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ export function createPeers (client: HTTPRPCClient): SwarmAPI['peers'] {
2222
latency: peer.Latency,
2323
streams: peer.Streams,
2424
// eslint-disable-next-line no-nested-ternary
25-
direction: peer.Direction == null ? undefined : peer.Direction === 0 ? 'inbound' : 'outbound'
25+
direction: peer.Direction == null ? undefined : peer.Direction === 0 ? 'inbound' : 'outbound',
26+
identify: peer.Identify
2627
}
2728
})
2829
}

0 commit comments

Comments
 (0)