Optionalcontext: anyStop listening for nudges. Unsubscribes from nudge events without closing the underlying websocket — call Salt.disconnect to close the socket and allow the Node.js process to exit.
Calls each of the listeners registered for a given event.
Subscribes to nudge events on the underlying socket. Called by Salt.listenToAccountNudges after construction; you only need to call it again after a matching disableNudgeListener to resume listening. Idempotent — calling while already enabled is a no-op.
Return an array listing the events for which the emitter has registered listeners.
Return the number of listeners listening to a given event.
Return the listeners registered for a given event.
Optionalfn: (Optionalcontext: anyOptionalonce: booleanAdd a listener for a given event.
Optionalcontext: anyAdd a one-time listener for a given event.
Optionalcontext: anyRemove all listeners, or those of the specified event.
Optionalevent: keyof NudgeListenerEventsRemove the listeners of a given event.
Optionalfn: (Optionalcontext: anyOptionalonce: boolean
Listens for incoming keygen and signing nudges. By default automatically joins and runs the MPC ceremony for each one. Errors encountered while validating, joining, or running a ceremony surface through the NudgeListenerEvents.error event.
Pass
autoJoin: falseto take manual control: the listener emits NudgeListenerEvents.nudgeReceived with ajoincallback the consumer can invoke when it decides this nudge should be accepted.join()resolves with an AccountCeremony (keygen) or TransactionJoinCeremony (signing). Both implement the SaltCeremony interface, soawait ceremony.wait()drives either to completion without branching on kind. Sessions are de-duplicated — a given nudge can only be joined once regardless of mode.Concurrency: nudges are joined and run concurrently — multiple ceremonies can be in flight simultaneously.
Obtain a
NudgeListenervia Salt.listenToAccountNudges.Example: Auto-join (default)
Example: Manual join, uniform handling via SaltCeremony
Example: Manual join, branching on ceremony kind