Class: Signer

(protected) Signer(actoropt) → {Signer}

Generic Fabric Signer.

Constructor

(protected) new Signer(actoropt) → {Signer}

Creates an Signer, which emits messages for other Signers to subscribe to. You can supply certain parameters for the actor, including key material [!!!] — be mindful of what you share with others!
Parameters:
Name Type Attributes Description
actor Object <optional>
Object to use as the actor.
Properties
Name Type Attributes Description
seed String <optional>
BIP24 Mnemonic to use as a seed phrase.
public Buffer <optional>
Public key.
private Buffer <optional>
Private key.
Properties:
Name Type Description
id String Unique identifier for this Signer (id === SHA256(preimage)).
preimage String Input hash for the `id` property (preimage === SHA256(SignerState)).
Source:
Fires:
  • event:message Fabric Message objects.
Returns:
Instance of the Signer. Call Signer#sign to emit a Signature.
Type
Signer

Extends

Methods

_readObject(input) → {Object}

Parse an Object into a corresponding Fabric state.
Parameters:
Name Type Description
input Object Object to read as input.
Overrides:
Source:
Returns:
Fabric state.
Type
Object

adopt(changes) → {Actor}

Explicitly adopt a set of JSONPatch-encoded changes.
Parameters:
Name Type Description
changes Array List of JSONPatch operations to apply.
Overrides:
Source:
Returns:
Instance of the Actor.
Type
Actor

commit() → {String}

Resolve the current state to a commitment.
Overrides:
Source:
Returns:
32-byte ID
Type
String

export() → {Object}

Export the Actor's state to a standard Object.
Overrides:
Source:
Returns:
Standard object.
Type
Object

get(path) → {Object}

Retrieve a value from the Actor's state by JSONPointer path.
Parameters:
Name Type Description
path String Path to retrieve using JSONPointer.
Overrides:
Source:
Returns:
Value of the path in the Actor's state.
Type
Object

pause() → {Actor}

Toggles `status` property to paused.
Overrides:
Source:
Returns:
Instance of the Actor.
Type
Actor

serialize() → {String}

Serialize the Actor's current state into a JSON-formatted string.
Overrides:
Source:
Returns:
Type
String

set(path, value) → {Object}

Set a value in the Actor's state by JSONPointer path.
Parameters:
Name Type Description
path String Path to set using JSONPointer.
value Object Value to set.
Overrides:
Source:
Returns:
Value of the path in the Actor's state.
Type
Object

sign() → {Signer}

Signs some data.
Overrides:
Source:
Returns:
Type
Signer

toBuffer() → {Buffer}

Casts the Actor to a normalized Buffer.
Overrides:
Source:
Returns:
Type
Buffer

toGenericMessage() → {Object}

Casts the Actor to a generic message.
Overrides:
Source:
Returns:
Generic message object.
Type
Object

toObject() → {Object}

Returns the Actor's current state as an Object.
Overrides:
Source:
Returns:
Type
Object

unpause() → {Actor}

Toggles `status` property to unpaused.
Overrides:
Source:
Returns:
Instance of the Actor.
Type
Actor

value(formatopt) → {Object}

Get the inner value of the Actor with an optional cast type.
Parameters:
Name Type Attributes Default Description
format String <optional>
object Cast the value to one of: `buffer, hex, json, string`
Overrides:
Source:
Returns:
Inner value of the Actor as an Object, or cast to the requested `format`.
Type
Object