The store, pool, active account, lookup servers, signer and directory.
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'
Watch the active account's NIP-65 list and save a new one.
The list is streamed from
lookupRelays()for whichever accountpubkey$names, added to the store, and kept open so a newer list from another client replaces it; the store keeps the newest. The state isloadinguntil a list arrives or every server has finished, or failed, without one, orpatienceMspasses for a server that never answers; it is thenmissingwith suggestions from the directory. With nobody signed in it staysloading. 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.