1// The one list of nobel libraries. Its order is the canonical load order for single files:2// the base first, then peers that only listen, then libraries that start work, and xenon last,3// so any subset concatenated in this order works however the file is loaded.4export type Lib = { name: string; sym: string; z: number; group: string; needs: string[]; of: string; does: string };56export const groups: Record<string, string> = {7 base: "period 1, the base: relays and keys",8 "alkali metal": "things that charge and flow",9 "noble gas": "the core: data and transport",10 halogen: "secrets and trust",11 "transition metal": "signed exchanges",12 lanthanide: "visual presets",13};1415export const libs: Lib[] = [16 { name: "hydrogen", sym: "H", z: 1, group: "base", needs: [], of: "a relay pool", does: "relays, signing and the family's hooks" },17 { name: "helium", sym: "He", z: 2, group: "base", needs: [], of: "@noble/secp256k1", does: "keys, Schnorr signing and verification" },18 { name: "neon", sym: "Ne", z: 10, group: "noble gas", needs: [], of: "nip19", does: "npub/nevent/naddr, linked content, times" },19 { name: "fluorine", sym: "F", z: 9, group: "halogen", needs: ["helium"], of: "NIP-44", does: "encryption for helium's keys" },20 { name: "chlorine", sym: "Cl", z: 17, group: "halogen", needs: ["helium", "fluorine"], of: "a NIP-46 client", does: "remote signing behind a NIP-07 face" },21 { name: "argon", sym: "Ar", z: 18, group: "noble gas", needs: [], of: "a relay", does: "IndexedDB cache, offline-first feeds" },22 { name: "lithium", sym: "Li", z: 3, group: "alkali metal", needs: ["hydrogen", "argon"], of: "Negentropy", does: "NIP-77 sync between argon and relays" },23 { name: "gold", sym: "Au", z: 79, group: "transition metal", needs: ["hydrogen"], of: "a NIP-42 client", does: "relay AUTH for members-only relays" },24 { name: "mercury", sym: "Hg", z: 80, group: "transition metal", needs: [], of: "rexi.js", does: "NIP-98 and Blossom signed HTTP" },25 { name: "radon", sym: "Rn", z: 86, group: "noble gas", needs: ["hydrogen"], of: "a profile loader", does: "names, pictures, NIP-05" },26 { name: "iodine", sym: "I", z: 53, group: "halogen", needs: ["hydrogen", "helium", "fluorine", "xenon"], of: "an encrypted messenger", does: "NIP-17 private messages" },27 { name: "oganesson", sym: "Og", z: 118, group: "noble gas", needs: ["hydrogen"], of: "a chat app's live layer", does: "presence, typing, cursors" },28 { name: "praseodymium", sym: "Pr", z: 59, group: "lanthanide", needs: ["hydrogen", "radon"], of: "nostr-name and nostr-picture", does: "profile cards, chips, avatars, copy" },29 { name: "europium", sym: "Eu", z: 63, group: "lanthanide", needs: ["hydrogen", "xenon"], of: "nostr-note", does: "note embeds" },30 { name: "cerium", sym: "Ce", z: 58, group: "lanthanide", needs: [], of: "a theme", does: "the one stylesheet for the lanthanides" },31 { name: "xenon", sym: "Xe", z: 54, group: "noble gas", needs: ["hydrogen"], of: "a nostr client", does: "subscribe, render and publish in HTML" },32];3334// n + symbol; one-letter symbols add the next letter of the name that is not another element's symbol.35const prefixes: Record<string, string> = { hydrogen: "nhy", fluorine: "nfl", iodine: "nio" };36export const prefix = (l: Lib) => prefixes[l.name] ?? `n${l.sym.toLowerCase()}`;