@ghostlytools/sdk 1.11.1 → 1.11.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app.js +6 -3
- package/dist/app.js.map +1 -1
- package/dist/core.js +111 -18
- package/dist/core.js.map +1 -1
- package/dist/{fakes-LaWqqMv4.js → fakes-CK9Ra4X4.js} +3 -3
- package/dist/{fakes-LaWqqMv4.js.map → fakes-CK9Ra4X4.js.map} +1 -1
- package/dist/fakes.js +1 -1
- package/dist/index.js +3 -3
- package/dist/{keet-identity-key-CASfmXry.js → keet-identity-key-CDgu84Dj.js} +2 -2
- package/dist/{keet-identity-key-CASfmXry.js.map → keet-identity-key-CDgu84Dj.js.map} +1 -1
- package/dist/{src-BN4AAuHI.js → src-B9HeOlsG.js} +649 -184
- package/dist/src-B9HeOlsG.js.map +1 -0
- package/dist/testing.js +4 -4
- package/dist/types/browser/src/engine/paymentAdapters/providers/types.d.ts +6 -1
- package/dist/types/core/src/appStore.d.ts +5 -0
- package/dist/types/core/src/audioMetadata.d.ts +0 -23
- package/dist/types/core/src/catchUp.d.ts +2 -0
- package/dist/types/core/src/chatFiles.d.ts +6 -0
- package/dist/types/core/src/clipboardGuard.d.ts +24 -7
- package/dist/types/core/src/dhtDelivery.d.ts +13 -0
- package/dist/types/core/src/didDht.d.ts +6 -4
- package/dist/types/core/src/frames.d.ts +11 -0
- package/dist/types/core/src/ghostlink.d.ts +42 -2
- package/dist/types/core/src/groupSession.d.ts +13 -0
- package/dist/types/core/src/http.d.ts +16 -2
- package/dist/types/core/src/identity.d.ts +16 -1
- package/dist/types/core/src/identityProofs.d.ts +7 -0
- package/dist/types/core/src/index.d.ts +1 -0
- package/dist/types/core/src/linkPreview.d.ts +9 -2
- package/dist/types/core/src/miniApp.d.ts +5 -2
- package/dist/types/core/src/pairedAppRanges.d.ts +5 -0
- package/dist/types/core/src/pairedApps.d.ts +4 -2
- package/dist/types/core/src/relay.d.ts +17 -4
- package/dist/types/core/src/transport.d.ts +3 -1
- package/dist/types/core/src/videoMetadata.d.ts +8 -1
- package/dist/types/core/src/viewerGuard.d.ts +6 -0
- package/dist/{types-DvtCy3WB.js → types-DYLIIkU8.js} +2 -1
- package/dist/types-DYLIIkU8.js.map +1 -0
- package/dist/{verify-oCL662ms.js → verify-DZpnNeF7.js} +2 -2
- package/dist/{verify-oCL662ms.js.map → verify-DZpnNeF7.js.map} +1 -1
- package/package.json +1 -1
- package/dist/src-BN4AAuHI.js.map +0 -1
- package/dist/types-DvtCy3WB.js.map +0 -1
package/dist/core.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.js","names":[],"sources":["../../core/src/clipboardGuard.ts","../../core/src/paymentUri.ts","../../core/src/version.ts","../../core/src/clockWatch.ts"],"sourcesContent":["/**\n * A contact's shared app on the web writes the clipboard only in the person's own tap in it. Its frames allow no\n * `clipboard-write`, but Chromium lets `document.execCommand(\"copy\")` write the system clipboard for as long as a tap's\n * activation lasts (seconds, from a timer too), and no sandbox token or permissions policy turns that off. So this\n * script runs first in each of the app's pages (`guardViewerAnswer`) and in the bridge (apps/web/src/svc/bridge.ts):\n * - `execCommand(\"copy\")` and `execCommand(\"cut\")` work only while a trusted tap, click or key of the person's is being\n * dispatched in that window: a copy button copies on its own tap, and nothing else does (not on load, not from a\n * timer or a promise after a tap). `execCommand(\"paste\")` is refused. Every other command passes as it is. The\n * wrapped `execCommand` is left fixed in place (not writable, not configurable), once per window;\n * - runs in a frame's window before the page holds it, as the WebRTC guard does (`VIEWER_GUARD_SCRIPT`): what a frame\n * element hands out is guarded first, the frames of the document and of its shadow trees are gone over as one loads\n * (an empty frame's first load fires as it is put in the page) and as the page changes, each `srcdoc` frame gets\n * this script first, a declarative shadow root the page's script would make is refused, and with `VIEWER_GUARD_CSP`\n * a `javascript:` URL is refused (its own Trusted Types default policy; one passes every other string on as it is).\n * A frame's window keeps what was run in it on its first, empty page when the page it loads is of the same origin (the\n * bridge's guard reaches the app's frame then): there this script only watches the new document. Each document it\n * watches is marked (`ghostlyClipboardGuard`, fixed in place): the bridge reads that to know the guard ran in the page\n * it shows. It uses nothing the page can change after it ran (the page's own code runs later, in the same realm).\n *\n * A fence, not a wall, as the WebRTC guard's own: a frame's window read by its index (`window[0]`) before it loads,\n * inside a shadow tree written in the HTML the page itself sends, is out of its sight.\n * No backslash, `${` or backtick in it.\n */\nexport const CLIPBOARD_GUARD_SCRIPT = `(function noClipboardWrites(w) {\n \"use strict\";\n try {\n const apply = w.Reflect.apply;\n const describe = w.Object.getOwnPropertyDescriptor;\n const define = w.Object.defineProperty;\n const proto = w.Document.prototype;\n const home = w.document;\n const exec = describe(proto, \"execCommand\");\n const fresh = !!exec && exec.configurable === true && typeof exec.value === \"function\";\n const watched = !!describe(home, \"ghostlyClipboardGuard\");\n if (!fresh && watched) return;\n if (!watched) define(home, \"ghostlyClipboardGuard\", { value: true });\n const own = \"<script>(\" + noClipboardWrites + \")(window)<\" + \"/script>\";\n const close = \"<\" + \"/script>\";\n const webRtc = \"<script>(function noWebRtc(\";\n const text = w.String;\n const lower = text.prototype.toLowerCase;\n const slice = text.prototype.slice;\n const index = text.prototype.indexOf;\n const listen = w.EventTarget.prototype.addEventListener;\n const shut = (inner) => {\n try { if (inner && inner !== w) noClipboardWrites(inner); } catch (e) {}\n };\n const count = describe(w, \"length\").get;\n const view = describe(proto, \"defaultView\").get;\n const sweep = () => {\n try { for (let i = apply(count, w, []); i-- > 0;) shut(w[i]); } catch (e) {}\n };\n const elements = w.Element.prototype;\n const getAttribute = elements.getAttribute;\n const setAttribute = elements.setAttribute;\n const removeAttribute = elements.removeAttribute;\n const attachShadow = elements.attachShadow;\n const size = describe(w.NodeList.prototype, \"length\").get;\n const first = (frame) => {\n const doc = apply(getAttribute, frame, [\"srcdoc\"]);\n if (doc === null) return;\n let at = 0;\n if (apply(slice, doc, [0, webRtc.length]) === webRtc) {\n const end = apply(index, doc, [close]);\n if (end >= 0) at = end + close.length;\n }\n if (apply(slice, doc, [at, at + own.length]) === own) return;\n try { apply(setAttribute, frame, [\"srcdoc\", own + doc]); } catch (e) { apply(removeAttribute, frame, [\"srcdoc\"]); }\n };\n const Observer = w.MutationObserver;\n const observe = Observer.prototype.observe;\n const watch = (root, all) => {\n const scan = () => {\n try {\n const frames = apply(all, root, [\"iframe[srcdoc]\"]);\n for (let i = apply(size, frames, []); i-- > 0;) first(frames[i]);\n } catch (e) {}\n sweep();\n };\n apply(observe, new Observer(scan), [root, { subtree: true, childList: true, attributes: true, attributeFilter: [\"srcdoc\"] }]);\n apply(listen, root, [\"load\", sweep, true]);\n scan();\n return root;\n };\n if (fresh) {\n const run = exec.value;\n const phase = describe(w.Event.prototype, \"eventPhase\").get;\n let tap = null;\n let trusted = null;\n const seen = (event) => {\n try {\n const found = describe(event, \"isTrusted\");\n if (found && found.get && apply(found.get, event, []) === true) { tap = event; trusted = found.get; }\n } catch (e) {}\n };\n const taps = [\"pointerdown\", \"pointerup\", \"mousedown\", \"mouseup\", \"click\", \"auxclick\", \"touchstart\", \"touchend\", \"keydown\", \"keyup\"];\n for (let i = 0; i < taps.length; i++) apply(listen, w, [taps[i], seen, true]);\n const tapping = () => {\n try { return tap !== null && apply(trusted, tap, []) === true && apply(phase, tap, []) !== 0; } catch (e) { return false; }\n };\n const guarded = function execCommand(command) {\n const name = apply(lower, text(command), []);\n if (name === \"paste\" || ((name === \"copy\" || name === \"cut\") && !tapping())) return false;\n const args = [name];\n for (let i = 1; i < arguments.length; i++) args[i] = arguments[i];\n return apply(run, this, args);\n };\n define(proto, \"execCommand\", { value: guarded, writable: false, enumerable: exec.enumerable, configurable: false });\n if (w.trustedTypes && !w.trustedTypes.defaultPolicy) {\n try {\n w.trustedTypes.createPolicy(\"default\", {\n createHTML: (input) => input,\n createScript: (input, type, sink) => (sink === \"Location href\" ? null : input),\n createScriptURL: (input) => input,\n });\n } catch (e) {}\n }\n const reopen = proto.open;\n proto.open = function () {\n const got = apply(reopen, this, arguments);\n try { if (apply(view, this, []) === w) apply(listen, this, [\"load\", sweep, true]); } catch (e) {}\n return got;\n };\n const shadowed = (html) => apply(index, apply(lower, html, []), [\"shadowrootmode\"]) >= 0;\n const Refused = w.TypeError;\n const refuse = () => { throw new Refused(\"A declarative shadow root is not allowed here\"); };\n const parsers = [[elements, \"setHTMLUnsafe\"], [w.ShadowRoot && w.ShadowRoot.prototype, \"setHTMLUnsafe\"], [w.Document, \"parseHTMLUnsafe\"]];\n for (let i = 0; i < parsers.length; i++) {\n const owner = parsers[i][0];\n const name = parsers[i][1];\n const real = owner && owner[name];\n if (typeof real !== \"function\") continue;\n owner[name] = function (html) {\n const checked = text(html);\n if (shadowed(checked)) refuse();\n return apply(real, this, arguments.length > 1 ? [checked, arguments[1]] : [checked]);\n };\n }\n let tail = \"\";\n const writes = [\"write\", \"writeln\"];\n for (let i = 0; i < writes.length; i++) {\n const real = proto[writes[i]];\n if (typeof real !== \"function\") continue;\n proto[writes[i]] = function () {\n let checked = \"\";\n for (let j = 0; j < arguments.length; j++) checked += text(arguments[j]);\n if (shadowed(tail + checked)) refuse();\n tail = apply(slice, tail + checked, [-16]);\n return apply(real, this, [checked]);\n };\n }\n const kinds = [\"HTMLIFrameElement\", \"HTMLFrameElement\", \"HTMLObjectElement\", \"HTMLEmbedElement\"];\n const reads = [\"contentWindow\", \"contentDocument\", \"getSVGDocument\"];\n for (let k = 0; k < kinds.length; k++) {\n const owner = w[kinds[k]] && w[kinds[k]].prototype;\n for (let r = 0; r < reads.length; r++) {\n const name = reads[r];\n const found = owner && describe(owner, name);\n const key = found && found.get ? \"get\" : \"value\";\n if (!found || typeof found[key] !== \"function\") continue;\n const read = found[key];\n found[key] = function () {\n const got = apply(read, this, arguments);\n try { shut(name === \"contentWindow\" ? got : apply(view, got, [])); } catch (e) {}\n return got;\n };\n try { define(owner, name, found); } catch (e) {}\n }\n }\n const inShadow = w.DocumentFragment.prototype.querySelectorAll;\n if (attachShadow) {\n elements.attachShadow = function () {\n const root = apply(attachShadow, this, arguments);\n try { watch(root, inShadow); } catch (e) {}\n return root;\n };\n }\n }\n if (!watched) watch(home, proto.querySelectorAll);\n } catch (e) {}\n})(window)`;\n\n/** `CLIPBOARD_GUARD_SCRIPT`'s hash, as a CSP source: the bridge's policy and a contact's own are given it. */\nexport const CLIPBOARD_GUARD_HASH = \"'sha256-FGs001DxOSnlZv8nm6JyMeex+LlNQJzrCFbnJhAh8n4='\";\n","/**\n * Payment URIs for a wallet that is not Ghostly: what a QR code shows and what a `lightning:` or\n * `bitcoin:` link opens. Building them is all this does; whether the payment arrives is watched by the\n * payee's own source, never assumed from the link having been opened.\n *\n * - `lightning:<invoice>` ([BOLT 11](https://github.com/lightning/bolts/blob/master/11-payment-encoding.md)).\n * - `bitcoin:<address>?amount=<btc>&lightning=<invoice>` ([BIP 21](https://github.com/bitcoin/bips/blob/master/bip-0021.mediawiki)),\n * with the `lightning` parameter of the unified QR convention when an invoice exists too.\n * - `bitcoin:?ark=<address>&amount=<btc>` for an Ark address, the BIP 21 form Ark wallets read.\n */\nexport type PaymentUriInput =\n | { kind: \"lightning\"; invoice: string }\n | { kind: \"bitcoin\"; address: string; amountSat?: number; label?: string; message?: string; lightning?: string }\n | { kind: \"ark\"; address: string; amountSat?: number };\n\n/** Whole sats as the decimal BTC amount BIP 21 wants (`21` → `0.00000021`), never in exponent form. */\nexport function satsToBtc(sats: number): string {\n if (!Number.isSafeInteger(sats) || sats < 0) throw new Error(\"Amount must be a whole number of sats\");\n const whole = Math.floor(sats / 100_000_000);\n const fraction = String(sats % 100_000_000).padStart(8, \"0\").replace(/0+$/, \"\");\n return fraction ? `${whole}.${fraction}` : String(whole);\n}\n\nconst cleanInvoice = (invoice: string) => invoice.trim().toLowerCase().replace(/^lightning:/, \"\");\n\n/** The URI to open in another wallet. Throws on an input that cannot be one. */\nexport function paymentUri(input: PaymentUriInput): string {\n if (input.kind === \"lightning\") {\n const invoice = cleanInvoice(input.invoice);\n if (!/^ln[a-z0-9]+$/.test(invoice)) throw new Error(\"That is not a Lightning invoice\");\n return `lightning:${invoice}`;\n }\n const params = new URLSearchParams();\n if (input.kind === \"ark\") {\n if (!/^[a-z0-9]+$/i.test(input.address)) throw new Error(\"That is not an Ark address\");\n params.set(\"ark\", input.address);\n if (input.amountSat) params.set(\"amount\", satsToBtc(input.amountSat));\n return `bitcoin:?${params.toString()}`;\n }\n if (!/^[a-zA-Z0-9]+$/.test(input.address)) throw new Error(\"That is not a Bitcoin address\");\n if (input.amountSat) params.set(\"amount\", satsToBtc(input.amountSat));\n if (input.label) params.set(\"label\", input.label.slice(0, 140));\n if (input.message) params.set(\"message\", input.message.slice(0, 140));\n if (input.lightning) params.set(\"lightning\", cleanInvoice(input.lightning));\n // `+` would be read as a space by some wallets; BIP 21 wants percent-encoding.\n const query = params.toString().replace(/\\+/g, \"%20\");\n return query ? `bitcoin:${input.address}?${query}` : `bitcoin:${input.address}`;\n}\n\n/**\n * What to put in the QR code: a `lightning:` URI in upper case, so the code uses the smaller alphanumeric\n * mode every Lightning wallet reads; anything with characters outside that mode as it is.\n */\nexport function qrText(uri: string): string {\n const upper = uri.toUpperCase();\n return /^[A-Z0-9 $%*+\\-./:]*$/.test(upper) ? upper : uri;\n}\n","/**\n * Which of two released versions is newer. Every client asks this of whatever\n * it found published, so a malformed answer must never read as an update: the\n * numbers are the only thing trusted here, and anything else sorts as older.\n */\n\n/** `1.2.3`, with an optional `v` and an optional `-beta.1` this ignores. */\nconst RELEASE = /^v?(\\d{1,6})\\.(\\d{1,6})\\.(\\d{1,6})(?:[-+].*)?$/;\n\nfunction parse(version: string): [number, number, number] | null {\n const match = RELEASE.exec(version.trim());\n return match ? [Number(match[1]), Number(match[2]), Number(match[3])] : null;\n}\n\n/** Negative when `a` is older, positive when it is newer, 0 when they match or either is not a version. */\nexport function compareVersions(a: string, b: string): number {\n const left = parse(a);\n const right = parse(b);\n if (!left || !right) return 0;\n for (let i = 0; i < 3; i++) {\n if (left[i] !== right[i]) return left[i] - right[i];\n }\n return 0;\n}\n\n/** Whether `latest` is worth updating to from `current`. Unparseable input is never an update. */\nexport function isNewerVersion(latest: string, current: string): boolean {\n return compareVersions(latest, current) > 0;\n}\n","/**\n * Whether this device's own clock seems to be off, and by how much, so the app can say so where people look at the\n * connection (the chat's connection panel, Settings → Network): \"This device's clock seems to be off by about 2 minutes.\n * Chats may be slow to connect.\"\n *\n * Ghostly dates what it publishes by this device's clock, and several of its checks hold a contact's dates against\n * it. A clock a few minutes off makes chats and groups slow to connect, or never connect with apps that have not been\n * updated, and nothing on screen says why. The app cannot set the clock; it can notice and say.\n *\n * What it hears (`ClockWatch`), each as \"this clock minus theirs is between `low` and `high`\":\n * - a **server**: the `Date` header of an HTTP answer (a Pkarr relay's), a time to the second read between the moment\n * the request went out and the moment its answer came. Where a browser may not read that header of another origin,\n * there is none.\n * - a **contact**: the time of a contact's packet that came between two close reads of its record. Its own clock dated\n * it, and this device knows within seconds when it was published.\n *\n * The rule, on purpose slow to say yes, and never on one contact's word (it is as likely that contact's clock):\n * - a source says \"off\" only when everything it allows is more than `CLOCK_OFF_MS` on one side;\n * - two servers that both say so, the same way, are enough: servers keep time;\n * - else one server and a contact that say so, with no contact saying otherwise;\n * - else three contacts that say so, the same way, and at least three for each one that does not.\n * The amount is the middle of what the sources that say so give (the servers', when two do). Evidence older than\n * `CLOCK_EVIDENCE_MS` says nothing: a clock that was set right is believed at the next answer, and the note goes away.\n */\n/** A clock closer than this to the others' is not said to be off: a minute is what apps up to 1.0.2 allow at their strictest. */\nexport const CLOCK_OFF_MS = 60_000;\n/** Evidence older than this says nothing about the clock now. */\nexport const CLOCK_EVIDENCE_MS = 30 * 60_000;\n/** Contacts that must say so when no server does. */\nexport const CLOCK_PEERS = 3;\n/** Servers that are enough by themselves. */\nexport const CLOCK_SERVERS = 2;\n/** A contact's packet says something only when the two reads around it were this close. */\nexport const CLOCK_PEER_READ_GAP_MS = 15_000;\n/** Sources kept of each kind: a profile has a few relays, and may have hundreds of contacts. */\nconst KEPT = 64;\n\nexport interface ClockSample { low: number; high: number; at: number }\n\n/** -1: everything the sample allows is behind by more than `CLOCK_OFF_MS`; 1: ahead; 0: it does not say. */\nconst says = (sample: ClockSample): -1 | 0 | 1 => (sample.low > CLOCK_OFF_MS ? 1 : sample.high < -CLOCK_OFF_MS ? -1 : 0);\nconst middle = (values: number[]): number => { const sorted = [...values].sort((a, b) => a - b); return sorted[Math.floor((sorted.length - 1) / 2)]; };\n\n/**\n * The rule alone: how far this clock is from the others' (ms, positive when it is ahead) when the samples fresh at\n * `now` say it is clearly off, else null.\n */\nexport function clockOffset(servers: ReadonlyMap<string, ClockSample>, peers: ReadonlyMap<string, ClockSample>, now: number): number | null {\n const fresh = (samples: ReadonlyMap<string, ClockSample>) => [...samples.values()].filter(s => now - s.at < CLOCK_EVIDENCE_MS);\n const s = fresh(servers), p = fresh(peers);\n const mid = (sample: ClockSample) => (sample.low + sample.high) / 2;\n for (const way of [1, -1] as const) {\n const serversOff = s.filter(x => says(x) === way), peersOff = p.filter(x => says(x) === way);\n const serversNot = s.length - serversOff.length, peersNot = p.length - peersOff.length;\n if (serversOff.length >= CLOCK_SERVERS && serversNot === 0) return Math.round(middle(serversOff.map(mid)));\n // A server that does not say so, when one could be read, outweighs any number of contacts.\n if (serversNot > 0) continue;\n if (serversOff.length === 1 && peersOff.length >= 1 && peersNot === 0) return Math.round(middle([...serversOff, ...peersOff].map(mid)));\n if (peersOff.length >= CLOCK_PEERS && peersOff.length >= 3 * peersNot) return Math.round(middle(peersOff.map(mid)));\n }\n return null;\n}\n\nexport class ClockWatch {\n private readonly servers = new Map<string, ClockSample>();\n private readonly peers = new Map<string, ClockSample>();\n private was: number | null = null;\n private timer: ReturnType<typeof setTimeout> | null = null;\n\n /** `onChange`: what `offset` says changed (it appeared, went away, or moved by a minute). */\n constructor(private readonly onChange: (offset: number | null) => void = () => {}, private readonly now: () => number = Date.now) {}\n\n /**\n * A server's time: `date` (ms, to the second) from an answer to a request that went out at `sent` and came back at\n * `received`, both by this clock.\n */\n server(source: string, date: number, sent: number, received: number): void {\n if (!Number.isFinite(date) || date <= 0 || received < sent) return;\n // The answer was made somewhere between the two, at a server time between `date` and the end of that second.\n this.keep(this.servers, source, { low: sent - date - 999, high: received - date, at: this.now() });\n }\n\n /**\n * A contact's packet, dated `packetAt` by its clock, that came between this device's reads of its record at\n * `readBefore` and `readAt` (this clock). Says nothing when the two reads were far apart.\n */\n peer(peer: string, packetAt: number, readBefore: number, readAt: number): void {\n if (!(readBefore > 0) || readAt < readBefore || readAt - readBefore > CLOCK_PEER_READ_GAP_MS || !Number.isFinite(packetAt)) return;\n this.keep(this.peers, peer, { low: readBefore - packetAt, high: readAt - packetAt, at: this.now() });\n }\n\n private keep(samples: Map<string, ClockSample>, source: string, sample: ClockSample): void {\n samples.delete(source);\n samples.set(source, sample);\n if (samples.size > KEPT) samples.delete(samples.keys().next().value!);\n this.settle();\n }\n\n /** This clock minus the others', in ms (positive: ahead), when it is clearly off; else null. */\n get offset(): number | null { return clockOffset(this.servers, this.peers, this.now()); }\n\n /** The clock was set, or the evidence is of another time: nothing is known until the next answers. */\n reset(): void {\n this.servers.clear();\n this.peers.clear();\n this.settle();\n }\n\n /** Stops the timer that lets the evidence age out. */\n close(): void {\n if (this.timer) clearTimeout(this.timer);\n this.timer = null;\n }\n\n private settle(): void {\n this.close();\n for (const samples of [this.servers, this.peers]) for (const [source, sample] of samples) if (this.now() - sample.at >= CLOCK_EVIDENCE_MS) samples.delete(source);\n const offset = this.offset;\n if (offset !== null) {\n // Looked at again when the oldest evidence ages out: what is left may no longer be enough.\n const oldest = Math.min(...[...this.servers.values(), ...this.peers.values()].map(s => s.at));\n this.timer = setTimeout(() => this.settle(), Math.max(1_000, oldest + CLOCK_EVIDENCE_MS - this.now()));\n (this.timer as { unref?: () => void }).unref?.();\n }\n // Told again only when it would read differently: the note says minutes.\n const reads = (value: number | null) => (value === null ? null : Math.round(value / 60_000));\n if (reads(offset) === reads(this.was)) return;\n this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MAAM,CAAC,QAAQ,WAAW,SAAS,IAAI,KAAK,IAAI,IAAI,OAAO,MAAA,MAAyB,QAAQ,OAAO,MAAM;EAChK,MAAM,SAAS,KAAK;EACpB,IAAI,WAAW,MAAM;GAEnB,MAAM,SAAS,KAAK,IAAI,GAAG,CAAC,GAAG,KAAK,QAAQ,OAAO,GAAG,GAAG,KAAK,MAAM,OAAO,CAAC,CAAC,CAAC,KAAI,MAAK,EAAE,EAAE,CAAC;GAC5F,KAAK,QAAQ,iBAAiB,KAAK,OAAO,GAAG,KAAK,IAAI,KAAO,SAAS,oBAAoB,KAAK,IAAI,CAAC,CAAC;GACrG,KAAM,MAAiC,QAAQ;EACjD;EAEA,MAAM,SAAS,UAA0B,UAAU,OAAO,OAAO,KAAK,MAAM,QAAQ,GAAM;EAC1F,IAAI,MAAM,MAAM,MAAM,MAAM,KAAK,GAAG,GAAG;EACvC,KAAK,MAAM;EACX,KAAK,SAAS,MAAM;CACtB;AACF"}
|
|
1
|
+
{"version":3,"file":"core.js","names":[],"sources":["../../core/src/clipboardGuard.ts","../../core/src/paymentUri.ts","../../core/src/version.ts","../../core/src/clockWatch.ts"],"sourcesContent":["/**\n * A contact's shared app on the web writes the clipboard only in the person's own tap in it. Its frames allow no\n * `clipboard-write`, but Chromium lets `document.execCommand(\"copy\")` write the system clipboard for as long as a tap's\n * activation lasts (seconds, from a timer too), and no sandbox token or permissions policy turns that off. So this\n * script runs first in each of the app's pages (`guardViewerAnswer`) and in the bridge (apps/web/src/svc/bridge.ts):\n * - `execCommand(\"copy\")` and `execCommand(\"cut\")` work only while one of the person's own inputs in that window is\n * being dispatched (a trusted `pointerdown`, `pointerup`, `mousedown`, `mouseup`, `click`, `auxclick`, `dblclick`,\n * `contextmenu`, `touchstart`, `touchend`, `keydown`, `keypress` or `keyup`; no script can fire one), or a trusted\n * `submit` or `change` that began while such an input's window was open, and only within a second of that input\n * (from its own `timeStamp`, or from its dispatch where that is later or on another clock): Chromium lets a copy\n * write for seconds after a tap, and a page that spins in its own listener keeps the input being dispatched all\n * that time, while the person may copy something of their own in Ghostly. That window opens as the input is\n * dispatched and closes at the first callback the guard queued at any input that runs (a message on a channel of\n * its own, a `user-blocking` task where `scheduler.postTask` exists, an animation frame), so it holds the input's\n * own dispatch and its default action: the submit of a click on a submit button or of Enter in a field, the change\n * of a checkbox. It also covers the rendering step right after the input: the animation frame callbacks the page\n * asked for before the input run in the frame right after it, ahead of the guard's message and `user-blocking`\n * task (and of its own frame callback, which closes the window there), so a `submit` or `change` one of them fires\n * counts. A `submit` or `change` fired by script (`requestSubmit()`, `click()`) from a timer, a promise, a message\n * or an animation frame asked for at or after the input, or outside any input, does not count. So a copy button, a\n * form, a checkbox, a double click or the app's own context menu copies on the person's tap, and nothing else does\n * (not on load, not from a timer or a promise after a tap). `execCommand(\"paste\")` is refused. Every other command\n * passes as it is. The wrapped `execCommand` is left fixed in place (not writable, not configurable), once per\n * window;\n * - runs in a frame's window before the page holds it, as the WebRTC guard does (`VIEWER_GUARD_SCRIPT`): what a frame\n * element hands out is guarded first, the frames of the document and of its shadow trees are gone over as one loads\n * (an empty frame's first load fires as it is put in the page) and as the page changes, each `srcdoc` frame gets\n * this script first, a declarative shadow root the page's script would make is refused, and with `VIEWER_GUARD_CSP`\n * a `javascript:` URL is refused (its own Trusted Types default policy; one passes every other string on as it is,\n * or, once the page made its own `default` policy, to that one's rules: the page's `createPolicy(\"default\")` gets the\n * guard's policy back with them, and the copy of itself it puts in a `srcdoc` frame skips them).\n * A frame's window keeps what was run in it on its first, empty page when the page it loads is of the same origin (the\n * bridge's guard reaches the app's frame then): there this script only watches the new document. Each document it\n * watches is marked (`ghostlyClipboardGuard`, fixed in place): the bridge reads that to know the guard ran in the page\n * it shows. It uses nothing the page can change after it ran (the page's own code runs later, in the same realm).\n *\n * A fence, not a wall, as the WebRTC guard's own: a frame's window read by its index (`window[0]`) before it loads,\n * inside a shadow tree written in the HTML the page itself sends, is out of its sight.\n * No backslash, `${` or backtick in it.\n */\nexport const CLIPBOARD_GUARD_SCRIPT = `(function noClipboardWrites(w) {\n \"use strict\";\n try {\n const apply = w.Reflect.apply;\n const describe = w.Object.getOwnPropertyDescriptor;\n const define = w.Object.defineProperty;\n const proto = w.Document.prototype;\n const home = w.document;\n const exec = describe(proto, \"execCommand\");\n const fresh = !!exec && exec.configurable === true && typeof exec.value === \"function\";\n const watched = !!describe(home, \"ghostlyClipboardGuard\");\n if (!fresh && watched) return;\n if (!watched) define(home, \"ghostlyClipboardGuard\", { value: true });\n const own = \"<script>(\" + noClipboardWrites + \")(window)<\" + \"/script>\";\n const close = \"<\" + \"/script>\";\n const webRtc = \"<script>(function noWebRtc(\";\n const text = w.String;\n const lower = text.prototype.toLowerCase;\n const slice = text.prototype.slice;\n const index = text.prototype.indexOf;\n const listen = w.EventTarget.prototype.addEventListener;\n const shut = (inner) => {\n try { if (inner && inner !== w) noClipboardWrites(inner); } catch (e) {}\n };\n const count = describe(w, \"length\").get;\n const view = describe(proto, \"defaultView\").get;\n const sweep = () => {\n try { for (let i = apply(count, w, []); i-- > 0;) shut(w[i]); } catch (e) {}\n };\n const elements = w.Element.prototype;\n const getAttribute = elements.getAttribute;\n const setAttribute = elements.setAttribute;\n const removeAttribute = elements.removeAttribute;\n const attachShadow = elements.attachShadow;\n const size = describe(w.NodeList.prototype, \"length\").get;\n let passing = false;\n const first = (frame) => {\n const doc = apply(getAttribute, frame, [\"srcdoc\"]);\n if (doc === null) return;\n let at = 0;\n if (apply(slice, doc, [0, webRtc.length]) === webRtc) {\n const end = apply(index, doc, [close]);\n if (end >= 0) at = end + close.length;\n }\n if (apply(slice, doc, [at, at + own.length]) === own) return;\n passing = true;\n try { apply(setAttribute, frame, [\"srcdoc\", own + doc]); } catch (e) { apply(removeAttribute, frame, [\"srcdoc\"]); }\n passing = false;\n };\n const Observer = w.MutationObserver;\n const observe = Observer.prototype.observe;\n const watch = (root, all) => {\n const scan = () => {\n try {\n const frames = apply(all, root, [\"iframe[srcdoc]\"]);\n for (let i = apply(size, frames, []); i-- > 0;) first(frames[i]);\n } catch (e) {}\n sweep();\n };\n apply(observe, new Observer(scan), [root, { subtree: true, childList: true, attributes: true, attributeFilter: [\"srcdoc\"] }]);\n apply(listen, root, [\"load\", sweep, true]);\n scan();\n return root;\n };\n if (fresh) {\n const run = exec.value;\n const phase = describe(w.Event.prototype, \"eventPhase\").get;\n const trust = (event) => {\n try {\n const found = describe(event, \"isTrusted\");\n if (found && found.get && apply(found.get, event, []) === true) return found.get;\n } catch (e) {}\n return null;\n };\n const dispatching = (event, trusted) => {\n try { return apply(trusted, event, []) === true && apply(phase, event, []) !== 0; } catch (e) { return false; }\n };\n const stamp = describe(w.Event.prototype, \"timeStamp\");\n const clock = w.performance;\n const tick = clock && clock.now;\n const time = () => { try { return apply(tick, clock, []); } catch (e) { return NaN; } };\n const recent = (at) => time() - at <= 1000;\n const shutters = [];\n try {\n const channel = new w.MessageChannel();\n const post = w.MessagePort.prototype.postMessage;\n const out = channel.port2;\n channel.port1.onmessage = () => settle();\n shutters[0] = () => apply(post, out, [0]);\n } catch (e) {}\n try {\n const tasks = w.scheduler;\n const postTask = tasks && tasks.postTask;\n const urgent = { __proto__: null, priority: \"user-blocking\" };\n if (typeof postTask === \"function\") shutters[shutters.length] = () => { apply(postTask, tasks, [settle, urgent]); };\n } catch (e) {}\n try {\n const frame = w.requestAnimationFrame;\n if (typeof frame === \"function\") shutters[shutters.length] = () => { apply(frame, w, [settle]); };\n } catch (e) {}\n let tap = null;\n let trusted = null;\n let tapped = NaN;\n let open = 0;\n let follows = null;\n const settle = () => { open = 0; follows = null; };\n const seen = (event) => {\n const found = trust(event);\n if (found === null) return;\n let at = time();\n try {\n const given = apply(stamp.get, event, []);\n if (given >= 0 && given < at) at = given;\n } catch (e) {}\n tap = event;\n trusted = found;\n tapped = at;\n if (shutters.length === 0) return;\n open = 1;\n for (let i = 0; i < shutters.length; i++) { try { shutters[i](); } catch (e) {} }\n };\n const taps = [\"pointerdown\", \"pointerup\", \"mousedown\", \"mouseup\", \"click\", \"auxclick\", \"dblclick\", \"contextmenu\", \"touchstart\", \"touchend\", \"keydown\", \"keypress\", \"keyup\"];\n for (let i = 0; i < taps.length; i++) apply(listen, w, [taps[i], seen, true]);\n const followed = (event) => {\n if (open === 0) return;\n const found = trust(event);\n if (found !== null) follows = { event: event, trusted: found, at: tapped, next: follows };\n };\n apply(listen, w, [\"submit\", followed, true]);\n apply(listen, w, [\"change\", followed, true]);\n const tapping = () => {\n if (tap !== null && dispatching(tap, trusted) && recent(tapped)) return true;\n for (let f = follows; f !== null; f = f.next) if (dispatching(f.event, f.trusted) && recent(f.at)) return true;\n return false;\n };\n const guarded = function execCommand(command) {\n const name = apply(lower, text(command), []);\n if (name === \"paste\" || ((name === \"copy\" || name === \"cut\") && !tapping())) return false;\n const args = [name];\n for (let i = 1; i < arguments.length; i++) args[i] = arguments[i];\n return apply(run, this, args);\n };\n define(proto, \"execCommand\", { value: guarded, writable: false, enumerable: exec.enumerable, configurable: false });\n const types = w.trustedTypes;\n if (types && !types.defaultPolicy) {\n try {\n let rules = null;\n const rule = (kind) => (input, type, sink) => {\n if (kind === \"createScript\" && sink === \"Location href\") return null;\n if (passing || rules === null) return input;\n return rules[kind] ? apply(rules[kind], undefined, [input, type, sink]) : null;\n };\n const members = [\"createHTML\", \"createScript\", \"createScriptURL\"];\n const create = types.createPolicy;\n const policy = apply(create, types, [\"default\", { createHTML: rule(members[0]), createScript: rule(members[1]), createScriptURL: rule(members[2]) }]);\n const Mistyped = w.TypeError;\n w.Object.getPrototypeOf(types).createPolicy = function createPolicy(name, options) {\n if (this !== types || rules !== null || text(name) !== \"default\") return apply(create, this, arguments);\n const given = { createHTML: null, createScript: null, createScriptURL: null };\n for (let i = 0; i < members.length; i++) {\n const found = options ? options[members[i]] : undefined;\n if (found === undefined || found === null) continue;\n if (typeof found !== \"function\") throw new Mistyped(\"The policy's \" + members[i] + \" is not a function\");\n given[members[i]] = found;\n }\n rules = given;\n return policy;\n };\n } catch (e) {}\n }\n const reopen = proto.open;\n proto.open = function () {\n const got = apply(reopen, this, arguments);\n try { if (apply(view, this, []) === w) apply(listen, this, [\"load\", sweep, true]); } catch (e) {}\n return got;\n };\n const shadowed = (html) => apply(index, apply(lower, html, []), [\"shadowrootmode\"]) >= 0;\n const Refused = w.TypeError;\n const refuse = () => { throw new Refused(\"A declarative shadow root is not allowed here\"); };\n const parsers = [[elements, \"setHTMLUnsafe\"], [w.ShadowRoot && w.ShadowRoot.prototype, \"setHTMLUnsafe\"], [w.Document, \"parseHTMLUnsafe\"]];\n for (let i = 0; i < parsers.length; i++) {\n const owner = parsers[i][0];\n const name = parsers[i][1];\n const real = owner && owner[name];\n if (typeof real !== \"function\") continue;\n owner[name] = function (html) {\n const checked = text(html);\n if (shadowed(checked)) refuse();\n return apply(real, this, arguments.length > 1 ? [checked, arguments[1]] : [checked]);\n };\n }\n let tail = \"\";\n const writes = [\"write\", \"writeln\"];\n for (let i = 0; i < writes.length; i++) {\n const real = proto[writes[i]];\n if (typeof real !== \"function\") continue;\n proto[writes[i]] = function () {\n let checked = \"\";\n for (let j = 0; j < arguments.length; j++) checked += text(arguments[j]);\n if (shadowed(tail + checked)) refuse();\n tail = apply(slice, tail + checked, [-16]);\n return apply(real, this, [checked]);\n };\n }\n const kinds = [\"HTMLIFrameElement\", \"HTMLFrameElement\", \"HTMLObjectElement\", \"HTMLEmbedElement\"];\n const reads = [\"contentWindow\", \"contentDocument\", \"getSVGDocument\"];\n for (let k = 0; k < kinds.length; k++) {\n const owner = w[kinds[k]] && w[kinds[k]].prototype;\n for (let r = 0; r < reads.length; r++) {\n const name = reads[r];\n const found = owner && describe(owner, name);\n const key = found && found.get ? \"get\" : \"value\";\n if (!found || typeof found[key] !== \"function\") continue;\n const read = found[key];\n found[key] = function () {\n const got = apply(read, this, arguments);\n try { shut(name === \"contentWindow\" ? got : apply(view, got, [])); } catch (e) {}\n return got;\n };\n try { define(owner, name, found); } catch (e) {}\n }\n }\n const inShadow = w.DocumentFragment.prototype.querySelectorAll;\n if (attachShadow) {\n elements.attachShadow = function () {\n const root = apply(attachShadow, this, arguments);\n try { watch(root, inShadow); } catch (e) {}\n return root;\n };\n }\n }\n if (!watched) watch(home, proto.querySelectorAll);\n } catch (e) {}\n})(window)`;\n\n/** `CLIPBOARD_GUARD_SCRIPT`'s hash, as a CSP source: the bridge's policy and a contact's own are given it. */\nexport const CLIPBOARD_GUARD_HASH = \"'sha256-ay9kpYD2BIflB8W9w+iAbo1krsFBwIJunUmXTACfhao='\";\n","/**\n * Payment URIs for a wallet that is not Ghostly: what a QR code shows and what a `lightning:` or\n * `bitcoin:` link opens. Building them is all this does; whether the payment arrives is watched by the\n * payee's own source, never assumed from the link having been opened.\n *\n * - `lightning:<invoice>` ([BOLT 11](https://github.com/lightning/bolts/blob/master/11-payment-encoding.md)).\n * - `bitcoin:<address>?amount=<btc>&lightning=<invoice>` ([BIP 21](https://github.com/bitcoin/bips/blob/master/bip-0021.mediawiki)),\n * with the `lightning` parameter of the unified QR convention when an invoice exists too.\n * - `bitcoin:?ark=<address>&amount=<btc>` for an Ark address, the BIP 21 form Ark wallets read.\n */\nexport type PaymentUriInput =\n | { kind: \"lightning\"; invoice: string }\n | { kind: \"bitcoin\"; address: string; amountSat?: number; label?: string; message?: string; lightning?: string }\n | { kind: \"ark\"; address: string; amountSat?: number };\n\n/** Whole sats as the decimal BTC amount BIP 21 wants (`21` → `0.00000021`), never in exponent form. */\nexport function satsToBtc(sats: number): string {\n if (!Number.isSafeInteger(sats) || sats < 0) throw new Error(\"Amount must be a whole number of sats\");\n const whole = Math.floor(sats / 100_000_000);\n const fraction = String(sats % 100_000_000).padStart(8, \"0\").replace(/0+$/, \"\");\n return fraction ? `${whole}.${fraction}` : String(whole);\n}\n\nconst cleanInvoice = (invoice: string) => invoice.trim().toLowerCase().replace(/^lightning:/, \"\");\n\n/** The URI to open in another wallet. Throws on an input that cannot be one. */\nexport function paymentUri(input: PaymentUriInput): string {\n if (input.kind === \"lightning\") {\n const invoice = cleanInvoice(input.invoice);\n if (!/^ln[a-z0-9]+$/.test(invoice)) throw new Error(\"That is not a Lightning invoice\");\n return `lightning:${invoice}`;\n }\n const params = new URLSearchParams();\n if (input.kind === \"ark\") {\n if (!/^[a-z0-9]+$/i.test(input.address)) throw new Error(\"That is not an Ark address\");\n params.set(\"ark\", input.address);\n if (input.amountSat) params.set(\"amount\", satsToBtc(input.amountSat));\n return `bitcoin:?${params.toString()}`;\n }\n if (!/^[a-zA-Z0-9]+$/.test(input.address)) throw new Error(\"That is not a Bitcoin address\");\n if (input.amountSat) params.set(\"amount\", satsToBtc(input.amountSat));\n if (input.label) params.set(\"label\", input.label.slice(0, 140));\n if (input.message) params.set(\"message\", input.message.slice(0, 140));\n if (input.lightning) params.set(\"lightning\", cleanInvoice(input.lightning));\n // `+` would be read as a space by some wallets; BIP 21 wants percent-encoding.\n const query = params.toString().replace(/\\+/g, \"%20\");\n return query ? `bitcoin:${input.address}?${query}` : `bitcoin:${input.address}`;\n}\n\n/**\n * What to put in the QR code: a `lightning:` URI in upper case, so the code uses the smaller alphanumeric\n * mode every Lightning wallet reads; anything with characters outside that mode as it is.\n */\nexport function qrText(uri: string): string {\n const upper = uri.toUpperCase();\n return /^[A-Z0-9 $%*+\\-./:]*$/.test(upper) ? upper : uri;\n}\n","/**\n * Which of two released versions is newer. Every client asks this of whatever\n * it found published, so a malformed answer must never read as an update: the\n * numbers are the only thing trusted here, and anything else sorts as older.\n */\n\n/** `1.2.3`, with an optional `v` and an optional `-beta.1` this ignores. */\nconst RELEASE = /^v?(\\d{1,6})\\.(\\d{1,6})\\.(\\d{1,6})(?:[-+].*)?$/;\n\nfunction parse(version: string): [number, number, number] | null {\n const match = RELEASE.exec(version.trim());\n return match ? [Number(match[1]), Number(match[2]), Number(match[3])] : null;\n}\n\n/** Negative when `a` is older, positive when it is newer, 0 when they match or either is not a version. */\nexport function compareVersions(a: string, b: string): number {\n const left = parse(a);\n const right = parse(b);\n if (!left || !right) return 0;\n for (let i = 0; i < 3; i++) {\n if (left[i] !== right[i]) return left[i] - right[i];\n }\n return 0;\n}\n\n/** Whether `latest` is worth updating to from `current`. Unparseable input is never an update. */\nexport function isNewerVersion(latest: string, current: string): boolean {\n return compareVersions(latest, current) > 0;\n}\n","/**\n * Whether this device's own clock seems to be off, and by how much, so the app can say so where people look at the\n * connection (the chat's connection panel, Settings → Network): \"This device's clock seems to be off by about 2 minutes.\n * Chats may be slow to connect.\"\n *\n * Ghostly dates what it publishes by this device's clock, and several of its checks hold a contact's dates against\n * it. A clock a few minutes off makes chats and groups slow to connect, or never connect with apps that have not been\n * updated, and nothing on screen says why. The app cannot set the clock; it can notice and say.\n *\n * What it hears (`ClockWatch`), each as \"this clock minus theirs is between `low` and `high`\":\n * - a **server**: the `Date` header of an HTTP answer (a Pkarr relay's), a time to the second read between the moment\n * the request went out and the moment its answer came. Where a browser may not read that header of another origin,\n * there is none.\n * - a **contact**: the time of a contact's packet that came between two close reads of its record. Its own clock dated\n * it, and this device knows within seconds when it was published.\n *\n * The rule, on purpose slow to say yes, and never on one contact's word (it is as likely that contact's clock):\n * - a source says \"off\" only when everything it allows is more than `CLOCK_OFF_MS` on one side;\n * - two servers that both say so, the same way, are enough: servers keep time;\n * - else one server and a contact that say so, with no contact saying otherwise;\n * - else three contacts that say so, the same way, and at least three for each one that does not.\n * The amount is the middle of what the sources that say so give (the servers', when two do). Evidence older than\n * `CLOCK_EVIDENCE_MS` says nothing: a clock that was set right is believed at the next answer, and the note goes away.\n */\n/** A clock closer than this to the others' is not said to be off: a minute is what apps up to 1.0.2 allow at their strictest. */\nexport const CLOCK_OFF_MS = 60_000;\n/** Evidence older than this says nothing about the clock now. */\nexport const CLOCK_EVIDENCE_MS = 30 * 60_000;\n/** Contacts that must say so when no server does. */\nexport const CLOCK_PEERS = 3;\n/** Servers that are enough by themselves. */\nexport const CLOCK_SERVERS = 2;\n/** A contact's packet says something only when the two reads around it were this close. */\nexport const CLOCK_PEER_READ_GAP_MS = 15_000;\n/** Sources kept of each kind: a profile has a few relays, and may have hundreds of contacts. */\nconst KEPT = 64;\n\nexport interface ClockSample { low: number; high: number; at: number }\n\n/** -1: everything the sample allows is behind by more than `CLOCK_OFF_MS`; 1: ahead; 0: it does not say. */\nconst says = (sample: ClockSample): -1 | 0 | 1 => (sample.low > CLOCK_OFF_MS ? 1 : sample.high < -CLOCK_OFF_MS ? -1 : 0);\nconst middle = (values: number[]): number => { const sorted = [...values].sort((a, b) => a - b); return sorted[Math.floor((sorted.length - 1) / 2)]; };\n\n/**\n * The rule alone: how far this clock is from the others' (ms, positive when it is ahead) when the samples fresh at\n * `now` say it is clearly off, else null.\n */\nexport function clockOffset(servers: ReadonlyMap<string, ClockSample>, peers: ReadonlyMap<string, ClockSample>, now: number): number | null {\n const fresh = (samples: ReadonlyMap<string, ClockSample>) => [...samples.values()].filter(s => now - s.at < CLOCK_EVIDENCE_MS);\n const s = fresh(servers), p = fresh(peers);\n const mid = (sample: ClockSample) => (sample.low + sample.high) / 2;\n for (const way of [1, -1] as const) {\n const serversOff = s.filter(x => says(x) === way), peersOff = p.filter(x => says(x) === way);\n const serversNot = s.length - serversOff.length, peersNot = p.length - peersOff.length;\n if (serversOff.length >= CLOCK_SERVERS && serversNot === 0) return Math.round(middle(serversOff.map(mid)));\n // A server that does not say so, when one could be read, outweighs any number of contacts.\n if (serversNot > 0) continue;\n if (serversOff.length === 1 && peersOff.length >= 1 && peersNot === 0) return Math.round(middle([...serversOff, ...peersOff].map(mid)));\n if (peersOff.length >= CLOCK_PEERS && peersOff.length >= 3 * peersNot) return Math.round(middle(peersOff.map(mid)));\n }\n return null;\n}\n\nexport class ClockWatch {\n private readonly servers = new Map<string, ClockSample>();\n private readonly peers = new Map<string, ClockSample>();\n private was: number | null = null;\n private timer: ReturnType<typeof setTimeout> | null = null;\n\n /** `onChange`: what `offset` says changed (it appeared, went away, or moved by a minute). */\n constructor(private readonly onChange: (offset: number | null) => void = () => {}, private readonly now: () => number = Date.now) {}\n\n /**\n * A server's time: `date` (ms, to the second) from an answer to a request that went out at `sent` and came back at\n * `received`, both by this clock.\n */\n server(source: string, date: number, sent: number, received: number): void {\n if (!Number.isFinite(date) || date <= 0 || received < sent) return;\n // The answer was made somewhere between the two, at a server time between `date` and the end of that second.\n this.keep(this.servers, source, { low: sent - date - 999, high: received - date, at: this.now() });\n }\n\n /**\n * A contact's packet, dated `packetAt` by its clock, that came between this device's reads of its record at\n * `readBefore` and `readAt` (this clock). Says nothing when the two reads were far apart.\n */\n peer(peer: string, packetAt: number, readBefore: number, readAt: number): void {\n if (!(readBefore > 0) || readAt < readBefore || readAt - readBefore > CLOCK_PEER_READ_GAP_MS || !Number.isFinite(packetAt)) return;\n this.keep(this.peers, peer, { low: readBefore - packetAt, high: readAt - packetAt, at: this.now() });\n }\n\n private keep(samples: Map<string, ClockSample>, source: string, sample: ClockSample): void {\n samples.delete(source);\n samples.set(source, sample);\n if (samples.size > KEPT) samples.delete(samples.keys().next().value!);\n this.settle();\n }\n\n /** This clock minus the others', in ms (positive: ahead), when it is clearly off; else null. */\n get offset(): number | null { return clockOffset(this.servers, this.peers, this.now()); }\n\n /** The clock was set, or the evidence is of another time: nothing is known until the next answers. */\n reset(): void {\n this.servers.clear();\n this.peers.clear();\n this.settle();\n }\n\n /** Stops the timer that lets the evidence age out. */\n close(): void {\n if (this.timer) clearTimeout(this.timer);\n this.timer = null;\n }\n\n private settle(): void {\n this.close();\n for (const samples of [this.servers, this.peers]) for (const [source, sample] of samples) if (this.now() - sample.at >= CLOCK_EVIDENCE_MS) samples.delete(source);\n const offset = this.offset;\n if (offset !== null) {\n // Looked at again when the oldest evidence ages out: what is left may no longer be enough.\n const oldest = Math.min(...[...this.servers.values(), ...this.peers.values()].map(s => s.at));\n this.timer = setTimeout(() => this.settle(), Math.max(1_000, oldest + CLOCK_EVIDENCE_MS - this.now()));\n (this.timer as { unref?: () => void }).unref?.();\n }\n // Told again only when it would read differently: the note says minutes.\n const reads = (value: number | null) => (value === null ? null : Math.round(value / 60_000));\n if (reads(offset) === reads(this.was)) return;\n this.was = offset;\n this.onChange(offset);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCA,IAAa,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4OtC,IAAa,uBAAuB;;;;ACpQpC,SAAgB,UAAU,MAAsB;CAC9C,IAAI,CAAC,OAAO,cAAc,IAAI,KAAK,OAAO,GAAG,MAAM,IAAI,MAAM,uCAAuC;CACpG,MAAM,QAAQ,KAAK,MAAM,OAAO,GAAW;CAC3C,MAAM,WAAW,OAAO,OAAO,GAAW,CAAC,CAAC,SAAS,GAAG,GAAG,CAAC,CAAC,QAAQ,OAAO,EAAE;CAC9E,OAAO,WAAW,GAAG,MAAM,GAAG,aAAa,OAAO,KAAK;AACzD;AAEA,IAAM,gBAAgB,YAAoB,QAAQ,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC,QAAQ,eAAe,EAAE;;AAGhG,SAAgB,WAAW,OAAgC;CACzD,IAAI,MAAM,SAAS,aAAa;EAC9B,MAAM,UAAU,aAAa,MAAM,OAAO;EAC1C,IAAI,CAAC,gBAAgB,KAAK,OAAO,GAAG,MAAM,IAAI,MAAM,iCAAiC;EACrF,OAAO,aAAa;CACtB;CACA,MAAM,SAAS,IAAI,gBAAgB;CACnC,IAAI,MAAM,SAAS,OAAO;EACxB,IAAI,CAAC,eAAe,KAAK,MAAM,OAAO,GAAG,MAAM,IAAI,MAAM,4BAA4B;EACrF,OAAO,IAAI,O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AGA,QAAc;EACZ,IAAI,KAAK,OAAO,aAAa,KAAK,KAAK;EACvC,KAAK,QAAQ;CACf;CAEA,SAAuB;EACrB,KAAK,MAAM;EACX,KAAK,MAAM,WAAW,CAAC,KAAK,SAAS,KAAK,KAAK,GAAG,KAAK,MAAM,CAAC,QAAQ,WAAW,SAAS,IAAI,KAAK,IAAI,IAAI,OAAO,MAAA,MAAyB,QAAQ,OAAO,MAAM;EAChK,MAAM,SAAS,KAAK;EACpB,IAAI,WAAW,MAAM;GAEnB,MAAM,SAAS,KAAK,IAAI,GAAG,CAAC,GAAG,KAAK,QAAQ,OAAO,GAAG,GAAG,KAAK,MAAM,OAAO,CAAC,CAAC,CAAC,KAAI,MAAK,EAAE,EAAE,CAAC;GAC5F,KAAK,QAAQ,iBAAiB,KAAK,OAAO,GAAG,KAAK,IAAI,KAAO,SAAS,oBAAoB,KAAK,IAAI,CAAC,CAAC;GACrG,KAAM,MAAiC,QAAQ;EACjD;EAEA,MAAM,SAAS,UAA0B,UAAU,OAAO,OAAO,KAAK,MAAM,QAAQ,GAAM;EAC1F,IAAI,MAAM,MAAM,MAAM,MAAM,KAAK,GAAG,GAAG;EACvC,KAAK,MAAM;EACX,KAAK,SAAS,MAAM;CACtB;AACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as NothingSpentError } from "./types-
|
|
1
|
+
import { Na as decodeBolt11, SE as utf8Encode, mE as fromBase64Url, xE as utf8Decode, yE as toBase64Url } from "./src-B9HeOlsG.js";
|
|
2
|
+
import { t as NothingSpentError } from "./types-DYLIIkU8.js";
|
|
3
3
|
import { ed25519 } from "@noble/curves/ed25519.js";
|
|
4
4
|
import { sha256 } from "@noble/hashes/sha2.js";
|
|
5
5
|
import { bech32 } from "@scure/base";
|
|
@@ -537,4 +537,4 @@ var FAKE_IDENTITY_PROVIDERS = [
|
|
|
537
537
|
//#endregion
|
|
538
538
|
export { fakeAddress as _, fakeAccount as a, fakeOnchain as b, fakeKeySign as c, fakeRecord as d, fakeRecordText as f, TEST_PROVIDERS_FLAG as g, FakeOnchainProvider as h, TEST_IDENTITIES_FLAG as i, fakeKeySubject as l, FakeLightningProvider as m, FAKE_ISSUER as n, fakeAccountToken as o, testIdentitiesEnabled as p, FAKE_RECORD_HOST as r, fakeKey as s, FAKE_IDENTITY_PROVIDERS as t, fakeKeyring as u, fakeInvoice as v, testProvidersEnabled as x, fakeLightning as y };
|
|
539
539
|
|
|
540
|
-
//# sourceMappingURL=fakes-
|
|
540
|
+
//# sourceMappingURL=fakes-CK9Ra4X4.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fakes-LaWqqMv4.js","names":["hex"],"sources":["../../browser/src/shared/features.ts","../../browser/src/engine/paymentAdapters/providers/testing.ts","../../browser/src/proofs/testing.ts"],"sourcesContent":["/** Release policy: external identity experiments are retained for future work,\n * but must not advertise capabilities, start network lookups, or expose cached\n * external profiles. This does not gate Ghostly participation authentication. */\nexport const EXTERNAL_IDENTITIES_ENABLED: boolean = false;\n\n/** Mini-apps (WISP 1200): `apps/1` on paired sessions and the engine's `app*` calls. On from release 1.2 (a version\n * before 1.2.0 is never cut with it on: `RELEASE_GUARDS` in tools/scripts/changes.mjs). Off, nothing is offered to\n * contacts and every call is refused; a host that runs no apps pins its engine off (`NodeOptions.apps`). */\nexport const APPS_ENABLED: boolean = true;\n\n/**\n * A build that may be put into test mode: a development build (`import.meta.env.DEV`, which vitest also sets) or the\n * e2e suite's build (`VITE_APPS_TEST`, fixed when the build is made, as the mini-app switch is). A release build is\n * neither: Vite folds this to `false` there, so the storage flags the test fakes answer to are ignored. The fakes\n * themselves are still in the bundle (the registries import them); plugins may still pass fakes to the registry.\n */\nexport const testBuild = (): boolean => { try { return !!import.meta.env?.DEV || import.meta.env?.VITE_APPS_TEST === \"1\"; } catch { return false; } };\n\n/**\n * A suite's switch in the page's storage (`localStorage[\"ghostly-test-…\"]`), read only in a test build (`testBuild`): a\n * release build reads none, so a leftover or pasted key changes nothing there. Null when unset, unreadable or released.\n */\nexport const testSwitch = (key: string): string | null => {\n if (!testBuild()) return null;\n try { return globalThis.localStorage?.getItem(key) ?? null; } catch { return null; }\n};\n","import { sha256 } from \"@noble/hashes/sha2.js\";\nimport { bech32 } from \"@scure/base\";\nimport { decodeBolt11 } from \"@ghostly/core\";\nimport type { InvoiceStatus, LightningInvoice, LightningPayResult, LightningPaymentRef, LightningPaymentStatus, LightningProvider, LightningProviderDescriptor } from \"./lightning\";\nimport type { OnchainBalance, OnchainPrepared, OnchainProvider, OnchainProviderDescriptor, OnchainSendRequest, OnchainTx, OnchainTxStatus } from \"./onchain\";\nimport { NothingSpentError, type ProviderField, type ProviderSettings } from \"./types\";\nimport { testBuild } from \"../../../shared/features\";\n\n/**\n * Fake providers, for unit tests and e2e: they hold regtest \"sats\" in memory, so they only ever show up in\n * the Testnet mode, and only in a dev or e2e build (`testBuild`) that has `localStorage[\"ghostly-test-providers\"]\n * === \"1\"` (or a test passes them to the registry itself); a release build ignores the key. No network, no money.\n *\n * `behaviour` drives the outcome of a spend:\n * - settle: invoices are paid by themselves after `settleMs`; payments and broadcasts succeed.\n * - refuse: a spend fails, provably before anything left (`NothingSpentError`).\n * - hang: a spend throws an unknown error, and the lookup later says it went through (a lost answer).\n */\nexport type FakeBehaviour = \"settle\" | \"refuse\" | \"hang\";\nexport const TEST_PROVIDERS_FLAG = \"ghostly-test-providers\";\n\nconst hex = (bytes: Uint8Array) => Array.from(bytes, (b) => b.toString(16).padStart(2, \"0\")).join(\"\");\nconst random = (n: number) => crypto.getRandomValues(new Uint8Array(n));\nconst uint = (value: number, length = 1) => {\n const out: number[] = [];\n for (let v = value; v > 0; v = Math.floor(v / 32)) out.unshift(v % 32);\n while (out.length < length) out.unshift(0);\n return out;\n};\n\n/** A BOLT 11 invoice on regtest with a real checksum and a blank signature: it decodes, nobody can pay it. */\nexport function fakeInvoice(amount: number, paymentHash: Uint8Array, memo = \"\", expirySeconds = 3600): string {\n const words = uint(Math.floor(Date.now() / 1000), 7);\n const field = (tag: number, data: number[]) => words.push(tag, data.length >> 5, data.length & 31, ...data);\n field(1, bech32.toWords(paymentHash));\n if (memo) field(13, bech32.toWords(new TextEncoder().encode(memo.slice(0, 100))));\n field(6, uint(expirySeconds));\n return bech32.encode(`lnbcrt${amount * 10}n`, [...words, ...new Array<number>(104).fill(0)], false);\n}\n\n/** A valid regtest P2WPKH address of nobody's. */\nexport const fakeAddress = () => bech32.encode(\"bcrt\", [0, ...bech32.toWords(random(20))]);\n\nconst FIELDS: ProviderField[] = [\n { name: \"alias\", label: \"Name\", kind: \"text\", optional: true, placeholder: \"Fake node\" },\n { name: \"token\", label: \"Access token\", kind: \"secret\", placeholder: \"anything\", help: \"Sealed like a real provider's secret; the fake only checks it is there.\" },\n { name: \"behaviour\", label: \"Spends\", kind: \"select\", optional: true, options: [{ value: \"settle\", label: \"Go through\" }, { value: \"refuse\", label: \"Are refused\" }, { value: \"hang\", label: \"Lose their answer\" }], defaults: { testnet: \"settle\" } },\n];\nconst validate = ({ secrets, config }: ProviderSettings) => {\n if (!secrets.token?.trim()) throw new Error(\"Enter an access token\");\n if (config.behaviour && ![\"settle\", \"refuse\", \"hang\"].includes(config.behaviour)) throw new Error(\"Unknown behaviour\");\n};\n\ninterface FakeOptions { alias?: string; behaviour?: FakeBehaviour; balance?: number; settleMs?: number; token?: string }\n\nexport class FakeLightningProvider implements LightningProvider {\n readonly capabilities = { receive: true, send: true, balance: true, lookup: true };\n readonly invoices = new Map<string, { invoice: LightningInvoice; paid: boolean }>();\n readonly payments = new Map<string, LightningPaymentStatus>();\n readonly paid: string[] = [];\n balance: number;\n behaviour: FakeBehaviour;\n closed = false;\n private timers: ReturnType<typeof setTimeout>[] = [];\n constructor(readonly options: FakeOptions = {}) { this.balance = options.balance ?? 100_000; this.behaviour = options.behaviour ?? \"settle\"; }\n async info() { return { network: \"regtest\" as const, alias: this.options.alias || \"Fake Lightning\", balance: this.balance }; }\n async createInvoice(amount: number, memo?: string): Promise<LightningInvoice> {\n const preimage = random(32), hash = sha256(preimage);\n const invoice: LightningInvoice = { invoice: fakeInvoice(amount, hash, memo), paymentHash: hex(hash), amount, expiresAt: Date.now() + 3600_000, ref: hex(preimage) };\n this.invoices.set(invoice.paymentHash, { invoice, paid: false });\n if (this.behaviour === \"settle\") this.timers.push(setTimeout(() => this.markPaid(invoice.paymentHash), this.options.settleMs ?? 1500));\n return invoice;\n }\n /** Someone paid this invoice. */\n markPaid(paymentHash: string) {\n const entry = this.invoices.get(paymentHash);\n if (!entry || entry.paid || this.closed) return;\n entry.paid = true; this.balance += entry.invoice.amount;\n }\n async invoiceStatus(invoice: LightningInvoice): Promise<InvoiceStatus> {\n const entry = this.invoices.get(invoice.paymentHash);\n if (entry?.paid) return { state: \"paid\", amount: entry.invoice.amount };\n return { state: invoice.expiresAt < Date.now() ? \"expired\" : \"open\" };\n }\n async estimateFee(_invoice: string, amount: number) { return Math.max(1, Math.ceil(amount / 100)); }\n async payInvoice(invoice: string, maxFee: number): Promise<LightningPayResult> {\n const decoded = decodeBolt11(invoice);\n if (!decoded?.paymentHash || decoded.amountSat === null) throw new NothingSpentError(\"Not an invoice this fake can pay\");\n const fee = Math.min(maxFee, Math.max(1, Math.ceil(decoded.amountSat / 100)));\n if (this.behaviour === \"refuse\") throw new NothingSpentError(\"No route (fake)\");\n if (this.balance < decoded.amountSat + fee) throw new NothingSpentError(\"Not enough sats in the fake wallet\");\n this.balance -= decoded.amountSat + fee;\n this.paid.push(decoded.paymentHash);\n this.payments.set(decoded.paymentHash, { state: \"paid\", fee, preimage: hex(random(32)) });\n if (this.behaviour === \"hang\") throw new Error(\"Connection lost (fake)\");\n return { state: \"paid\", fee, preimage: this.payments.get(decoded.paymentHash)!.preimage };\n }\n async paymentStatus(payment: LightningPaymentRef): Promise<LightningPaymentStatus> {\n return this.payments.get(payment.paymentHash) ?? { state: \"failed\" };\n }\n async close() { this.closed = true; for (const t of this.timers) clearTimeout(t); }\n}\n\nexport class FakeOnchainProvider implements OnchainProvider {\n readonly addresses: string[] = [];\n readonly broadcasts: string[] = [];\n readonly released: string[] = [];\n readonly txs = new Map<string, { prepared: OnchainPrepared; confirmations: number }>();\n confirmed: number;\n behaviour: FakeBehaviour;\n closed = false;\n constructor(readonly options: FakeOptions = {}) { this.confirmed = options.balance ?? 100_000; this.behaviour = options.behaviour ?? \"settle\"; }\n async info() { return { network: \"regtest\" as const, alias: this.options.alias || \"Fake Bitcoin wallet\" }; }\n async receiveAddress() { const address = fakeAddress(); this.addresses.push(address); return address; }\n async balance(): Promise<OnchainBalance> { return { confirmed: this.confirmed, unconfirmed: 0 }; }\n async prepareSend(request: OnchainSendRequest): Promise<OnchainPrepared> {\n const feeRate = request.feeRate ?? 2, fee = feeRate * 141;\n if (fee > request.feeCap) throw new Error(`The fee (${fee} sats) is above your limit`);\n if (this.confirmed < request.amount + fee) throw new Error(\"Not enough confirmed sats\");\n return { txid: hex(random(32)), address: request.address, amount: request.amount, fee, feeRate, signed: hex(random(64)) };\n }\n async broadcast(prepared: OnchainPrepared) {\n if (this.behaviour === \"refuse\") throw new NothingSpentError(\"Rejected by the node (fake)\");\n if (!this.txs.has(prepared.txid)) { this.confirmed -= prepared.amount + prepared.fee; this.txs.set(prepared.txid, { prepared, confirmations: 1 }); }\n this.broadcasts.push(prepared.txid);\n if (this.behaviour === \"hang\") throw new Error(\"Connection lost (fake)\");\n return prepared.txid;\n }\n async status(prepared: OnchainPrepared): Promise<OnchainTxStatus> {\n const tx = this.txs.get(prepared.txid);\n return tx ? { state: \"confirmed\", confirmations: tx.confirmations } : { state: \"missing\", confirmations: 0 };\n }\n async release(prepared: OnchainPrepared) { this.released.push(prepared.txid); }\n async history(limit: number): Promise<OnchainTx[]> {\n return [...this.txs.values()].reverse().slice(0, limit).map(({ prepared, confirmations }) => ({ txid: prepared.txid, amount: -prepared.amount, fee: prepared.fee, confirmations }));\n }\n async close() { this.closed = true; }\n}\n\nconst options = ({ config, secrets }: ProviderSettings): FakeOptions => ({ alias: config.alias, behaviour: (config.behaviour as FakeBehaviour) || \"settle\", token: secrets.token });\n\nexport const fakeLightning: LightningProviderDescriptor = {\n id: \"fake-lightning\",\n label: \"Fake Lightning (test)\",\n kind: \"lightning\",\n description: \"In-memory regtest node for tests. Holds nothing.\",\n networks: [\"regtest\"],\n platforms: [\"web\", \"desktop\"],\n fields: FIELDS,\n experimental: true,\n validate,\n async create(settings) { return new FakeLightningProvider(options(settings)); },\n};\n\nexport const fakeOnchain: OnchainProviderDescriptor = {\n id: \"fake-onchain\",\n label: \"Fake Bitcoin wallet (test)\",\n kind: \"onchain\",\n description: \"In-memory regtest wallet for tests. Holds nothing.\",\n networks: [\"regtest\"],\n platforms: [\"web\", \"desktop\"],\n fields: FIELDS,\n experimental: true,\n validate,\n async create(settings) { return new FakeOnchainProvider(options(settings)); },\n};\n\n/** Whether this browser asked for the fake providers (an e2e run sets it before the app starts). */\nexport function testProvidersEnabled(): boolean {\n try { return testBuild() && globalThis.localStorage?.getItem(TEST_PROVIDERS_FLAG) === \"1\"; } catch { return false; }\n}\n","import { ed25519 } from \"@noble/curves/ed25519.js\";\nimport { fromBase64Url, toBase64Url, utf8Decode, utf8Encode, type IdentityStatement } from \"@ghostly/core\";\nimport { testBuild } from \"../shared/features\";\nimport type { IdentityProofProvider } from \"./contract\";\n\n/**\n * Fake identity providers, for unit tests and e2e. No network, no real accounts. They are in the\n * registry only in a dev or e2e build (`testBuild`) that has `localStorage[\"ghostly-test-identities\"] === \"1\"`\n * (or a test passes them itself); a release build ignores the key.\n *\n * - fake-key self-custodied: an Ed25519 key held by a fake in-app signer, or signed \"outside\" and pasted.\n * - fake-account provider-attested: a fake issuer signs a token whose nonce is the statement id (like OIDC).\n * - fake-record self-custodied, published: a record the verifier fetches through `ctx.fetch` (like DNS).\n */\nexport const TEST_IDENTITIES_FLAG = \"ghostly-test-identities\";\nexport const testIdentitiesEnabled = () => { try { return testBuild() && globalThis.localStorage?.getItem(TEST_IDENTITIES_FLAG) === \"1\"; } catch { return false; } };\n\nconst HEX64 = /^[a-f0-9]{64}$/;\nconst hex = (b: Uint8Array) => Array.from(b, x => x.toString(16).padStart(2, \"0\")).join(\"\");\nconst unhex = (s: string) => Uint8Array.from(s.match(/../g)!, x => parseInt(x, 16));\nconst normalizeHexKey = (input: string) => { const v = input.trim().toLowerCase(); if (!HEX64.test(v)) throw new Error(\"Enter 64 hex characters\"); return v; };\nconst exactKeys = (raw: unknown, keys: string) => !!raw && typeof raw === \"object\" && !Array.isArray(raw) && Object.keys(raw).sort().join(\",\") === keys;\n\n/** The key behind the fake in-app signer, made on first use so a release start draws no key. Tests may replace it. */\nlet fakeSeed: Uint8Array | undefined;\nexport const fakeKeyring = { get seed() { return fakeSeed ??= ed25519.utils.randomSecretKey(); }, set seed(value: Uint8Array) { fakeSeed = value; } };\nexport const fakeKeySubject = (seed = fakeKeyring.seed) => hex(ed25519.getPublicKey(seed));\nexport const fakeKeySign = (statement: IdentityStatement, seed = fakeKeyring.seed) => ({ sig: toBase64Url(ed25519.sign(statement.bytes, seed)) });\n\nexport interface FakeKeyEvidence { sig: string }\nexport const fakeKey: IdentityProofProvider<FakeKeyEvidence> = {\n id: \"fake-key\", label: \"Test key\", category: \"self-custodied\",\n summary: \"Sign with the test key\", description: \"A test identity: an Ed25519 key held by this page. For tests only.\",\n platforms: [\"web\", \"desktop\"],\n subject: { label: \"Public key\", placeholder: \"64 hex characters\", normalize: normalizeHexKey, short: k => `${k.slice(0, 8)}…${k.slice(-4)}` },\n publicUri: k => `urn:ghostly-test:${k}`,\n validity: { defaultDays: 30, maxDays: 365 },\n privacy: \"Nothing: checked on this device.\",\n signers: [\n { id: \"fake-signer\", kind: \"in-app\", label: \"Test signer\", fields: [{ name: \"refuse\", label: \"Refuse\", kind: \"text\", optional: true }],\n run: async (ctx, work) => {\n ctx.signal.throwIfAborted();\n if (ctx.values.refuse) throw new Error(\"The test signer refused\");\n return work({ subject: async () => fakeKeySubject(), sign: async statement => fakeKeySign(statement) });\n } },\n { id: \"fake-tool\", kind: \"external-tool\", label: \"Sign outside Ghostly\",\n instructions: statement => ({ steps: [{ text: \"Sign this statement with your test key:\", copy: statement.text }], paste: { label: \"Signature (base64url)\" } }),\n parse: pasted => { const sig = pasted.trim(); if (!/^[A-Za-z0-9_-]{86}$/.test(sig)) throw new Error(\"That is not a test signature\"); return { sig }; } },\n ],\n parseEvidence(raw) {\n const e = raw as FakeKeyEvidence;\n if (!exactKeys(raw, \"sig\") || typeof e.sig !== \"string\" || !/^[A-Za-z0-9_-]{86}$/.test(e.sig)) throw new Error(\"Invalid test evidence\");\n return { sig: e.sig };\n },\n async verify(statement, evidence) {\n let ok: boolean;\n try { ok = ed25519.verify(fromBase64Url(evidence.sig), statement.bytes, unhex(statement.binding.subject)); } catch { ok = false; }\n if (!ok) throw new Error(\"Invalid test signature\");\n return { subject: statement.binding.subject, source: \"Test signature (Ed25519)\" };\n },\n};\n\n/** The fake issuer's key. Its public half is what fake-account trusts, like a provider's JWKS. */\nconst ISSUER_SEED = unhex(\"7a\".repeat(32));\nexport const FAKE_ISSUER = \"https://issuer.ghostly.test\";\nexport interface FakeAccountEvidence { token: string }\n/** What the fake login page signs: iss, sub, nonce (= statement id), iat. */\nexport function fakeAccountToken(statement: IdentityStatement, account = \"alice\", seed = ISSUER_SEED, iat = statement.binding.issuedAt): FakeAccountEvidence {\n const payload = toBase64Url(utf8Encode(JSON.stringify({ iss: FAKE_ISSUER, sub: account, nonce: statement.id, iat })));\n return { token: `${payload}.${toBase64Url(ed25519.sign(utf8Encode(payload), seed))}` };\n}\nexport const fakeAccount: IdentityProofProvider<FakeAccountEvidence> = {\n id: \"fake-account\", label: \"Test account\", category: \"provider-attested\",\n summary: \"Log in to the test issuer\", description: \"A test login provider that vouches for an account. For tests only.\",\n platforms: [\"web\", \"desktop\"],\n subject: { label: \"Provider\", options: [{ value: FAKE_ISSUER, label: \"Test issuer\" }],\n normalize: input => { if (input.trim() !== FAKE_ISSUER) throw new Error(\"Unknown test issuer\"); return FAKE_ISSUER; } },\n validity: { defaultDays: 30, maxDays: 90 },\n privacy: \"Nothing: the issuer's signature is checked on this device.\",\n signers: [{ id: \"fake-login\", kind: \"redirect\", label: \"Log in to the test issuer\",\n start: async (statement, ctx) => { ctx.signal.throwIfAborted(); return fakeAccountToken(statement, ctx.values.account || \"alice\"); } }],\n parseEvidence(raw) {\n const e = raw as FakeAccountEvidence;\n if (!exactKeys(raw, \"token\") || typeof e.token !== \"string\" || e.token.length > 2048 || !/^[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]{86}$/.test(e.token)) throw new Error(\"Invalid test token\");\n return { token: e.token };\n },\n async verify(statement, { token }) {\n const [payload, sig] = token.split(\".\");\n if (!ed25519.verify(fromBase64Url(sig), utf8Encode(payload), ed25519.getPublicKey(ISSUER_SEED))) throw new Error(\"Not signed by the test issuer\");\n const claims = JSON.parse(utf8Decode(fromBase64Url(payload))) as { iss: string; sub: string; nonce: string };\n if (claims.iss !== statement.binding.subject) throw new Error(\"Token from another issuer\");\n if (claims.nonce !== statement.id) throw new Error(\"Token for another statement\");\n if (typeof claims.sub !== \"string\" || !/^[a-z0-9]{1,64}$/.test(claims.sub)) throw new Error(\"Invalid account\");\n return { subject: `${claims.iss}#${claims.sub}`, attester: \"issuer.ghostly.test\", source: \"Token signed by the test issuer\",\n display: { name: claims.sub, source: \"Test issuer profile\", fetchedAt: statement.binding.issuedAt } };\n },\n};\n\n/** fake-record's records: subject → published text. The verifier reads `https://records.ghostly.test/<subject>`. */\nexport const FAKE_RECORD_HOST = \"https://records.ghostly.test/\";\nexport const fakeRecordText = (statement: IdentityStatement) => `ghostly-proof=${statement.id}`;\nexport const fakeRecord: IdentityProofProvider<Record<string, never>> = {\n id: \"fake-record\", label: \"Test record\", category: \"self-custodied\",\n summary: \"Publish a test record\", description: \"A test record published where the verifier looks it up, like DNS. For tests only.\",\n platforms: [\"web\", \"desktop\"],\n subject: { label: \"Name\", placeholder: \"alice\", normalize: input => { const v = input.trim().toLowerCase(); if (!/^[a-z0-9-]{1,63}$/.test(v)) throw new Error(\"Letters, digits and dashes\"); return v; } },\n validity: { defaultDays: 30, maxDays: 365 },\n recheck: { afterSeconds: 3600 },\n privacy: \"The verifier asks records.ghostly.test for the record: that server learns the name was checked.\",\n signers: [{ id: \"fake-publish\", kind: \"publish\", label: \"Publish a record\",\n instructions: statement => ({ steps: [{ text: `Publish this record for ${statement.binding.subject}:`, copy: fakeRecordText(statement) }] }),\n evidence: () => ({}) }],\n parseEvidence(raw) { if (!exactKeys(raw, \"\")) throw new Error(\"Invalid test evidence\"); return {}; },\n async verify(statement, _evidence, ctx) {\n const response = await ctx.fetch(`${FAKE_RECORD_HOST}${statement.binding.subject}`, { maxBytes: 4096, signal: ctx.signal });\n if (response.status !== 200 || !response.text.split(\"\\n\").includes(fakeRecordText(statement))) throw new Error(\"The record is not published\");\n return { subject: statement.binding.subject, source: \"Record published at records.ghostly.test\" };\n },\n};\n\nexport const FAKE_IDENTITY_PROVIDERS: readonly IdentityProofProvider[] = [fakeKey, fakeAccount, fakeRecord];\n"],"mappings":";;;;;;;;;;;;AAgBA,IAAa,kBAA2B;CAAE,IAAI;EAAE,OAAiC;CAAyC,QAAQ;EAAE,OAAO;CAAO;AAAE;;;ACGpJ,IAAa,sBAAsB;AAEnC,IAAMA,SAAO,UAAsB,MAAM,KAAK,QAAQ,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC,SAAS,GAAG,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE;AACpG,IAAM,UAAU,MAAc,OAAO,gBAAgB,IAAI,WAAW,CAAC,CAAC;AACtE,IAAM,QAAQ,OAAe,SAAS,MAAM;CAC1C,MAAM,MAAgB,CAAC;CACvB,KAAK,IAAI,IAAI,OAAO,IAAI,GAAG,IAAI,KAAK,MAAM,IAAI,EAAE,GAAG,IAAI,QAAQ,IAAI,EAAE;CACrE,OAAO,IAAI,SAAS,QAAQ,IAAI,QAAQ,CAAC;CACz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AAC,EAAE;EAC1I,iBAAiB,CAAC;CAAG,CAAC;CACxB,cAAc,KAAK;EAAE,IAAI,CAAC,UAAU,KAAK,EAAE,GAAG,MAAM,IAAI,MAAM,uBAAuB;EAAG,OAAO,CAAC;CAAG;CACnG,MAAM,OAAO,WAAW,WAAW,KAAK;EACtC,MAAM,WAAW,MAAM,IAAI,MAAM,GAAG,mBAAmB,UAAU,QAAQ,WAAW;GAAE,UAAU;GAAM,QAAQ,IAAI;EAAO,CAAC;EAC1H,IAAI,SAAS,WAAW,OAAO,CAAC,SAAS,KAAK,MAAM,IAAI,CAAC,CAAC,SAAS,eAAe,SAAS,CAAC,GAAG,MAAM,IAAI,MAAM,6BAA6B;EAC5I,OAAO;GAAE,SAAS,UAAU,QAAQ;GAAS,QAAQ;EAA2C;CAClG;AACF;AAEA,IAAa,0BAA4D;CAAC;CAAS;CAAa;AAAU"}
|
|
1
|
+
{"version":3,"file":"fakes-CK9Ra4X4.js","names":["hex"],"sources":["../../browser/src/shared/features.ts","../../browser/src/engine/paymentAdapters/providers/testing.ts","../../browser/src/proofs/testing.ts"],"sourcesContent":["/** Release policy: external identity experiments are retained for future work,\n * but must not advertise capabilities, start network lookups, or expose cached\n * external profiles. This does not gate Ghostly participation authentication. */\nexport const EXTERNAL_IDENTITIES_ENABLED: boolean = false;\n\n/** Mini-apps (WISP 1200): `apps/1` on paired sessions and the engine's `app*` calls. On from release 1.2 (a version\n * before 1.2.0 is never cut with it on: `RELEASE_GUARDS` in tools/scripts/changes.mjs). Off, nothing is offered to\n * contacts and every call is refused; a host that runs no apps pins its engine off (`NodeOptions.apps`). */\nexport const APPS_ENABLED: boolean = true;\n\n/**\n * A build that may be put into test mode: a development build (`import.meta.env.DEV`, which vitest also sets) or the\n * e2e suite's build (`VITE_APPS_TEST`, fixed when the build is made, as the mini-app switch is). A release build is\n * neither: Vite folds this to `false` there, so the storage flags the test fakes answer to are ignored. The fakes\n * themselves are still in the bundle (the registries import them); plugins may still pass fakes to the registry.\n */\nexport const testBuild = (): boolean => { try { return !!import.meta.env?.DEV || import.meta.env?.VITE_APPS_TEST === \"1\"; } catch { return false; } };\n\n/**\n * A suite's switch in the page's storage (`localStorage[\"ghostly-test-…\"]`), read only in a test build (`testBuild`): a\n * release build reads none, so a leftover or pasted key changes nothing there. Null when unset, unreadable or released.\n */\nexport const testSwitch = (key: string): string | null => {\n if (!testBuild()) return null;\n try { return globalThis.localStorage?.getItem(key) ?? null; } catch { return null; }\n};\n","import { sha256 } from \"@noble/hashes/sha2.js\";\nimport { bech32 } from \"@scure/base\";\nimport { decodeBolt11 } from \"@ghostly/core\";\nimport type { InvoiceStatus, LightningInvoice, LightningPayResult, LightningPaymentRef, LightningPaymentStatus, LightningProvider, LightningProviderDescriptor } from \"./lightning\";\nimport type { OnchainBalance, OnchainPrepared, OnchainProvider, OnchainProviderDescriptor, OnchainSendRequest, OnchainTx, OnchainTxStatus } from \"./onchain\";\nimport { NothingSpentError, type ProviderField, type ProviderSettings } from \"./types\";\nimport { testBuild } from \"../../../shared/features\";\n\n/**\n * Fake providers, for unit tests and e2e: they hold regtest \"sats\" in memory, so they only ever show up in\n * the Testnet mode, and only in a dev or e2e build (`testBuild`) that has `localStorage[\"ghostly-test-providers\"]\n * === \"1\"` (or a test passes them to the registry itself); a release build ignores the key. No network, no money.\n *\n * `behaviour` drives the outcome of a spend:\n * - settle: invoices are paid by themselves after `settleMs`; payments and broadcasts succeed.\n * - refuse: a spend fails, provably before anything left (`NothingSpentError`).\n * - hang: a spend throws an unknown error, and the lookup later says it went through (a lost answer).\n */\nexport type FakeBehaviour = \"settle\" | \"refuse\" | \"hang\";\nexport const TEST_PROVIDERS_FLAG = \"ghostly-test-providers\";\n\nconst hex = (bytes: Uint8Array) => Array.from(bytes, (b) => b.toString(16).padStart(2, \"0\")).join(\"\");\nconst random = (n: number) => crypto.getRandomValues(new Uint8Array(n));\nconst uint = (value: number, length = 1) => {\n const out: number[] = [];\n for (let v = value; v > 0; v = Math.floor(v / 32)) out.unshift(v % 32);\n while (out.length < length) out.unshift(0);\n return out;\n};\n\n/** A BOLT 11 invoice on regtest with a real checksum and a blank signature: it decodes, nobody can pay it. */\nexport function fakeInvoice(amount: number, paymentHash: Uint8Array, memo = \"\", expirySeconds = 3600): string {\n const words = uint(Math.floor(Date.now() / 1000), 7);\n const field = (tag: number, data: number[]) => words.push(tag, data.length >> 5, data.length & 31, ...data);\n field(1, bech32.toWords(paymentHash));\n if (memo) field(13, bech32.toWords(new TextEncoder().encode(memo.slice(0, 100))));\n field(6, uint(expirySeconds));\n return bech32.encode(`lnbcrt${amount * 10}n`, [...words, ...new Array<number>(104).fill(0)], false);\n}\n\n/** A valid regtest P2WPKH address of nobody's. */\nexport const fakeAddress = () => bech32.encode(\"bcrt\", [0, ...bech32.toWords(random(20))]);\n\nconst FIELDS: ProviderField[] = [\n { name: \"alias\", label: \"Name\", kind: \"text\", optional: true, placeholder: \"Fake node\" },\n { name: \"token\", label: \"Access token\", kind: \"secret\", placeholder: \"anything\", help: \"Sealed like a real provider's secret; the fake only checks it is there.\" },\n { name: \"behaviour\", label: \"Spends\", kind: \"select\", optional: true, options: [{ value: \"settle\", label: \"Go through\" }, { value: \"refuse\", label: \"Are refused\" }, { value: \"hang\", label: \"Lose their answer\" }], defaults: { testnet: \"settle\" } },\n];\nconst validate = ({ secrets, config }: ProviderSettings) => {\n if (!secrets.token?.trim()) throw new Error(\"Enter an access token\");\n if (config.behaviour && ![\"settle\", \"refuse\", \"hang\"].includes(config.behaviour)) throw new Error(\"Unknown behaviour\");\n};\n\ninterface FakeOptions { alias?: string; behaviour?: FakeBehaviour; balance?: number; settleMs?: number; token?: string }\n\nexport class FakeLightningProvider implements LightningProvider {\n readonly capabilities = { receive: true, send: true, balance: true, lookup: true };\n readonly invoices = new Map<string, { invoice: LightningInvoice; paid: boolean }>();\n readonly payments = new Map<string, LightningPaymentStatus>();\n readonly paid: string[] = [];\n balance: number;\n behaviour: FakeBehaviour;\n closed = false;\n private timers: ReturnType<typeof setTimeout>[] = [];\n constructor(readonly options: FakeOptions = {}) { this.balance = options.balance ?? 100_000; this.behaviour = options.behaviour ?? \"settle\"; }\n async info() { return { network: \"regtest\" as const, alias: this.options.alias || \"Fake Lightning\", balance: this.balance }; }\n async createInvoice(amount: number, memo?: string): Promise<LightningInvoice> {\n const preimage = random(32), hash = sha256(preimage);\n const invoice: LightningInvoice = { invoice: fakeInvoice(amount, hash, memo), paymentHash: hex(hash), amount, expiresAt: Date.now() + 3600_000, ref: hex(preimage) };\n this.invoices.set(invoice.paymentHash, { invoice, paid: false });\n if (this.behaviour === \"settle\") this.timers.push(setTimeout(() => this.markPaid(invoice.paymentHash), this.options.settleMs ?? 1500));\n return invoice;\n }\n /** Someone paid this invoice. */\n markPaid(paymentHash: string) {\n const entry = this.invoices.get(paymentHash);\n if (!entry || entry.paid || this.closed) return;\n entry.paid = true; this.balance += entry.invoice.amount;\n }\n async invoiceStatus(invoice: LightningInvoice): Promise<InvoiceStatus> {\n const entry = this.invoices.get(invoice.paymentHash);\n if (entry?.paid) return { state: \"paid\", amount: entry.invoice.amount };\n return { state: invoice.expiresAt < Date.now() ? \"expired\" : \"open\" };\n }\n async estimateFee(_invoice: string, amount: number) { return Math.max(1, Math.ceil(amount / 100)); }\n async payInvoice(invoice: string, maxFee: number): Promise<LightningPayResult> {\n const decoded = decodeBolt11(invoice);\n if (!decoded?.paymentHash || decoded.amountSat === null) throw new NothingSpentError(\"Not an invoice this fake can pay\");\n const fee = Math.min(maxFee, Math.max(1, Math.ceil(decoded.amountSat / 100)));\n if (this.behaviour === \"refuse\") throw new NothingSpentError(\"No route (fake)\");\n if (this.balance < decoded.amountSat + fee) throw new NothingSpentError(\"Not enough sats in the fake wallet\");\n this.balance -= decoded.amountSat + fee;\n this.paid.push(decoded.paymentHash);\n this.payments.set(decoded.paymentHash, { state: \"paid\", fee, preimage: hex(random(32)) });\n if (this.behaviour === \"hang\") throw new Error(\"Connection lost (fake)\");\n return { state: \"paid\", fee, preimage: this.payments.get(decoded.paymentHash)!.preimage };\n }\n async paymentStatus(payment: LightningPaymentRef): Promise<LightningPaymentStatus> {\n return this.payments.get(payment.paymentHash) ?? { state: \"failed\" };\n }\n async close() { this.closed = true; for (const t of this.timers) clearTimeout(t); }\n}\n\nexport class FakeOnchainProvider implements OnchainProvider {\n readonly addresses: string[] = [];\n readonly broadcasts: string[] = [];\n readonly released: string[] = [];\n readonly txs = new Map<string, { prepared: OnchainPrepared; confirmations: number }>();\n confirmed: number;\n behaviour: FakeBehaviour;\n closed = false;\n constructor(readonly options: FakeOptions = {}) { this.confirmed = options.balance ?? 100_000; this.behaviour = options.behaviour ?? \"settle\"; }\n async info() { return { network: \"regtest\" as const, alias: this.options.alias || \"Fake Bitcoin wallet\" }; }\n async receiveAddress() { const address = fakeAddress(); this.addresses.push(address); return address; }\n async balance(): Promise<OnchainBalance> { return { confirmed: this.confirmed, unconfirmed: 0 }; }\n async prepareSend(request: OnchainSendRequest): Promise<OnchainPrepared> {\n const feeRate = request.feeRate ?? 2, fee = feeRate * 141;\n if (fee > request.feeCap) throw new Error(`The fee (${fee} sats) is above your limit`);\n if (this.confirmed < request.amount + fee) throw new Error(\"Not enough confirmed sats\");\n return { txid: hex(random(32)), address: request.address, amount: request.amount, fee, feeRate, signed: hex(random(64)) };\n }\n async broadcast(prepared: OnchainPrepared) {\n if (this.behaviour === \"refuse\") throw new NothingSpentError(\"Rejected by the node (fake)\");\n if (!this.txs.has(prepared.txid)) { this.confirmed -= prepared.amount + prepared.fee; this.txs.set(prepared.txid, { prepared, confirmations: 1 }); }\n this.broadcasts.push(prepared.txid);\n if (this.behaviour === \"hang\") throw new Error(\"Connection lost (fake)\");\n return prepared.txid;\n }\n async status(prepared: OnchainPrepared): Promise<OnchainTxStatus> {\n const tx = this.txs.get(prepared.txid);\n return tx ? { state: \"confirmed\", confirmations: tx.confirmations } : { state: \"missing\", confirmations: 0 };\n }\n async release(prepared: OnchainPrepared) { this.released.push(prepared.txid); }\n async history(limit: number): Promise<OnchainTx[]> {\n return [...this.txs.values()].reverse().slice(0, limit).map(({ prepared, confirmations }) => ({ txid: prepared.txid, amount: -prepared.amount, fee: prepared.fee, confirmations }));\n }\n async close() { this.closed = true; }\n}\n\nconst options = ({ config, secrets }: ProviderSettings): FakeOptions => ({ alias: config.alias, behaviour: (config.behaviour as FakeBehaviour) || \"settle\", token: secrets.token });\n\nexport const fakeLightning: LightningProviderDescriptor = {\n id: \"fake-lightning\",\n label: \"Fake Lightning (test)\",\n kind: \"lightning\",\n description: \"In-memory regtest node for tests. Holds nothing.\",\n networks: [\"regtest\"],\n platforms: [\"web\", \"desktop\"],\n fields: FIELDS,\n experimental: true,\n validate,\n async create(settings) { return new FakeLightningProvider(options(settings)); },\n};\n\nexport const fakeOnchain: OnchainProviderDescriptor = {\n id: \"fake-onchain\",\n label: \"Fake Bitcoin wallet (test)\",\n kind: \"onchain\",\n description: \"In-memory regtest wallet for tests. Holds nothing.\",\n networks: [\"regtest\"],\n platforms: [\"web\", \"desktop\"],\n fields: FIELDS,\n experimental: true,\n validate,\n async create(settings) { return new FakeOnchainProvider(options(settings)); },\n};\n\n/** Whether this browser asked for the fake providers (an e2e run sets it before the app starts). */\nexport function testProvidersEnabled(): boolean {\n try { return testBuild() && globalThis.localStorage?.getItem(TEST_PROVIDERS_FLAG) === \"1\"; } catch { return false; }\n}\n","import { ed25519 } from \"@noble/curves/ed25519.js\";\nimport { fromBase64Url, toBase64Url, utf8Decode, utf8Encode, type IdentityStatement } from \"@ghostly/core\";\nimport { testBuild } from \"../shared/features\";\nimport type { IdentityProofProvider } from \"./contract\";\n\n/**\n * Fake identity providers, for unit tests and e2e. No network, no real accounts. They are in the\n * registry only in a dev or e2e build (`testBuild`) that has `localStorage[\"ghostly-test-identities\"] === \"1\"`\n * (or a test passes them itself); a release build ignores the key.\n *\n * - fake-key self-custodied: an Ed25519 key held by a fake in-app signer, or signed \"outside\" and pasted.\n * - fake-account provider-attested: a fake issuer signs a token whose nonce is the statement id (like OIDC).\n * - fake-record self-custodied, published: a record the verifier fetches through `ctx.fetch` (like DNS).\n */\nexport const TEST_IDENTITIES_FLAG = \"ghostly-test-identities\";\nexport const testIdentitiesEnabled = () => { try { return testBuild() && globalThis.localStorage?.getItem(TEST_IDENTITIES_FLAG) === \"1\"; } catch { return false; } };\n\nconst HEX64 = /^[a-f0-9]{64}$/;\nconst hex = (b: Uint8Array) => Array.from(b, x => x.toString(16).padStart(2, \"0\")).join(\"\");\nconst unhex = (s: string) => Uint8Array.from(s.match(/../g)!, x => parseInt(x, 16));\nconst normalizeHexKey = (input: string) => { const v = input.trim().toLowerCase(); if (!HEX64.test(v)) throw new Error(\"Enter 64 hex characters\"); return v; };\nconst exactKeys = (raw: unknown, keys: string) => !!raw && typeof raw === \"object\" && !Array.isArray(raw) && Object.keys(raw).sort().join(\",\") === keys;\n\n/** The key behind the fake in-app signer, made on first use so a release start draws no key. Tests may replace it. */\nlet fakeSeed: Uint8Array | undefined;\nexport const fakeKeyring = { get seed() { return fakeSeed ??= ed25519.utils.randomSecretKey(); }, set seed(value: Uint8Array) { fakeSeed = value; } };\nexport const fakeKeySubject = (seed = fakeKeyring.seed) => hex(ed25519.getPublicKey(seed));\nexport const fakeKeySign = (statement: IdentityStatement, seed = fakeKeyring.seed) => ({ sig: toBase64Url(ed25519.sign(statement.bytes, seed)) });\n\nexport interface FakeKeyEvidence { sig: string }\nexport const fakeKey: IdentityProofProvider<FakeKeyEvidence> = {\n id: \"fake-key\", label: \"Test key\", category: \"self-custodied\",\n summary: \"Sign with the test key\", description: \"A test identity: an Ed25519 key held by this page. For tests only.\",\n platforms: [\"web\", \"desktop\"],\n subject: { label: \"Public key\", placeholder: \"64 hex characters\", normalize: normalizeHexKey, short: k => `${k.slice(0, 8)}…${k.slice(-4)}` },\n publicUri: k => `urn:ghostly-test:${k}`,\n validity: { defaultDays: 30, maxDays: 365 },\n privacy: \"Nothing: checked on this device.\",\n signers: [\n { id: \"fake-signer\", kind: \"in-app\", label: \"Test signer\", fields: [{ name: \"refuse\", label: \"Refuse\", kind: \"text\", optional: true }],\n run: async (ctx, work) => {\n ctx.signal.throwIfAborted();\n if (ctx.values.refuse) throw new Error(\"The test signer refused\");\n return work({ subject: async () => fakeKeySubject(), sign: async statement => fakeKeySign(statement) });\n } },\n { id: \"fake-tool\", kind: \"external-tool\", label: \"Sign outside Ghostly\",\n instructions: statement => ({ steps: [{ text: \"Sign this statement with your test key:\", copy: statement.text }], paste: { label: \"Signature (base64url)\" } }),\n parse: pasted => { const sig = pasted.trim(); if (!/^[A-Za-z0-9_-]{86}$/.test(sig)) throw new Error(\"That is not a test signature\"); return { sig }; } },\n ],\n parseEvidence(raw) {\n const e = raw as FakeKeyEvidence;\n if (!exactKeys(raw, \"sig\") || typeof e.sig !== \"string\" || !/^[A-Za-z0-9_-]{86}$/.test(e.sig)) throw new Error(\"Invalid test evidence\");\n return { sig: e.sig };\n },\n async verify(statement, evidence) {\n let ok: boolean;\n try { ok = ed25519.verify(fromBase64Url(evidence.sig), statement.bytes, unhex(statement.binding.subject)); } catch { ok = false; }\n if (!ok) throw new Error(\"Invalid test signature\");\n return { subject: statement.binding.subject, source: \"Test signature (Ed25519)\" };\n },\n};\n\n/** The fake issuer's key. Its public half is what fake-account trusts, like a provider's JWKS. */\nconst ISSUER_SEED = unhex(\"7a\".repeat(32));\nexport const FAKE_ISSUER = \"https://issuer.ghostly.test\";\nexport interface FakeAccountEvidence { token: string }\n/** What the fake login page signs: iss, sub, nonce (= statement id), iat. */\nexport function fakeAccountToken(statement: IdentityStatement, account = \"alice\", seed = ISSUER_SEED, iat = statement.binding.issuedAt): FakeAccountEvidence {\n const payload = toBase64Url(utf8Encode(JSON.stringify({ iss: FAKE_ISSUER, sub: account, nonce: statement.id, iat })));\n return { token: `${payload}.${toBase64Url(ed25519.sign(utf8Encode(payload), seed))}` };\n}\nexport const fakeAccount: IdentityProofProvider<FakeAccountEvidence> = {\n id: \"fake-account\", label: \"Test account\", category: \"provider-attested\",\n summary: \"Log in to the test issuer\", description: \"A test login provider that vouches for an account. For tests only.\",\n platforms: [\"web\", \"desktop\"],\n subject: { label: \"Provider\", options: [{ value: FAKE_ISSUER, label: \"Test issuer\" }],\n normalize: input => { if (input.trim() !== FAKE_ISSUER) throw new Error(\"Unknown test issuer\"); return FAKE_ISSUER; } },\n validity: { defaultDays: 30, maxDays: 90 },\n privacy: \"Nothing: the issuer's signature is checked on this device.\",\n signers: [{ id: \"fake-login\", kind: \"redirect\", label: \"Log in to the test issuer\",\n start: async (statement, ctx) => { ctx.signal.throwIfAborted(); return fakeAccountToken(statement, ctx.values.account || \"alice\"); } }],\n parseEvidence(raw) {\n const e = raw as FakeAccountEvidence;\n if (!exactKeys(raw, \"token\") || typeof e.token !== \"string\" || e.token.length > 2048 || !/^[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]{86}$/.test(e.token)) throw new Error(\"Invalid test token\");\n return { token: e.token };\n },\n async verify(statement, { token }) {\n const [payload, sig] = token.split(\".\");\n if (!ed25519.verify(fromBase64Url(sig), utf8Encode(payload), ed25519.getPublicKey(ISSUER_SEED))) throw new Error(\"Not signed by the test issuer\");\n const claims = JSON.parse(utf8Decode(fromBase64Url(payload))) as { iss: string; sub: string; nonce: string };\n if (claims.iss !== statement.binding.subject) throw new Error(\"Token from another issuer\");\n if (claims.nonce !== statement.id) throw new Error(\"Token for another statement\");\n if (typeof claims.sub !== \"string\" || !/^[a-z0-9]{1,64}$/.test(claims.sub)) throw new Error(\"Invalid account\");\n return { subject: `${claims.iss}#${claims.sub}`, attester: \"issuer.ghostly.test\", source: \"Token signed by the test issuer\",\n display: { name: claims.sub, source: \"Test issuer profile\", fetchedAt: statement.binding.issuedAt } };\n },\n};\n\n/** fake-record's records: subject → published text. The verifier reads `https://records.ghostly.test/<subject>`. */\nexport const FAKE_RECORD_HOST = \"https://records.ghostly.test/\";\nexport const fakeRecordText = (statement: IdentityStatement) => `ghostly-proof=${statement.id}`;\nexport const fakeRecord: IdentityProofProvider<Record<string, never>> = {\n id: \"fake-record\", label: \"Test record\", category: \"self-custodied\",\n summary: \"Publish a test record\", description: \"A test record published where the verifier looks it up, like DNS. For tests only.\",\n platforms: [\"web\", \"desktop\"],\n subject: { label: \"Name\", placeholder: \"alice\", normalize: input => { const v = input.trim().toLowerCase(); if (!/^[a-z0-9-]{1,63}$/.test(v)) throw new Error(\"Letters, digits and dashes\"); return v; } },\n validity: { defaultDays: 30, maxDays: 365 },\n recheck: { afterSeconds: 3600 },\n privacy: \"The verifier asks records.ghostly.test for the record: that server learns the name was checked.\",\n signers: [{ id: \"fake-publish\", kind: \"publish\", label: \"Publish a record\",\n instructions: statement => ({ steps: [{ text: `Publish this record for ${statement.binding.subject}:`, copy: fakeRecordText(statement) }] }),\n evidence: () => ({}) }],\n parseEvidence(raw) { if (!exactKeys(raw, \"\")) throw new Error(\"Invalid test evidence\"); return {}; },\n async verify(statement, _evidence, ctx) {\n const response = await ctx.fetch(`${FAKE_RECORD_HOST}${statement.binding.subject}`, { maxBytes: 4096, signal: ctx.signal });\n if (response.status !== 200 || !response.text.split(\"\\n\").includes(fakeRecordText(statement))) throw new Error(\"The record is not published\");\n return { subject: statement.binding.subject, source: \"Record published at records.ghostly.test\" };\n },\n};\n\nexport const FAKE_IDENTITY_PROVIDERS: readonly IdentityProofProvider[] = [fakeKey, fakeAccount, fakeRecord];\n"],"mappings":";;;;;;;;;;;;AAgBA,IAAa,kBAA2B;CAAE,IAAI;EAAE,OAAiC;CAAyC,QAAQ;EAAE,OAAO;CAAO;AAAE;;;ACGpJ,IAAa,sBAAsB;AAEnC,IAAMA,SAAO,UAAsB,MAAM,KAAK,QAAQ,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC,SAAS,GAAG,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE;AACpG,IAAM,UAAU,MAAc,OAAO,gBAAgB,IAAI,WAAW,CAAC,CAAC;AACtE,IAAM,QAAQ,OAAe,SAAS,MAAM;CAC1C,MAAM,MAAgB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S;CACT,SAAS,CAAC;EAAE,IAAI;EAAgB,MAAM;EAAW,OAAO;EACtD,eAAc,eAAc,EAAE,OAAO,CAAC;GAAE,MAAM,2BAA2B,UAAU,QAAQ,QAAQ;GAAI,MAAM,eAAe,SAAS;EAAE,CAAC,EAAE;EAC1I,iBAAiB,CAAC;CAAG,CAAC;CACxB,cAAc,KAAK;EAAE,IAAI,CAAC,UAAU,KAAK,EAAE,GAAG,MAAM,IAAI,MAAM,uBAAuB;EAAG,OAAO,CAAC;CAAG;CACnG,MAAM,OAAO,WAAW,WAAW,KAAK;EACtC,MAAM,WAAW,MAAM,IAAI,MAAM,GAAG,mBAAmB,UAAU,QAAQ,WAAW;GAAE,UAAU;GAAM,QAAQ,IAAI;EAAO,CAAC;EAC1H,IAAI,SAAS,WAAW,OAAO,CAAC,SAAS,KAAK,MAAM,IAAI,CAAC,CAAC,SAAS,eAAe,SAAS,CAAC,GAAG,MAAM,IAAI,MAAM,6BAA6B;EAC5I,OAAO;GAAE,SAAS,UAAU,QAAQ;GAAS,QAAQ;EAA2C;CAClG;AACF;AAEA,IAAa,0BAA4D;CAAC;CAAS;CAAa;AAAU"}
|
package/dist/fakes.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as fakeAddress, a as fakeAccount, b as fakeOnchain, c as fakeKeySign, d as fakeRecord, f as fakeRecordText, g as TEST_PROVIDERS_FLAG, h as FakeOnchainProvider, i as TEST_IDENTITIES_FLAG, l as fakeKeySubject, m as FakeLightningProvider, n as FAKE_ISSUER, o as fakeAccountToken, p as testIdentitiesEnabled, r as FAKE_RECORD_HOST, s as fakeKey, t as FAKE_IDENTITY_PROVIDERS, u as fakeKeyring, v as fakeInvoice, x as testProvidersEnabled, y as fakeLightning } from "./fakes-
|
|
1
|
+
import { _ as fakeAddress, a as fakeAccount, b as fakeOnchain, c as fakeKeySign, d as fakeRecord, f as fakeRecordText, g as TEST_PROVIDERS_FLAG, h as FakeOnchainProvider, i as TEST_IDENTITIES_FLAG, l as fakeKeySubject, m as FakeLightningProvider, n as FAKE_ISSUER, o as fakeAccountToken, p as testIdentitiesEnabled, r as FAKE_RECORD_HOST, s as fakeKey, t as FAKE_IDENTITY_PROVIDERS, u as fakeKeyring, v as fakeInvoice, x as testProvidersEnabled, y as fakeLightning } from "./fakes-CK9Ra4X4.js";
|
|
2
2
|
export { FAKE_IDENTITY_PROVIDERS, FAKE_ISSUER, FAKE_RECORD_HOST, FakeLightningProvider, FakeOnchainProvider, TEST_IDENTITIES_FLAG, TEST_PROVIDERS_FLAG, fakeAccount, fakeAccountToken, fakeAddress, fakeInvoice, fakeKey, fakeKeySign, fakeKeySubject, fakeKeyring, fakeLightning, fakeOnchain, fakeRecord, fakeRecordText, testIdentitiesEnabled, testProvidersEnabled };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as describeProvider, c as offeredIn, i as PROVIDER_PLATFORMS, l as providerDescriptorProblems, n as PROVIDER_ID, o as isNothingSpentError, r as PROVIDER_NETWORKS, s as networkMode, t as NothingSpentError, u as redact } from "./types-
|
|
3
|
-
import { i as verifyIdentity, n as boundedIdentityFetch, r as descriptorProblems, t as availableSigners } from "./verify-
|
|
1
|
+
import { Ed as identityStatement, Na as decodeBolt11, ca as isBitcoinAddress, cd as IDENTITY_MAX_EVIDENCE, dd as IDENTITY_MAX_VALIDITY, df as TRANSPORTS, kd as newIdentityBinding } from "./src-B9HeOlsG.js";
|
|
2
|
+
import { a as describeProvider, c as offeredIn, i as PROVIDER_PLATFORMS, l as providerDescriptorProblems, n as PROVIDER_ID, o as isNothingSpentError, r as PROVIDER_NETWORKS, s as networkMode, t as NothingSpentError, u as redact } from "./types-DYLIIkU8.js";
|
|
3
|
+
import { i as verifyIdentity, n as boundedIdentityFetch, r as descriptorProblems, t as availableSigners } from "./verify-DZpnNeF7.js";
|
|
4
4
|
//#region ../browser/src/proofs/contract.ts
|
|
5
5
|
var IDENTITY_PLATFORMS = [
|
|
6
6
|
"web",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CE as __commonJSMin, DE as __toCommonJS, EE as __require, TE as __exportAll, wE as __esmMin } from "./src-B9HeOlsG.js";
|
|
2
2
|
//#region ../../node_modules/compact-encoding/endian.js
|
|
3
3
|
var require_endian = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4
4
|
exports.BE = !(exports.LE = new Uint8Array(new Uint16Array([255]).buffer)[0] === 255);
|
|
@@ -76480,4 +76480,4 @@ var require_keet_identity_key = /* @__PURE__ */ __commonJSMin(((exports, module)
|
|
|
76480
76480
|
//#endregion
|
|
76481
76481
|
export default require_keet_identity_key();
|
|
76482
76482
|
|
|
76483
|
-
//# sourceMappingURL=keet-identity-key-
|
|
76483
|
+
//# sourceMappingURL=keet-identity-key-CDgu84Dj.js.map
|