kernl API
    Preparing search index...

    Function createAccountMailboxes

    • Watch the active account's NIP-65 list and save a new one.

      The list is streamed from lookupRelays() for whichever account pubkey$ names, added to the store, and kept open so a newer list from another client replaces it; the store keeps the newest. The state is loading until a list arrives or every server has finished, or failed, without one, or patienceMs passes for a server that never answers; it is then missing with suggestions from the directory. With nobody signed in it stays loading. Saving signs the list with the active signer, publishes it to the new outboxes, the old outboxes, the new inboxes and the lookup servers, and succeeds when any of them accepts it (D-028). A list nobody accepted is not added to the store, so the state never shows a list no server holds.

      Parameters

      Returns AccountMailboxes

      The account's mailboxes.

      const mailboxes = createAccountMailboxes({ store, pool, pubkey$, lookupRelays: () => tiers.get().discovery, signer });
      mailboxes.state$.subscribe((state) => render(state));
      const outcome = await mailboxes.save({ inboxes: ['wss://in.example'], outboxes: ['wss://out.example'] });
      describeOutcome(outcome); // 'Saved to 3 of 4 servers'