Class LocalPeers

Hierarchy

  • TypedEmitter
    • LocalPeers

Constructors

  • Parameters

    • Optionalopts: {
          logger: undefined | Logger;
      } = {}

    Returns LocalPeers

Accessors

  • get peers(): (PeerInfoBase & {
        connectedAt: number;
        protomux: Protomux<NoiseSecretStream<Duplex<any, any, any, any, true, true, DuplexEvents<any, any>>>>;
        status: "connected";
    } | PeerInfoBase & {
        disconnectedAt: number;
        status: "disconnected";
    })[]
  • Returns (PeerInfoBase & {
        connectedAt: number;
        protomux: Protomux<NoiseSecretStream<Duplex<any, any, any, any, true, true, DuplexEvents<any, any>>>>;
        status: "connected";
    } | PeerInfoBase & {
        disconnectedAt: number;
        status: "disconnected";
    })[]

Methods

  • Parameters

    • deviceId: string
    • buf: Buffer

    Returns Promise<void>

  • Connect to a peer over an existing NoiseSecretStream

    Parameters

    • stream: NoiseSecretStream<any>

      a NoiseSecretStream from @hyperswarm/secret-stream

    Returns ReplicationStream

  • Parameters

    • deviceId: string

      id of the peer you want to send to (publicKey of peer as hex string)

    • deviceInfo: DeviceInfo

      device info to send

    Returns Promise<void>

  • Parameters

    • deviceId: string
    • invite: Invite

    Returns Promise<void>

  • Parameters

    • deviceId: string
    • inviteCancel: InviteCancel

    Returns Promise<void>

  • Respond to an invite from a peer

    Parameters

    • deviceId: string

      id of the peer you want to respond to (publicKey of peer as hex string)

    • inviteResponse: InviteResponse

    Returns Promise<void>

  • Parameters

    • deviceId: string
    • details: ProjectJoinDetails

    Returns Promise<void>