Creates a new instance of LairClient
and returns the instance when the client has connected.
address
- a connection address passed tonet.createConnection( address )
Returns a promise that is fulfilled by the socket's "connect" event.
Write the given bytes
to the current connection.
bytes
- a value accepted bysocket.write( bytes )
Send a request (wire-type) and return a promise that is fulfilled by the corrosponding response.
wiretype
- astruct
from Wire Type Implementationstimeout
- (optional) number of milliseconds untilTimeoutError
will be thrown. Defaults to no timeout.
Close the connection and stop the message parser.
A read-only object for inspecting requests and sending a reply.
id
- the message ID from Lair protocol headerlength
- the total message length from Lair protocol headerwireType
- the constructor name forthis.wireTypeStruct
- eg.
"UnlockPassphraseRequest"
- eg.
wireTypeId
- the wire type ID from Lair protocol header- eg.
4278190096
- eg.
wireTypeStruct
- the (Request) struct forthis.wireTypeId
- eg.
UnlockPassphraseRequest
- eg.
Send a reply constructed from the given values
for the (Response) struct that corrosponds to this
(Request) struct.
Extends Error
Extends LairClientError
Extends LairClientError
Extends LairClientError
The Message Parser is responsible for interpretting a readble stream into Lair protocol messages.
See parser_api.md
Structs are responsible for constructing Lair protocol messages.
See structs_api.md
Types are used in the payload definition for structs.
See types_api.md