Module: interaction

This module provides base classes for modeling interactions with keystores.

It also defines several constants used throughout the API for categorizing messages.

Integrations with new wallets should begin by creating a base class for that wallet by subclassing either DirectKeystoreInteraction or IndirectKeystoreInteraction.

Source:

Classes

DirectKeystoreInteraction
IndirectKeystoreInteraction
KeystoreInteraction
UnsupportedInteraction

Members

(static, constant) ACTIVE :string

Constant representing a keystore in active use.

Type:
  • string
Source:

(static, constant) ERROR :string

Constant for messages at the "error" level.

Type:
  • string
Source:

(static, constant) INFO :string

Constant for messages at the "info" level.

Type:
  • string
Source:

(static, constant) LEVELS :string

Enumeration of possible message levels (INFO|WARNING|ERROR).

Type:
  • string
Source:

(static, constant) PENDING :string

Constant representing a keystore pending activation by the user.

Type:
  • string
Source:

(static, constant) STATES :string

Enumeration of possible keystore states (PENDING|ACTIVE|UNSUPPORTED).

Type:
  • string
Source:

(static, constant) UNSUPPORTED :string

Constant representing a keystore which is unsupported due to the kind of interaction or combination of paramters provided.

Type:
  • string
Source:

(static, constant) WARNING :string

Constant for messages at the "warning" level.

Type:
  • string
Source:

Type Definitions

Message

Represents a message returned by an interaction.

Message objects may have additional properties.

Type:
  • Object
Properties:
Name Type Description
text string

message text

code string

a dot-separated message code, e.g. device.connect (Optional for submessages)

state module:interaction.STATES

keystore state (Optional for submessages)

level module:interaction.LEVELS

message level (Optional for submessages)

version string

keystore version (can be a single version string or a range/spec) (Optional)

action string

keystore action user is expected to take (Optional)

image module:interaction.MessageImage

image for this message (Optional)

messages Array.<Message>

submessages (Optional)

Source:

MessageImage

Represents an image in a message returned by an interaction.

Type:
  • Object
Properties:
Name Type Description
label string

a human-readable label for the image

mimeType string

the MIME type of the image

data string

base64-encoded image data

Source: