handlers
- Description:
Contains handlers for communication events
- Source:
Methods
(static) jiffClient.handlers.build_initialization_message() → {Object}
- Description:
Builds the initialization message for this instance
- Source:
Returns:
- Type
- Object
(static) jiffClient.handlers.connected()
- Description:
Begins initialization of this instance by sending the initialization message to the server. Should only be called after connection is established. Do not call this manually unless you know what you are doing, use <jiff_instance>.connect() instead!
- Source:
(static) jiffClient.handlers.error(label, error)
- Description:
Called when an error occurs
- Source:
Parameters:
Name | Type | Description |
---|---|---|
label |
string | the name of message or operation causing the error |
error |
error | string | the error |
(static) jiffClient.handlers.initialized()
- Description:
Called after the server approves initialization of this instance. Sets the instance id, the count of parties in the computation, and the public keys of initialized parties.
- Source:
(static) jiffClient.handlers.receive_crypto_provider(json_msg)
- Description:
Parse crypto provider message and resolve associated promise.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
json_msg |
object | the parsed json message as received by the crypto_provider event, contains 'values' and 'shares' attributes. |
(static) jiffClient.handlers.receive_custom(json_msg)
- Description:
Called when this party receives a custom tag message from any party (including itself). If a custom listener was setup to listen to the tag, the message is passed to the listener. Otherwise, the message is stored until such a listener is provided.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
json_msg |
object | the parsed json message as received by the custom event. |
(static) jiffClient.handlers.receive_open(json_msg)
- Description:
Resolves the deferred corresponding to operation_id and sender_id.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
json_msg |
object | the json message as received with the open event. |
(static) jiffClient.handlers.receive_share(json_msg)
- Description:
Store the received share and resolves the corresponding deferred if needed.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
json_msg |
object | the parsed json message as received. |
(static) jiffClient.handlers.store_public_keys(keymap)
- Description:
Parse and store the given public keys
- Source:
Parameters:
Name | Type | Description |
---|---|---|
keymap |
object | maps party id to serialized public key. |