@kagamidigital/salt-sdk-mirror
    Preparing search index...

    Class AccountCeremony

    Represents an in-progress account creation ceremony. Obtain one via Salt.createAccount (creator host) or via a join callback from a NudgeListener keygen nudge (co-signer joiner). Both paths return an AccountCeremony; call wait() to drive the three-phase setup to completion.

    Extends EventEmitter — subscribe to lifecycle events before calling wait().

    const ceremony = await salt.createAccount({
    name: 'Treasury',
    organisationId: 'org-id',
    signers: ['0xCreator', '0xCoSigner'],
    signer,
    });

    // Live huddle membership — drives an "N of M joined" UI. `online` is the
    // addresses currently present; fires on every join/leave plus once with the
    // initial set when wait() starts.
    ceremony.on('presence', ({ online, joined, total }) => {
    console.log(`${joined} of ${total} joined`, online);
    });

    // Push-style readiness — fires once when all signers are present:
    ceremony.on('ready', ({ online }) => console.log('all present', online));

    // Or read synchronously at any time (e.g. if you subscribed late):
    if (ceremony.isReady) console.log('all present', ceremony.onlineSigners);

    ceremony.on('keygenCompleted', ({ sessionId }) => console.log('Keygen done', sessionId));
    ceremony.on('keyshareBackedUp', () => console.log('Keyshare backed up'));

    const { account } = await ceremony.wait();
    console.log(account.publicKey);

    Hierarchy (View Summary)

    Implements

    Index

    Properties

    sessionId: string

    MPC session ID for this ceremony.

    prefixed: string | boolean

    Accessors

    • get accountId(): string

      The account this ceremony is creating. Available before completion (e.g. during keygen), so consumers can act on the account mid-ceremony — notably to re-nudge co-signers who are not yet in the huddle.

      Returns string

    • get isReady(): boolean

      true once all required parties are present.

      Returns boolean

    • get onlineSigners(): string[]

      Addresses currently present in the huddle, mapped from numeric party indices.

      Returns string[]

    Methods

    • Return the number of listeners listening to a given event.

      Parameters

      Returns number

    • Expected signers not currently present in the huddle.

      Returns string[]

    • Remove all listeners, or those of the specified event.

      Parameters

      • Optionalevent: keyof AccountCeremonyEvents

      Returns this

    • Run the three-phase account setup to completion: keygen ceremony, keyshare backup, and keyshare verification. Idempotent — repeated calls return the same promise.

      Returns Promise<AccountCeremonyResult>

      The finalized account record.

      const ceremony = await salt.createAccount({ ... });
      ceremony.on('keygenCompleted', () => { ... });
      const { account } = await ceremony.wait();
      console.log(account.publicKey);