diff --git a/.env.example b/.env.example index eea642b..9a12738 100644 --- a/.env.example +++ b/.env.example @@ -11,6 +11,9 @@ NEXT_PUBLIC_SUPABASE_URL= NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY= # Set true only after SMTP, allowed redirects, and email confirmation/recovery are verified. NEXT_PUBLIC_AUTH_EMAIL_READY=false +# Optional public support address shown on /privacy and /terms. When unset, both pages +# point to https://github.com/operatoruplift/buffer/issues instead. +# NEXT_PUBLIC_SUPPORT_EMAIL= # Optional path for the durable local SQLite mock worker. Defaults to .local/alerts.sqlite. # BUFFER_ALERT_STORE= # Optional server-only distributed read-limit secret. Requires the protected consume_rate_limit RPC. diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2f22217..39bfc61 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,13 +37,16 @@ jobs: - run: npm run lint - run: npm run typecheck - run: npm test - - name: Verify alert migrations and owner isolation + - name: Verify migrations, owner isolation, account deletion and rate limits run: | npm install --prefix "$RUNNER_TEMP/buffer-pglite" --no-package-lock --no-audit --no-fund @electric-sql/pglite@0.5.8 export BUFFER_PGLITE_MODULE="$RUNNER_TEMP/buffer-pglite/node_modules/@electric-sql/pglite/dist/index.js" node scripts/verify-alert-schema.mjs node scripts/verify-hosted-monitoring.mjs node scripts/verify-monitoring-scheduler.mjs + node scripts/verify-account-deletion.mjs + node scripts/verify-rate-limit.mjs + node scripts/verify-saved-report-quota.mjs - run: npm run build # Deterministic browser regressions block the release. External credentials diff --git a/android/README.md b/android/README.md index 049647e..18fa9c5 100644 --- a/android/README.md +++ b/android/README.md @@ -22,3 +22,18 @@ adb install -r app/build/outputs/apk/release/app-release.apk - This project is a WebView-based Android shell, not a Trusted Web Activity. - External links outside the configured host open in the system browser. - Solana wallet intents are handled natively by the app shell. + +## Links and downloads + +The shell keeps the app inside the WebView and hands everything else to the system with a +guard around every launch, so a phone without a wallet or mail app shows a short message instead +of closing the app: + +- `https` links off the app's host open in the system browser; `mailto:` opens the mail app; + `solana-wallet:` opens the wallet. `intent:` URLs lose their component, selector, extras and + URI grants and must be BROWSABLE before they are started. Every other scheme is blocked. +- Downloads are saved to the device's Downloads collection: `https` through the system + DownloadManager, `blob:` and `data:` (the JSON and CSV exports) through a two-method page + bridge named `WebShellDownloads` that only ever creates a new file. +- Mixed content is never allowed, third-party cookies and file or content access are off, popups + need a user gesture, and backup and device-transfer rules exclude everything. diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index 38bd452..83198ac 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -104,6 +104,11 @@ android { compose = true buildConfig = true } + // Buffer is English only. Without this filter the AndroidX libraries add + // 85 more translated locales, which the dApp Store reads as language claims. + androidResources { + localeFilters += listOf("en") + } } dependencies { diff --git a/android/app/proguard-rules.pro b/android/app/proguard-rules.pro index 481bb43..5304b57 100644 --- a/android/app/proguard-rules.pro +++ b/android/app/proguard-rules.pro @@ -18,4 +18,8 @@ # If you keep the line number information, uncomment this to # hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file +#-renamesourcefileattribute SourceFile +# The page calls the download bridge by method name. +-keepclassmembers class com.operatoruplift.buffer.WebShellDownloads { + @android.webkit.JavascriptInterface ; +} diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 9769528..8ac517d 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -6,7 +6,7 @@ + downloads.onDownloadStart(this, url, userAgent, contentDisposition, mimeType) + } + loadUrl(startUrl) } } diff --git a/android/app/src/main/java/com/operatoruplift/buffer/WebShellChromeClient.kt b/android/app/src/main/java/com/operatoruplift/buffer/WebShellChromeClient.kt index 1cfa323..6c800c7 100644 --- a/android/app/src/main/java/com/operatoruplift/buffer/WebShellChromeClient.kt +++ b/android/app/src/main/java/com/operatoruplift/buffer/WebShellChromeClient.kt @@ -1,6 +1,5 @@ package com.operatoruplift.buffer -import android.content.Intent import android.os.Message import android.util.Log import android.webkit.ConsoleMessage @@ -12,6 +11,7 @@ import android.webkit.WebViewClient class WebShellChromeClient( private val onProgressChanged: (Int) -> Unit, private val isDebug: Boolean, + private val opener: LinkOpener, ) : WebChromeClient() { override fun onProgressChanged( view: WebView, @@ -45,9 +45,9 @@ class WebShellChromeClient( isUserGesture: Boolean, resultMsg: Message, ): Boolean { - // Handle window.open() and target="_blank" links (used by OAuth - // flows like Privy, social logins, etc.). Open the URL in the - // system browser so the user can complete the flow there. + // window.open() and target="_blank" open in the system browser, and only when the + // user asked for it: a page script cannot pop windows on its own. + if (!isUserGesture) return false val newWebView = WebView(view.context) newWebView.webViewClient = object : WebViewClient() { @@ -55,7 +55,14 @@ class WebShellChromeClient( view: WebView, request: WebResourceRequest, ): Boolean { - view.context.startActivity(Intent(Intent.ACTION_VIEW, request.url)) + val url = request.url + when (url.scheme?.lowercase()) { + "https" -> opener.openInBrowser(url) + "http" -> opener.openInBrowser(url.buildUpon().scheme("https").build()) + "mailto" -> opener.openEmail(url) + "solana-wallet" -> opener.openWallet(url) + "intent" -> opener.openIntentUrl(url.toString()) + } return true } } diff --git a/android/app/src/main/java/com/operatoruplift/buffer/WebShellDownloads.kt b/android/app/src/main/java/com/operatoruplift/buffer/WebShellDownloads.kt new file mode 100644 index 0000000..cc7ac6d --- /dev/null +++ b/android/app/src/main/java/com/operatoruplift/buffer/WebShellDownloads.kt @@ -0,0 +1,199 @@ +package com.operatoruplift.buffer + +import android.app.DownloadManager +import android.content.ContentValues +import android.content.Context +import android.net.Uri +import android.os.Build +import android.os.Environment +import android.provider.MediaStore +import android.util.Base64 +import android.util.Log +import android.webkit.CookieManager +import android.webkit.JavascriptInterface +import android.webkit.URLUtil +import android.webkit.WebView +import org.json.JSONObject + +/** + * Saves the files the web app offers for download. A WebView drops downloads unless the app + * handles them: https URLs go to the system DownloadManager, data: URLs are decoded here, and + * blob: URLs (what the JSON and CSV exports use) are read by a small script inside the page + * and handed back through [saveBase64]. That method and [reportFailure] are the whole bridge; + * they only ever create a new file in the device's Downloads collection. + */ +class WebShellDownloads( + private val context: Context, + private val opener: LinkOpener, +) { + fun onDownloadStart( + webView: WebView, + url: String, + userAgent: String?, + contentDisposition: String?, + mimeType: String?, + ) { + val name = safeFileName(URLUtil.guessFileName(url, contentDisposition, mimeType)) + when { + url.startsWith("blob:", ignoreCase = true) -> { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) { + opener.toast(R.string.webshell_download_needs_android_10) + return + } + webView.evaluateJavascript(blobReaderScript(url, name), null) + } + + url.startsWith("data:", ignoreCase = true) -> { + val comma = url.indexOf(',') + if (comma < 5) { + opener.toast(R.string.webshell_download_failed) + return + } + val header = url.substring(5, comma) + val payload = url.substring(comma + 1) + val mime = header.substringBefore(';').ifBlank { mimeType ?: "application/octet-stream" } + val bytes = if (header.contains(";base64")) decode(payload) else Uri.decode(payload).toByteArray() + if (bytes == null) { + opener.toast(R.string.webshell_download_failed) + return + } + write(name, mime, bytes) + } + + url.startsWith("https://", ignoreCase = true) -> enqueue(url, userAgent, mimeType, name) + + else -> opener.toast(R.string.webshell_download_failed) + } + } + + /** Called from the page with a blob's contents. Writes one new file under Downloads. */ + @JavascriptInterface + fun saveBase64( + name: String?, + mimeType: String?, + base64: String?, + ): Boolean { + val bytes = decode(base64 ?: return false) ?: return false + val mime = mimeType?.takeIf { it.isNotBlank() } ?: "application/octet-stream" + return write(safeFileName(name ?: "download"), mime, bytes) + } + + @JavascriptInterface + fun reportFailure(reason: String?) { + Log.w(TAG, "Blob download failed: ${reason?.take(200)}") + opener.toast(R.string.webshell_download_failed) + } + + private fun enqueue( + url: String, + userAgent: String?, + mimeType: String?, + name: String, + ) { + val manager = context.getSystemService(Context.DOWNLOAD_SERVICE) as? DownloadManager + if (manager == null) { + opener.toast(R.string.webshell_download_failed) + return + } + val request = + DownloadManager.Request(Uri.parse(url)).apply { + setTitle(name) + if (!mimeType.isNullOrBlank()) setMimeType(mimeType) + setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED) + CookieManager.getInstance().getCookie(url)?.let { addRequestHeader("Cookie", it) } + userAgent?.let { addRequestHeader("User-Agent", it) } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { + setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, name) + } else { + setDestinationInExternalFilesDir(context, Environment.DIRECTORY_DOWNLOADS, name) + } + } + runCatching { manager.enqueue(request) } + .onSuccess { opener.toast(R.string.webshell_download_started) } + .onFailure { + Log.w(TAG, "DownloadManager refused $name: ${it.message}") + opener.toast(R.string.webshell_download_failed) + } + } + + private fun write( + name: String, + mimeType: String, + bytes: ByteArray, + ): Boolean { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) { + opener.toast(R.string.webshell_download_needs_android_10) + return false + } + if (bytes.size > MAX_BYTES) { + opener.toast(R.string.webshell_download_failed) + return false + } + val resolver = context.contentResolver + val values = + ContentValues().apply { + put(MediaStore.Downloads.DISPLAY_NAME, name) + put(MediaStore.Downloads.MIME_TYPE, mimeType) + put(MediaStore.Downloads.IS_PENDING, 1) + } + val uri = runCatching { resolver.insert(MediaStore.Downloads.EXTERNAL_CONTENT_URI, values) }.getOrNull() + if (uri == null) { + opener.toast(R.string.webshell_download_failed) + return false + } + val ok = + runCatching { + resolver.openOutputStream(uri)?.use { it.write(bytes) } ?: error("no output stream") + values.clear() + values.put(MediaStore.Downloads.IS_PENDING, 0) + resolver.update(uri, values, null, null) + }.isSuccess + if (!ok) runCatching { resolver.delete(uri, null, null) } + opener.toast(if (ok) R.string.webshell_download_saved else R.string.webshell_download_failed) + return ok + } + + private fun decode(base64: String): ByteArray? = runCatching { Base64.decode(base64, Base64.DEFAULT) }.getOrNull() + + private fun blobReaderScript( + url: String, + name: String, + ): String { + val quotedUrl = JSONObject.quote(url) + val quotedName = JSONObject.quote(name) + return """ + (function () { + fetch($quotedUrl).then(function (response) { return response.blob(); }).then(function (blob) { + return new Promise(function (resolve, reject) { + var reader = new FileReader(); + reader.onload = function () { resolve(reader.result); }; + reader.onerror = function () { reject(reader.error); }; + reader.readAsDataURL(blob); + }); + }).then(function (dataUrl) { + var comma = dataUrl.indexOf(','); + var mime = dataUrl.slice(5, comma).split(';')[0]; + $BRIDGE.saveBase64($quotedName, mime, dataUrl.slice(comma + 1)); + }).catch(function (error) { $BRIDGE.reportFailure(String(error)); }); + })(); + """.trimIndent() + } + + companion object { + /** The name the page sees; keep in step with [blobReaderScript]. */ + const val BRIDGE = "WebShellDownloads" + private const val TAG = "WebShell" + private const val MAX_BYTES = 64 * 1024 * 1024 + + fun safeFileName(raw: String): String { + val cleaned = + raw + .substringAfterLast('/') + .substringAfterLast('\\') + .replace(Regex("[\\u0000-\\u001f\"*:<>?|]"), "_") + .trim() + .trimStart('.') + return (if (cleaned.isBlank()) "download" else cleaned).take(120) + } + } +} diff --git a/android/app/src/main/java/com/operatoruplift/buffer/WebShellViewClient.kt b/android/app/src/main/java/com/operatoruplift/buffer/WebShellViewClient.kt index 7451403..02d9532 100644 --- a/android/app/src/main/java/com/operatoruplift/buffer/WebShellViewClient.kt +++ b/android/app/src/main/java/com/operatoruplift/buffer/WebShellViewClient.kt @@ -1,76 +1,61 @@ package com.operatoruplift.buffer import android.content.Context -import android.content.Intent import android.webkit.WebResourceRequest import android.webkit.WebView import android.webkit.WebViewClient -import androidx.core.net.toUri open class WebShellViewClient( - private val context: Context, + context: Context, private val scopeHostProvider: () -> String, + private val opener: LinkOpener = LinkOpener(context), ) : WebViewClient() { override fun shouldOverrideUrlLoading( view: WebView, request: WebResourceRequest, ): Boolean { val url = request.url - val scheme = url.scheme ?: return false + val scheme = url.scheme?.lowercase() ?: return false - // Never intercept subframe (iframe) navigation — this breaks - // embedded SDKs like Privy that use cross-origin iframes. + // Subframe navigation stays inside the WebView; which origins may be framed is the + // site's content security policy's job. if (!request.isForMainFrame) return false return when (scheme) { - "solana-wallet" -> { - context.startActivity(Intent(Intent.ACTION_VIEW, url)) - // The wallet protocol library uses window.blur to detect that the - // wallet app opened. In a WebView the blur event never fires - // naturally, so we dispatch a synthetic one to unblock the - // detection promise (3-second timeout in startSession.ts). - view.evaluateJavascript("window.dispatchEvent(new Event('blur'))", null) - true - } - - "intent" -> { - handleIntentScheme(url.toString()) - true - } - - "blob", "javascript" -> { - false - } - "http", "https" -> { - if (url.host == scopeHostProvider.invoke()) { + if (url.host.equals(scopeHostProvider.invoke(), ignoreCase = true)) { false } else { - context.startActivity(Intent(Intent.ACTION_VIEW, url)) + // Off-site links open in the system browser, always over https. + opener.openInBrowser(if (scheme == "http") url.buildUpon().scheme("https").build() else url) true } } - else -> { - context.startActivity(Intent(Intent.ACTION_VIEW, url)) + "solana-wallet" -> { + if (opener.openWallet(url)) { + // The wallet protocol library uses window.blur to detect that the wallet + // app opened. A WebView never fires it, so dispatch one to unblock the + // detection promise (3-second timeout in startSession.ts). + view.evaluateJavascript("window.dispatchEvent(new Event('blur'))", null) + } + true + } + + "mailto" -> { + opener.openEmail(url) true } - } - } - private fun handleIntentScheme(url: String) { - try { - val intent = Intent.parseUri(url, Intent.URI_INTENT_SCHEME) - if (intent.resolveActivity(context.packageManager) != null) { - context.startActivity(intent) - } else { - val fallback = intent.getStringExtra("browser_fallback_url") - if (fallback != null) { - context.startActivity(Intent(Intent.ACTION_VIEW, fallback.toUri())) - } + "intent" -> { + opener.openIntentUrl(url.toString()) + true } - } catch (_: Exception) { - // No handler available — silently ignore + + "blob", "data", "about" -> false + + // javascript:, file:, content:, tel:, sms: and anything else never leave the shell. + else -> true } } } diff --git a/android/app/src/main/res/values-en/strings.xml b/android/app/src/main/res/values-en/strings.xml new file mode 100644 index 0000000..8a06078 --- /dev/null +++ b/android/app/src/main/res/values-en/strings.xml @@ -0,0 +1,13 @@ + + + + Buffer + No browser is available to open this link. + No Solana wallet app is installed. Install one, then try again. + No email app is installed. The address is shown on the page. + Downloading to your Downloads folder. + Saved to your Downloads folder. + The file could not be saved. + Saving files needs Android 10 or newer. + diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml index 06db390..f6f9a27 100644 --- a/android/app/src/main/res/values/strings.xml +++ b/android/app/src/main/res/values/strings.xml @@ -1,3 +1,10 @@ Buffer + No browser is available to open this link. + No Solana wallet app is installed. Install one, then try again. + No email app is installed. The address is shown on the page. + Downloading to your Downloads folder. + Saved to your Downloads folder. + The file could not be saved. + Saving files needs Android 10 or newer. diff --git a/android/app/src/main/res/xml/backup_rules.xml b/android/app/src/main/res/xml/backup_rules.xml index 4df9255..eef4675 100644 --- a/android/app/src/main/res/xml/backup_rules.xml +++ b/android/app/src/main/res/xml/backup_rules.xml @@ -1,13 +1,11 @@ - + + - - \ No newline at end of file + + + + + + diff --git a/android/app/src/main/res/xml/data_extraction_rules.xml b/android/app/src/main/res/xml/data_extraction_rules.xml index 9ee9997..e0537e6 100644 --- a/android/app/src/main/res/xml/data_extraction_rules.xml +++ b/android/app/src/main/res/xml/data_extraction_rules.xml @@ -1,19 +1,21 @@ - + + - + + + + + - - \ No newline at end of file + diff --git a/docs/ALERTS.md b/docs/ALERTS.md index 9e7a4ed..265a45f 100644 --- a/docs/ALERTS.md +++ b/docs/ALERTS.md @@ -14,12 +14,13 @@ A live account shows **Live monitoring**. Guests can use the account explorer, r ## Hosted runtime -The additive migration `20260920020000_hosted_monitoring.sql` extends the existing alert tables and adds a private worker credential and run journal. Database state, event episodes, versions, attempts, leases and receipts survive process restarts. Existing saved reports and browser/SQLite rehearsal stores retain their semantics. +The additive migration `20260919183521_hosted_monitoring.sql` extends the existing alert tables and adds a private worker credential and run journal. Database state, event episodes, versions, attempts, leases and receipts survive process restarts. Existing saved reports and browser/SQLite rehearsal stores retain their semantics. - Authenticated owners use narrowly scoped status/mutation functions. Cross-owner reads, writes and destination assignment are denied. Server-owned destination metadata and event/outbox transitions are not browser-writable. - The worker uses a dedicated server-only secret. Only its SHA-256 hash is stored in `private.buffer_monitor_credentials`; this credential cannot act as a service-role key. The public SDK key alone cannot operate the worker. - A separate `CRON_SECRET` protects `/api/monitoring/worker`. The database admits a scheduled minute key once across concurrent invocations. Manual checks do not establish a scheduler heartbeat. - Fenced database claims coordinate due checks and dispatch. Each invocation atomically selects one kind of work: a fresh queued delivery first, a receipt lookup next, or a due account observation. A slow provider read cannot consume the dispatch turn. Observations use the shared exact-decimal alert engine and persist the resulting episode/event before delivery. +- Due checks are claimed fairly (since `20261017103000_worker_fairness.sql`): the owner whose rules were attempted least recently is served first, then the longest-due rule by `coalesce(next_check, created_at)`, and at most one rule per owner is claimed per minute. Editing a rule resets its `next_check`, which used to put it first in a queue drained one rule a minute; it no longer starves another owner's rule. Manual checks (`POST /api/monitoring/rules/{id}/check`) hold a lease of their own, scoped to the owner, so they never occupy the single 45-second lease the scheduled tick needs, and the tick never blocks them; both respect each rule's lease. - Cadence, cooldown and hysteresis survive unavailable observations and restarts. Pausing, deleting or changing a rule version invalidates pending work. History is retained; a remotely accepted message cannot be recalled. - The scheduler is bounded server work, not a browser timer. A heartbeat expires after 180 seconds, including on a page left open. UI separates attempted check, last fresh observation, next check, provider acceptance and matching receipt. @@ -55,7 +56,22 @@ SQLite `.local/alerts.sqlite` uses WAL, full synchronization and transactional r 4. Configure a reviewed Discord or signed-webhook destination for the intended confirmed Supabase owner. Verify the destination according to its provider contract; prepare the exact redacted message and destination. Obtain recipient-send authorization before turning on sends. Existing signup/recovery email stays disabled independently. 5. Save an authorized test threshold around a real current observation. Confirm event ID, rule version, source slot/time, and the destination-specific delivery receipt. Retain redacted evidence, then pause/delete the test rule. Do not call this step verified until a real receipt exists. -To pause: disable the scheduler job and set sending false. To rotate: first disable sends, rotate the webhook/token and configuration fingerprint, reverify the channel, invalidate old pending work, redeploy, then reenable only after authorization. Never reuse unknown-outcome events as fresh sends. Inspect unavailable reasons, heartbeat age and outbox state; do not erase a damaged journal to make the UI green. Rollback leaves the additive schema/RLS in place, disables the job and sending, and promotes the previous known-good application. +### Worker secret + +`BUFFER_ALERT_WORKER_SECRET` is the only gate on `public.buffer_monitor_worker`, which the server calls with the publishable key. It must be at least 32 random characters (the function refuses anything shorter than 32 or longer than 256); generate it with `node -e "console.log(require('crypto').randomBytes(36).toString('base64url'))"` or `openssl rand -base64 48 | tr -d '=+/'`, never by hand. Only its SHA-256 hash is stored, in `private.buffer_monitor_credentials`. + +Since `20261019090000_worker_secret_lockout.sql` the function counts failed authentication attempts per calendar minute. Each failure writes a `WARNING` to the PostgreSQL log (`buffer_monitor_worker: authentication failed (N this minute)`, never the attempted value), and after 10 failures in one minute every call, including a correct one, is refused with `Worker authentication paused` until that minute ends. The current minute's count is `select last_value % 1000 as failures from private.buffer_monitor_auth_failures;`. A deployment carrying a wrong secret therefore shows up as a warning every minute and a stalled heartbeat, not as silent misses; an attacker holding the publishable key can pause the worker for the rest of a minute by failing ten times, which was accepted over unbounded guessing. + +To rotate the worker secret: + +1. Generate the new value as above. +2. In Vercel, set `BUFFER_ALERT_WORKER_SECRET` to the new value for Production without promoting yet. +3. Through the administrator connection run `update private.buffer_monitor_credentials set secret_hash = encode(sha256(convert_to('', 'UTF8')), 'hex') where id;` (one row; the old value stops working at once). +4. Redeploy or promote immediately. Until the new deployment serves, each scheduled minute fails authentication once and logs a warning; ten failures in one minute would pause the worker for that minute, so do not leave the gap open. +5. Confirm a fresh completed `cron:` run in `private.buffer_monitor_runs` and a healthy heartbeat in the app. +6. The worker secret also keys every destination fingerprint (HMAC-SHA-256), so each configured Discord or webhook destination now carries a new fingerprint: the next status read re-verifies it and the database pauses the rules bound to it. Re-enable those rules once the destination shows as verified again. + +To pause: disable the scheduler job and set sending false. To rotate a destination: first disable sends, rotate the webhook/token and configuration fingerprint, reverify the channel, invalidate old pending work, redeploy, then reenable only after authorization. Never reuse unknown-outcome events as fresh sends. Inspect unavailable reasons, heartbeat age and outbox state; do not erase a damaged journal to make the UI green. Rollback leaves the additive schema/RLS in place, disables the job and sending, and promotes the previous known-good application. ## Verification @@ -64,4 +80,4 @@ Unit suites cover exact threshold semantics, provider contracts, response bounds On October 1, 2026 at 06:23 UTC, the production database showed 30 successful scheduled cron runs and 30 completed protected worker runs in the preceding 30 minutes. The worker remained in `dry_run` mode. This verifies execution of the scheduler, not outbound delivery. -The narrow worker processes at most one work item per minute; configured cadence is a minimum interval, not a guaranteed maximum notification delay under backlog. Limits are 20 rules per owner, 100 events per owner per day, 10 send attempts per owner per hour, 3 send attempts and 5 receipt lookups per event. Stale queued events are suppressed after 120seconds rather than dispatched after an outage. Completed/suppressed unreferenced history is pruned after 30 days in bounded batches; unresolved outcomes remain available for investigation. Fresh deliveries take precedence over receipt retries so a slow receipt cannot expire another event's send window. +The narrow worker processes at most one work item per minute; configured cadence is a minimum interval, not a guaranteed maximum notification delay under backlog. Limits are 20 rules per owner, one claimed check per owner per minute, 30 manual checks per owner per minute and 60 per owner per hour (`CHECK_NOT_DUE`), 100 events per owner per day, 10 send attempts per owner per hour, 3 send attempts and 5 receipt lookups per event. Stale queued events are suppressed after 120seconds rather than dispatched after an outage. Completed/suppressed unreferenced history is pruned after 30 days in bounded batches; unresolved outcomes remain available for investigation. Fresh deliveries take precedence over receipt retries so a slow receipt cannot expire another event's send window. diff --git a/docs/DATABASE-VERIFICATION.md b/docs/DATABASE-VERIFICATION.md index 12a6c85..5060305 100644 --- a/docs/DATABASE-VERIFICATION.md +++ b/docs/DATABASE-VERIFICATION.md @@ -213,7 +213,7 @@ This migration created an empty table and required no data backfill. Keep deploy ## September 20 hosted monitoring extension -Applied `hosted_monitoring` as hosted migration `20260919183521`; local source is `20260920020000_hosted_monitoring.sql`. Before application, alert rules, destinations and events were empty. The additive extension preserves saved-report tables and enables real owner-authenticated rule configuration, immutable event provenance, versioned episodes, fenced worker transitions and receipt states. Local PostgreSQL verification passed 48 assertions; prior schema verifier covers 55 additional assertions. Private credential/run tables are denied to browser roles; all five public report/alert tables retain RLS. +Applied `hosted_monitoring` as hosted migration `20260919183521`; the local source now carries that version as `20260919183521_hosted_monitoring.sql` (it was `20260920020000_hosted_monitoring.sql` until the 17 October 2026 alignment below). Before application, alert rules, destinations and events were empty. The additive extension preserves saved-report tables and enables real owner-authenticated rule configuration, immutable event provenance, versioned episodes, fenced worker transitions and receipt states. Local PostgreSQL verification passed 48 assertions; prior schema verifier covers 55 additional assertions. Private credential/run tables are denied to browser roles; all five public report/alert tables retain RLS. The security advisor reports intentionally exposed SECURITY DEFINER entry points: the worker/rate-limit RPCs require separate server secrets, and monitoring status/mutation RPCs require `auth.uid()` and enforce owner scope. Anonymous status access and browser access to helper functions are denied. These expected findings are not evidence that browser callers can bypass the explicit checks. @@ -221,3 +221,26 @@ The initial scheduler preparation applied as `20260919183534`, but hosted postfl The synchronous trigger migration applied as `20260919185033` (`use_synchronous_monitoring_trigger`). Hosted checks confirm http 1.6, HEAD-only helper with no net calls, non-debug logging, private-helper execution denied to anon/authenticated/service_role, and Vault reads denied to browser roles. The managed base HTTP function retains browser EXECUTE grants; those do not grant access to the private helper or its Vault credential and no persistent request queue is used. Scheduler activation/actual completed runs are recorded in the release evidence. + +## Rate-limit retention and keyed hash (not yet applied) + +`20261008120000_rate_limit_retention_and_keyed_hash.sql` fixes two read-only findings on the hosted limiter: `private.prune_rate_limits()` existed but nothing called it, so counters from 17 September onward were never deleted, and each counter key was the server's unkeyed SHA-256 of the client IP, which brute force reverses for IPv4. `public.consume_rate_limit` keeps its signature, result and secret, but stores HMAC-SHA-256 of the sent key under a random 32-byte key in `private.rate_limit_hash_key` (row-level security on, no grants to anon, authenticated or service_role), refuses windows longer than one minute, deletes expired counters on every check, and `buffer-prune-rate-limits` (pg_cron, every three minutes) removes idle ones, so no counter outlives the last request by more than four minutes. The migration deletes every counter stored under the old hash, records the limiter's tables for fresh projects, and leaves only anon (the server's publishable key, gated by the secret) able to execute the limiter. It can be applied before or after the app deploys. `scripts/verify-rate-limit.mjs` checks it locally against the hosted pre-migration definitions and against an empty project, applying it as a non-superuser owner as hosted Supabase does. + +## 17 October 2026: migration files aligned with the hosted ledger + +Six checked-in migrations carried local timestamps while the hosted project's migration history recorded the versions at which they were actually applied. Tooling that compares the two (`supabase migration list`, `supabase db push`) therefore saw six "local only" and six "remote only" entries for the same bodies. The files were renamed with `git mv` to the ledger's versions, without changing a byte of their contents: + +| Ledger version (file now) | Previous local name | +| --- | --- | +| `20260915180735_create_alert_pipeline.sql` | `20260915120000_create_alert_pipeline.sql` | +| `20260919172720_harden_alert_pipeline.sql` | `20260919090000_harden_alert_pipeline.sql` | +| `20260919173121_harden_function_permissions.sql` | `20260920010000_harden_function_permissions.sql` | +| `20260919183521_hosted_monitoring.sql` | `20260920020000_hosted_monitoring.sql` | +| `20260928154216_liquidation_sentinels.sql` | `20260928120000_liquidation_sentinels.sql` | +| `20261008081817_delete_own_account.sql` | `20261007120000_delete_own_account.sql` | + +Three migrations existed only in production, applied from the dashboard while the scheduler was being set up. Their bodies, exactly as the ledger recorded them, are now checked in under their ledger versions: `20260919183534_prepare_monitoring_scheduler.sql` (the pg_net preparation that was never activated), `20260919185033_use_synchronous_monitoring_trigger.sql` (the http 1.6 HEAD helper that replaced it) and `20260930095233_acknowledge_webhook_delivery_in_scheduler.sql` (the helper accepting a `delivered` worker result). They need `pg_cron`, Supabase Vault and the `http` extension, which the local PGlite verifier cannot load, so `scripts/verify-account-deletion.mjs`, the one script that applies every migration in order, skips exactly those three by name and says why; `scripts/verify-monitoring-scheduler.mjs` continues to exercise the helper body against a synthetic transport. Nothing was applied, changed or re-run on the hosted project for this alignment. `20261008120000_rate_limit_retention_and_keyed_hash.sql` and the 17 October migrations remain unapplied and sort after every applied version. + +## Saved-report quota (19 October 2026, not yet applied) + +`20261019091500_saved_report_quota.sql` adds a `BEFORE INSERT` trigger on `public.saved_reports` that caps each account at 50 reports and 8 MiB of report JSON, counted under a per-account advisory lock so concurrent inserts cannot pass the count together. The Auth API accepts sign-ups even while the form is gated, so the bound has to live in the database rather than the app. A refusal raises SQLSTATE `54000` with the hint `Delete a saved report to make room.`; the app matches the code (`isSavedReportQuotaError`) and shows that the library is full without marking the write uncertain. Existing rows are untouched; an account already over a limit keeps its reports and can delete to make room. `scripts/verify-saved-report-quota.mjs` proves the 51st report and the byte past 8 MiB are refused as the real `authenticated` role, that other accounts are unaffected, that deletion makes room, and that browser roles cannot execute the trigger function. diff --git a/docs/DEPLOYMENT.md b/docs/DEPLOYMENT.md index 3c0df97..9c96ad9 100644 --- a/docs/DEPLOYMENT.md +++ b/docs/DEPLOYMENT.md @@ -13,7 +13,7 @@ Buffer runs on Node 24 with Next.js App Router. `/` is the public website, `/app | `NEXT_PUBLIC_SUPABASE_URL` | Public | Dedicated Buffer project's API URL. | | `NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY` | Public | Supabase publishable key; never a service-role or secret key. | | `NEXT_PUBLIC_AUTH_EMAIL_READY` | Public | Set `true` only after email signup, confirmation, recovery, redirects, and password policy are verified. It is currently `false`, so public signup and recovery remain visibly unavailable. | -| `RATE_LIMIT_SECRET` | Server only | Optional secret for the protected Supabase `consume_rate_limit` RPC; absent/unreachable shared storage falls back to process limits. Never expose this value to the browser. | +| `RATE_LIMIT_SECRET` | Server only | Optional secret for the protected Supabase `consume_rate_limit` RPC; absent/unreachable shared storage falls back to process limits. It must equal `private.rate_limit_config.secret`; on a fresh project, `20261008120000_rate_limit_retention_and_keyed_hash.sql` generates that value. Never expose this value to the browser. | | `BUFFER_TEST_AUTHORITY` | Local verification only | Optional public authority for manual checks; the application does not load it automatically. | | `BUFFER_ALERT_STORE` | Local worker only | Optional path for the durable local SQLite worker; defaults to `.local/alerts.sqlite` and is ignored by Git. | @@ -67,14 +67,14 @@ The current monitoring implementation adds authenticated `/api/monitoring` confi | Variable | Scope | Purpose | | --- | --- | --- | -| `BUFFER_ALERT_WORKER_SECRET` | Server only | Random 32+ character secret; only its SHA-256 hash is stored in the private worker credential row. | +| `BUFFER_ALERT_WORKER_SECRET` | Server only | Random 32+ character secret; only its SHA-256 hash is stored in the private worker credential row. It also keys the destination fingerprints, so rotating it re-verifies every destination (see [ALERTS.md](ALERTS.md)). | | `CRON_SECRET` | Server only | A different 32+ character secret authenticating the scheduled endpoint; also stored in Supabase Vault for the scheduler. | | `BUFFER_ALERT_SEND_ENABLED` | Server only | Defaults to false. Keep false until an exact destination and test message are authorized. | | `BUFFER_ALERT_NOTIFICATION_MODE` | Server only | Defaults to `test`; labels genuine live observations as test notifications. `production` is a deliberate separate choice. | | `BUFFER_DISCORD_DESTINATIONS_JSON` | Server only | One reviewed Discord configuration with webhook credentials, channel ID, stable config UUID and explicit allowed owner UUIDs. See the exact schema in the provider runbook. | | `BUFFER_WEBHOOK_DESTINATIONS_JSON` | Server only | Reviewed HTTPS receivers, HMAC secrets, stable destination UUIDs and explicit allowed owner UUIDs. See [the signed-webhook contract](WEBHOOK-ALERTS.md). | -Apply `20260920020000_hosted_monitoring.sql` only after its PostgreSQL verification passes. Initialize `private.buffer_monitor_credentials` with a SHA-256 hash through the administrator connection. Never commit the plaintext secret or put it in a URL. Deploy the new server variables before scheduling. Worker routes declare 60-second duration; their coordinator bounds due-provider work and dispatch. Browser requests time out after 45 seconds. +Apply `20260919183521_hosted_monitoring.sql` only after its PostgreSQL verification passes. Initialize `private.buffer_monitor_credentials` with a SHA-256 hash through the administrator connection. Never commit the plaintext secret or put it in a URL. Deploy the new server variables before scheduling. Worker routes declare 60-second duration; their coordinator bounds due-provider work and dispatch. Browser requests time out after 45 seconds. Supabase Pro hosts the minute scheduler. The reviewed `supabase/setup/monitoring-scheduler.sql` installs `pg_cron` and pinned `http` 1.6, creates a private fixed-origin helper with an empty search path, and denies browser/service-role execution. Vault reads are denied to browser roles. Setup attempts to revoke base HTTP execution, but hosted managed grants may remain; postflight records the actual ACL. The private helper and Vault, rather than the general HTTP primitive, protect the scheduler credential. It **does not activate a job**. Store `buffer_monitor_cron_secret` securely in Vault with the same value as Vercel's `CRON_SECRET`; inspect existing `cron.job` entries before scheduling `buffer-monitor-minute` once per minute. diff --git a/docs/DESCRIPTION.md b/docs/DESCRIPTION.md index d386918..959c021 100644 --- a/docs/DESCRIPTION.md +++ b/docs/DESCRIPTION.md @@ -24,7 +24,7 @@ The result comes with its explanation: what was included, what was excluded, whi - **Current risk and optional monitoring.** Open a public Velocity account directly and inspect current maintenance headroom beside the independent price scenario. Owner-authenticated cloud rules use fresh provider observations, durable event/outbox state and protected scheduled work. One Discord adapter separates acceptance from a matching channel receipt; destination setup and authorized live delivery remain explicit gates. Local examples use a separate rehearsal with no outbound path. - **Portable reports.** Download a JSON report containing the snapshot, exact scenario values, coverage, assumptions, and the identity the snapshot came from: the fixed protocol or API identity for a live read, and the reference perpetual catalog for an editable preset portfolio. - **Useful without an account.** Explore deterministic samples, read public accounts, and save historical reports on this device without signing in or connecting a wallet. Optional cloud accounts keep a separate private library. -- **A workspace that travels.** Use the responsive web app on mobile, tablet, and desktop, with installation through supported PWA browsers. +- **A workspace that travels.** Use the responsive web app on mobile, tablet, and desktop, install it through supported PWA browsers, or install the Android app built from `android/` for Seeker and the Solana dApp Store. ### Simple math, carefully scoped @@ -40,7 +40,7 @@ Sample values are fixtures, not live market observations. The calculation is a p ### Read-only by design -Buffer does not require a seed phrase, private key, wallet connection, or trading approval. Live lookups read Pacifica's public API or use a configured server-side Solana RPC for Velocity and Jupiter inventory. Velocity uses its pinned official SDK; Jupiter uses a separate canonical account decoder. Pacifica requires no API key. Optional sign-in and scenario storage do not grant authority over a wallet. +Buffer does not require a seed phrase, private key, wallet connection, or trading approval. The optional **Use my wallet** button is a read-only wallet connection: it asks the wallet for its public address and never requests a signature. Live lookups read Pacifica's public API or use a configured server-side Solana RPC for Velocity and Jupiter inventory. Velocity uses its pinned official SDK; Jupiter uses a separate canonical account decoder. Pacifica requires no API key. Optional sign-in and scenario storage do not grant authority over a wallet. Live availability depends on the deployment's provider configuration and RPC service. Modeled live calculations expire after at most two minutes, or earlier when their source price expires, and require a refresh. Live balances and oracle prices can change between reads. Jupiter has no current-price scenario until its oracle and collateral-dependent capped payoff are verified together. Legacy Drift is labeled paused and its balances are not treated as migrated Velocity state. Internet access is needed for live reads and account synchronization. @@ -54,4 +54,4 @@ Buffer pairs a responsive video-led website with a precise decimal calculation e --- -Buffer provides scenario exploration, not trading recommendations; its liquidation estimate is a narrow, versioned model, not the protocol’s liquidation engine. Browser installation is a PWA feature, not a claim of a separately published native iOS, Android, Windows, or macOS binary. +Buffer provides scenario exploration, not trading recommendations; its liquidation estimate is a narrow, versioned model, not the protocol’s liquidation engine. Browser installation is a PWA feature. The Android app is a Solana Mobile Web Shell, a signed APK built from `android/` that opens the same web app; there is no native iOS, Windows, or macOS binary. diff --git a/docs/DISCORD-ALERTS.md b/docs/DISCORD-ALERTS.md index 85a4de3..01cfe01 100644 --- a/docs/DISCORD-ALERTS.md +++ b/docs/DISCORD-ALERTS.md @@ -31,11 +31,11 @@ Set **server-only** `BUFFER_DISCORD_DESTINATIONS_JSON` to a JSON array with the - Generate a stable UUID for `id`. Store this reference in the database; never store the token in a rule or browser payload. - `ownerIds` contains explicitly allowed authenticated Supabase user UUIDs. Authentication identifies the monitoring owner; it does not prove ownership of the public Solana address. An owner outside the allowlist cannot list, preview, verify, send or retrieve messages through this adapter. -- `label` is at most 80 characters. Credentials, channel IDs, webhook IDs and owner lists remain inside the server adapter. Browser-facing descriptors contain only the reference, sanitized label, masked channel suffix and a one-way configuration fingerprint. +- `label` is at most 80 characters. Credentials, channel IDs, webhook IDs and owner lists remain inside the server adapter. Browser-facing descriptors contain only the reference, sanitized label, masked channel suffix and a configuration fingerprint: HMAC-SHA-256 keyed with `BUFFER_ALERT_WORKER_SECRET`, so a fingerprint shown to an owner reveals nothing about the token. - There are at most 32 configured destinations and 100 owners per destination. Configuration is bounded, identifiers are validated, unknown keys are rejected, and malformed configuration fails with a constant credential-free error. - Never prefix this environment name with `NEXT_PUBLIC_`. Keep `BUFFER_ALERT_SEND_ENABLED=false` until the configured worker is reviewed and a recipient test has been authorized. Creating the adapter, rendering a preview and reading metadata do not send a notification. -The fingerprint binds the destination UUID, webhook ID, token, channel and sorted owner allowlist. Rotation changes the fingerprint. The worker must reject an old verified destination until it has verified the new configuration; the fingerprint is not an authentication token. Remove an owner or destination from configuration to deny subsequent adapter access. Pause rules before rotation, verify the replacement channel, then deliberately resume. Already accepted messages cannot be recalled by pausing a local rule. +The fingerprint binds the destination UUID, webhook ID, token, channel and sorted owner allowlist under the worker secret. Rotating any of them, or `BUFFER_ALERT_WORKER_SECRET` itself, changes the fingerprint. The worker must reject an old verified destination until it has verified the new configuration; the fingerprint is not an authentication token. Remove an owner or destination from configuration to deny subsequent adapter access. Pause rules before rotation, verify the replacement channel, then deliberately resume. Already accepted messages cannot be recalled by pausing a local rule. ## Exact adapter behavior diff --git a/docs/FINAL-VERIFICATION-2026-09-19.md b/docs/FINAL-VERIFICATION-2026-09-19.md index bd9183d..c51a9f2 100644 --- a/docs/FINAL-VERIFICATION-2026-09-19.md +++ b/docs/FINAL-VERIFICATION-2026-09-19.md @@ -128,7 +128,7 @@ The screenshots cover all four requested routes at 1440×1000, 390×844 and 320p - `src/components/Landing.tsx` - `src/lib/alerts.ts` - `src/server/velocity-normalize.ts` -- `supabase/migrations/20260919090000_harden_alert_pipeline.sql` +- `supabase/migrations/20260919172720_harden_alert_pipeline.sql` - `tests/alert-worker.test.ts` - `tests/alerts.test.ts` - `tests/velocity.test.ts` diff --git a/docs/PROVIDER.md b/docs/PROVIDER.md index 186b312..643746f 100644 --- a/docs/PROVIDER.md +++ b/docs/PROVIDER.md @@ -89,7 +89,7 @@ The earlier production Drift check is retained as historical evidence: authority Only server-side `SOLANA_RPC_URL` configures the RPC. The browser cannot supply an endpoint or program override. The endpoint must support `getGenesisHash`, filtered `getProgramAccounts`, `getAccountInfo`, `getMultipleAccounts`, and `getSlot`. Requests abort after 18 seconds; Vercel routes allow 30 seconds of function execution. Each process permits 60 reads per minute and four concurrent reads. Provider URLs and raw exceptions are not returned to the browser, and errors never fall back to samples. -The initial production RPC is Solana's shared mainnet endpoint and has no application-specific capacity guarantee. Use a dedicated endpoint for sustained traffic, and add a shared ingress limit when deploying more than one instance. All wallet-signing methods throw; there is no transaction, custody, trading, or wallet-connection path. +The initial production RPC is Solana's shared mainnet endpoint and has no application-specific capacity guarantee. Use a dedicated endpoint for sustained traffic, and add a shared ingress limit when deploying more than one instance. All wallet-signing methods throw; there is no transaction, custody, or trading path. The optional read-only wallet connection (**Use my wallet**) asks a Wallet Standard wallet, or Mobile Wallet Adapter on Android and Seeker, for its public address only. It never requests a signature, and the address follows the same read path as a pasted one. ## Tests and references diff --git a/docs/WEBHOOK-ALERTS.md b/docs/WEBHOOK-ALERTS.md index 2e5ecdd..49a56b3 100644 --- a/docs/WEBHOOK-ALERTS.md +++ b/docs/WEBHOOK-ALERTS.md @@ -5,7 +5,7 @@ Added 28 September 2026. Two additions to hosted monitoring, both behind the sam - a second **metric**, `liquidation_distance`: the unsigned percentage move from the current oracle price to one position's estimated liquidation price under model `cross-margin-hold-others-v1` (see [RISK-CONTEXT.md](RISK-CONTEXT.md)); - a second **destination kind**, `webhook`: an HMAC-signed JSON POST to a server-configured HTTPS URL. -No recipient tests were exercised outside synthetic transports. The migration `20260928120000_liquidation_sentinels.sql` is additive and is exercised end to end against local PostgreSQL by `scripts/verify-hosted-monitoring.mjs`. Hosted history confirms it was applied on September 28 as `20260928154216`; its constraints, RLS, function definitions and execution grants were verified on September 30. +No recipient tests were exercised outside synthetic transports. The migration `20260928154216_liquidation_sentinels.sql` is additive and is exercised end to end against local PostgreSQL by `scripts/verify-hosted-monitoring.mjs`. Hosted history confirms it was applied on September 28 under that version (the file carried a local timestamp, `20260928120000`, until the 17 October 2026 alignment); its constraints, RLS, function definitions and execution grants were verified on September 30. ## Liquidation-distance rules @@ -36,7 +36,7 @@ Set **server-only** `BUFFER_WEBHOOK_DESTINATIONS_JSON` to a JSON array. Every va ``` - `url` must be `https://`, a public DNS hostname (no IP literals, `localhost`, `.local`, `.internal`, `.home.arpa`), with no credentials, port, query or fragment. Buffer never accepts a pasted URL from the browser; an owner outside `ownerIds` cannot list, preview or send to the destination. -- `secret` is 32–256 URL-safe characters and never leaves the server. The browser sees only the id, label, `Webhook ` and a one-way fingerprint over id, URL, secret and sorted owners. Rotating any of them changes the fingerprint, which disables rules until the destination is re-verified on the next status read. +- `secret` is 32–256 URL-safe characters and never leaves the server. The browser sees only the id, label, `Webhook ` and a fingerprint: HMAC-SHA-256, keyed with `BUFFER_ALERT_WORKER_SECRET`, over id, URL, secret and sorted owners (an unkeyed SHA-256 until 24 October 2026, when no destination had yet been registered). Rotating any of them, or the worker secret, changes the fingerprint, which disables rules until the destination is re-verified on the next status read. - Verification is configuration policy only: no request is made until a real event is due. Keep `BUFFER_ALERT_SEND_ENABLED=false` until the receiver has been reviewed. ### Request @@ -80,7 +80,7 @@ Before configuring the first webhook destination on a deployment whose scheduler | Response | Recorded state | Notes | |---|---|---| | `2xx` | `delivered` | The acknowledgement is the receipt; generic receivers offer no read-back. The receipt id is `X-Buffer-Receipt`, `X-Request-Id` or JSON `id` when present, else `http-`. | -| `429` | `failed` (retryable) | Honors a numeric `Retry-After` up to one hour, else waits about 30 s, with bounded jitter. | +| `429` | `failed` (retryable) | Honours `Retry-After` given in seconds or as an HTTP-date, capped at one hour; an absent or unreadable header waits about 30 s, with bounded jitter. | | `5xx`, `408` | `failed` (retryable) | About 60 s before the next attempt; three attempts total. | | other `4xx` | `failed` (permanent) | Not retried. | | redirect, timeout, transport error after the write | `unknown_outcome` | Never re-sent automatically. | diff --git a/docs/dapp-store/banner-1200x600.png b/docs/dapp-store/banner-1200x600.png new file mode 100644 index 0000000..15aa731 Binary files /dev/null and b/docs/dapp-store/banner-1200x600.png differ diff --git a/docs/dapp-store/listing.md b/docs/dapp-store/listing.md new file mode 100644 index 0000000..5756683 --- /dev/null +++ b/docs/dapp-store/listing.md @@ -0,0 +1,117 @@ +# Solana dApp Store listing: Buffer + +Copy and assets for the Publisher Portal (https://publish.solanamobile.com). The text inside each fenced block is the exact Portal value. `node scripts/generate-dapp-store-assets.mjs verify` checks the text limits below as well as the image sizes. + +## Store text + +**App name** (6 of 25 characters). If the name is taken, use `Buffer: Perp Scenarios` (22 characters). + +```text name +Buffer +``` + +**Subtitle** (28 of 30 characters) + +```text subtitle +A clearer view of your perps +``` + +**Description** (2,777 of 10,000 characters) + +```text description +Buffer shows what a market move would do to your Solana perpetual positions. Paste a public wallet address, read the account, and move one shared price slider from −20% to +20%. Every number comes with its source, its assumptions and what it leaves out. + +What you can do +• Read live positions on Velocity (Solana mainnet by default, devnet on request) and Pacifica. Pacifica lists 76 perpetual markets across crypto, equities, commodities and FX. Velocity covers SOL, BTC, ETH and HYPE. +• Apply one price move to every eligible position. See each position's contribution, the total for each quote currency, and every excluded position with the reason. +• On live Velocity reads, see the maintenance headroom reported by the Velocity SDK and a liquidation estimate for each position. The estimate uses a named, versioned model (cross-margin-hold-others-v1). It solves for the oracle price at which one position alone would reach the maintenance boundary while everything else stays fixed. It is an estimate, not a guarantee, and it is not the protocol's liquidation engine. +• Inspect Jupiter Perps positions as inventory, without a price-effect estimate. Legacy Drift stays available as a labeled historical read. That deployment is paused, so Buffer does not calculate scenarios for it. +• Start without an address. Twelve presets and an editable four-market portfolio use fixed reference prices, clearly labeled. +• Save a dated report on your device, or download it as JSON. Saved reports are historical records and do not refresh with the market. +• Create an optional email account to keep a private library of saved reports and to set alert rules. +• Set alerts on a Velocity mainnet account: maintenance headroom in USD, or the distance from the current oracle price to one position's estimated liquidation price in percent. When the operator connects a verified Discord channel or signed webhook for your account, alerts go there. Alerts can be delayed or fail, so keep watching your positions directly. +• Delete your account and the data stored with it at any time, from inside the app. + +Read-only by design +• Buffer never asks for a seed phrase or private key. +• Buffer never requests a signature, never sends a transaction and never moves funds. +• Use my wallet asks your wallet for its public address and nothing else. On Android and Seeker it works through Mobile Wallet Adapter, with wallets such as Seed Vault Wallet, Phantom or Solflare. +• Live calculations expire after at most two minutes and ask you to refresh. + +This Android app opens the Buffer web app, so live reads, account sync and alerts need an internet connection. + +Buffer is a scenario tool, not trading advice. Positions, prices and estimates come from public protocol data and can change between reads. +``` + +**What's new** + +```text whats-new +First release +``` + +## Listing details + +| Field | Value | +| --- | --- | +| Website | https://bufferonsolana.vercel.app | +| Privacy policy | https://bufferonsolana.vercel.app/privacy | +| Terms of use | https://bufferonsolana.vercel.app/terms | +| Account deletion | In the app: My reports, then Delete account. Explained at https://bufferonsolana.vercel.app/privacy#delete-account | +| Support and contact email | Set in the Portal | +| Languages | English | +| Category (suggested) | Finance, matching the web app manifest | +| Token distribution | No | +| Copyright | © 2026 Operator Uplift | +| Availability | All regions except sanctioned countries | +| Android package | `com.operatoruplift.buffer`, version 1.0.0 (versionCode 1), a signed release APK built from `android/` (see [Seeker and PWA readiness](../seeker-and-pwa.md)) | + +## Assets + +Regenerate everything, then check it: + +```bash +node scripts/generate-dapp-store-assets.mjs # banner, screenshots, verify +node scripts/generate-dapp-store-assets.mjs verify # sizes and text limits only +``` + +The banner is composed in `scripts/dapp-store/banner.html` from the brand masters, the Buffer mark and the self-hosted Inter, and rendered with Playwright at deviceScaleFactor 1. Its scenario card is the app's own Long + short preset at −10%, computed by `src/lib/scenario.ts`, with fixed reference prices. + +Screenshots are captured as a 360 × 640 phone at deviceScaleFactor 3, with service workers blocked. They show real public mainnet accounts at capture time. The script only opens public pages; the report shot saves to the throwaway browser profile. By default it reads the live site; pass `--base-url` to capture another build. + +This kit was captured on 8 October 2026 from a local production build of this branch (`npm run build`, then `npm run start -- --port 3191` with `SOLANA_RPC_URL=https://api.mainnet-beta.solana.com`), so the landing page already shows the corrected hero line. Velocity data came from Solana mainnet through that public RPC and Pacifica data from Pacifica's public API: + +```bash +node scripts/generate-dapp-store-assets.mjs screenshots --base-url=http://127.0.0.1:3191 +node scripts/generate-dapp-store-assets.mjs verify +``` + +| File | Size | Shows | +| --- | --- | --- | +| `banner-1200x600.png` | 1200 × 600 | Brand banner: headline, read-only cue and the Long + short preset scenario card | +| `screenshots/01-landing-hero.png` | 1080 × 1920 | The landing page hero | +| `screenshots/02-velocity-liquidation-estimate.png` | 1080 × 1920 | Live Velocity mainnet example: observation time and per-position liquidation estimates (model cross-margin-hold-others-v1) | +| `screenshots/03-velocity-price-scenario.png` | 1080 × 1920 | The same account with a −10% shared price move applied | +| `screenshots/04-pacifica-positions.png` | 1080 × 1920 | Live Pacifica example: perpetual positions across index, equity, commodity and FX markets | +| `screenshots/05-saved-report.png` | 1080 × 1920 | A report saved on the device, with its dated explanation open | +| `screenshots/06-alerts-panel.png` | 1080 × 1920 | Live monitoring for the Velocity account, as a signed-out visitor sees it | + +## Reviewer notes + +```text reviewer-notes +No account is needed for the core flows: presets, live account reads and reports saved on the device. + +To see a live Velocity mainnet position, open the app and tap "Explore live risk", or paste DxoRJ4f5XRMvXU9SGuM4ZziBFUxbhB3ubur5sVZEvue2 into the address field with Velocity selected and tap "Read account". It is a public account; its balances can change. For Pacifica, choose Pacifica and paste Ep1d8JdFw4FnB85XDgXGVabYutro4JzK285HQqW6TZE2. + +"Use my wallet" is read-only. It asks the wallet for its public address through Wallet Standard, or Mobile Wallet Adapter on Android, and never requests a signature or a transaction. + +Signed-in accounts can be deleted from inside the app. Tap My reports, scroll to Delete account at the bottom of the Saved perspectives dialog, tap "Delete account…", then confirm with "Delete account permanently". The account and all of its data are deleted and the app signs out. +``` + +## Before you submit + +- Apply `supabase/migrations/20261008081817_delete_own_account.sql` to production. Until then, Delete account reports that deletion could not be confirmed and deletes nothing. +- Apply the other unapplied migrations in order: `20261008120000_rate_limit_retention_and_keyed_hash.sql`, `20261017103000_worker_fairness.sql`, `20261019090000_worker_secret_lockout.sql` and `20261019091500_saved_report_quota.sql`. Each has a local PGlite verifier under `scripts/`. +- Give the reviewer a way to test deletion. Email sign-up is off in production (`NEXT_PUBLIC_AUTH_EMAIL_READY` is not `true`), so either enable it or create a reviewer account and add its sign-in details in the Portal's reviewer notes. +- Optionally regenerate the screenshots from production once this branch is deployed (the default `--base-url`). +- Check that both example accounts still hold open positions; if not, pass `--velocity=
` or `--pacifica=
` to the script. +- Enter the support email in the Portal. diff --git a/docs/dapp-store/screenshots/01-landing-hero.png b/docs/dapp-store/screenshots/01-landing-hero.png new file mode 100644 index 0000000..050d30c Binary files /dev/null and b/docs/dapp-store/screenshots/01-landing-hero.png differ diff --git a/docs/dapp-store/screenshots/02-velocity-liquidation-estimate.png b/docs/dapp-store/screenshots/02-velocity-liquidation-estimate.png new file mode 100644 index 0000000..c8dffc1 Binary files /dev/null and b/docs/dapp-store/screenshots/02-velocity-liquidation-estimate.png differ diff --git a/docs/dapp-store/screenshots/03-velocity-price-scenario.png b/docs/dapp-store/screenshots/03-velocity-price-scenario.png new file mode 100644 index 0000000..5239960 Binary files /dev/null and b/docs/dapp-store/screenshots/03-velocity-price-scenario.png differ diff --git a/docs/dapp-store/screenshots/04-pacifica-positions.png b/docs/dapp-store/screenshots/04-pacifica-positions.png new file mode 100644 index 0000000..1081505 Binary files /dev/null and b/docs/dapp-store/screenshots/04-pacifica-positions.png differ diff --git a/docs/dapp-store/screenshots/05-saved-report.png b/docs/dapp-store/screenshots/05-saved-report.png new file mode 100644 index 0000000..9e7ebad Binary files /dev/null and b/docs/dapp-store/screenshots/05-saved-report.png differ diff --git a/docs/dapp-store/screenshots/06-alerts-panel.png b/docs/dapp-store/screenshots/06-alerts-panel.png new file mode 100644 index 0000000..ce08d8f Binary files /dev/null and b/docs/dapp-store/screenshots/06-alerts-panel.png differ diff --git a/docs/seeker-and-pwa.md b/docs/seeker-and-pwa.md index c71b044..c624348 100644 --- a/docs/seeker-and-pwa.md +++ b/docs/seeker-and-pwa.md @@ -21,45 +21,41 @@ Mobile Wallet Adapter registers itself only on Android in a secure context (or i ## Build the Android APK -The shell in `android/` was generated with `@solana-mobile/webshell-cli`, which the Solana Mobile docs now recommend over Bubblewrap. It wraps `https://bufferonsolana.vercel.app/app` in a WebView with native wallet-intent handling, so the deployed site is the app: redeploying the web app updates the app without a new APK. +The shell in `android/` was generated with `@solana-mobile/webshell-cli`, which the Solana Mobile docs now recommend over Bubblewrap. It wraps `https://bufferonsolana.vercel.app/app` in a WebView with native wallet-intent handling, so the deployed site is the app: redeploying the web app updates the app without a new APK. The shell ships English resources only (`androidResources.localeFilters` in `android/app/build.gradle.kts`), so the APK declares one locale. -Prerequisites: Node 24+, `adb`, and about 2 GB of disk for the Android SDK. The CLI installs a managed JDK 17 and the SDK packages it needs on the first `build` (`doctor --fix` does the same without building). +Prerequisites: JDK 21, the Android SDK with build-tools 36.1.0, and `adb`. Build with the Gradle wrapper; Gradle reads the signing values below and nothing else. ```bash -npm install -g @solana-mobile/webshell-cli +export JAVA_HOME=/usr/local/opt/openjdk@21 ANDROID_HOME=$HOME/Library/Android/sdk cd android -# First build only: choose a release keystore. The CLI creates it if the file -# does not exist. Keep it and its passwords outside the repo; losing it means -# you can never update the app on the dApp Store. -export WEB_SHELL_KEYSTORE_PASSWORD='...' -export WEB_SHELL_KEY_PASSWORD='...' -webshell build . --keystore-path ~/keys/buffer-release.keystore --keystore-alias buffer +# First release only: create the release keystore. Keep it and its passwords +# outside the repo. Losing it means you can never update the app on the dApp Store. +keytool -genkeypair -v -keystore $HOME/keys/buffer-release.keystore -alias buffer -keyalg RSA -keysize 4096 -validity 10000 +WEB_SHELL_SIGNING_STORE_PASSWORD=… WEB_SHELL_SIGNING_KEY_PASSWORD=… ./gradlew --no-daemon assembleRelease -PWEB_SHELL_SIGNING_STORE_FILE=$HOME/keys/buffer-release.keystore -PWEB_SHELL_SIGNING_KEY_ALIAS=buffer + +$ANDROID_HOME/build-tools/36.1.0/apksigner verify --print-certs app/build/outputs/apk/release/app-release.apk adb install -r app/build/outputs/apk/release/app-release.apk ``` -Bump `--version-code` on every release (`webshell init . --force --version-code 2 --version-name 1.1.0` rewrites `gradle.properties`; the URL, id and icons are already recorded in `twa-manifest.json`). +**A missing signing value does not fail the build.** Without the store file, store password or key alias, Gradle silently produces an unsigned `app-release-unsigned.apk`, which the dApp Store rejects. Always run the `apksigner verify` line before uploading. The key password falls back to the store password when it is not set. + +Raise the version code on every release: set `WEB_SHELL_VERSION_CODE` and `WEB_SHELL_VERSION_NAME` in `android/gradle.properties`, or pass `-PWEB_SHELL_VERSION_CODE=2 -PWEB_SHELL_VERSION_NAME=1.1.0`. The URL, application ID and icons are already recorded in `gradle.properties` and `twa-manifest.json`. ## Publish on the Solana dApp Store -Winners must list on the dApp Store to claim CLOCK IN prizes, and the listing is the distribution channel for every Seeker owner. +The dApp Store is the distribution channel for every Seeker owner. The store text, banner and screenshots are ready in [docs/dapp-store](dapp-store/listing.md). -- Register at the Publisher Portal (https://docs.solanamobile.com/dapp-publishing/intro): KYC/KYB, and a publisher wallet holding about 0.2 SOL. That wallet signs every future update, so treat it like the keystore. -- Signing key: a **new** key never used on Google Play. The keystore above qualifies. -- Assets: the 512×512 icon (`icons/icon-512.png` or equivalent here), a 1200×600 banner, and at least four phone screenshots. -- Submit the release APK; review currently takes 3–5 business days. Updates go through the `dapp-store` CLI with the same publisher wallet. +- **Publisher Portal:** register at https://publish.solanamobile.com and complete KYC/KYB. +- **Publisher wallet:** connect a desktop browser-extension wallet, not a Ledger. Hold about 0.05 to 0.1 SOL for each release, plus ArDrive storage for the uploaded files. That wallet signs every future update, so treat it like the keystore. +- **Signing key:** a **new** key never used on Google Play. The keystore above qualifies. Upload a signed release APK only. +- **Text:** app name up to 25 characters, subtitle up to 30. +- **Assets:** the 512×512 icon (`public/icons/icon-512.png`), a banner of exactly 1200×600, and 4 to 8 portrait screenshots at least 1080 px wide. +- **Review** takes 3 to 5 business days. Every update needs a higher version code, the same signing key and the same publisher wallet. ## Decisions to make before the first publish -- **Application ID is permanent.** This shell uses `com.operatoruplift.buffer`. Change it now (`webshell init . --force --application-id ...`) or never. +- **Application ID is permanent.** This shell uses `com.operatoruplift.buffer`. Change `WEB_SHELL_APPLICATION_ID` in `android/gradle.properties` now or never. - **Host is pinned.** The shell keeps navigation on `bufferonsolana.vercel.app` and opens other hosts in the system browser. Moving to a custom domain later needs a rebuild but keeps the application ID. -- **Deep links.** The shell opens the start URL; if you want `/rwa?mint=...`-style links to open the app, add an intent filter for the host in `android/app/src/main/AndroidManifest.xml`. - -## CLOCK IN checklist (Solana Mobile × RadiantsDAO, closes 8 October 2026) - -- [ ] Release APK built with the steps above and installed on a Seeker or Android device -- [ ] Public GitHub repo (this one), with this branch merged -- [ ] Demo video showing the install, the wallet handoff and the core flow on a phone -- [ ] Pitch deck: problem, product, why mobile-first, traction, team -- [ ] Optional SKR integration for the separate $10K SKR prize +- **Deep links.** The shell opens the start URL. To let a shared account link such as `https://bufferonsolana.vercel.app/app?protocol=velocity&authority=` open the app, add an intent filter for that host and the `/app` path in `android/app/src/main/AndroidManifest.xml`. diff --git a/e2e/account-deletion.spec.ts b/e2e/account-deletion.spec.ts new file mode 100644 index 0000000..843934b --- /dev/null +++ b/e2e/account-deletion.spec.ts @@ -0,0 +1,108 @@ +import { expect, test, type Page, type Request } from '@playwright/test'; +import { AUTH_MOCK_CONFIGURED, AUTH_STORAGE_KEY, SUPABASE_ORIGIN, authMockSession, authMockUser, installAuthMock } from './auth-mock'; + +const person = authMockUser('00000000-0000-4000-8000-00000000000a', 'leaving@example.test'); +const reports = `${SUPABASE_ORIGIN}/rest/v1/saved_reports**`; +const deletion = `${SUPABASE_ORIGIN}/rest/v1/rpc/delete_own_account`; +const rehearsalKey = `buffer.alerts.rehearsal.v2:${person.id}`; + +test.skip(!AUTH_MOCK_CONFIGURED, 'Requires configured public Supabase URL; every auth and database request stays intercepted locally.'); + +async function openAccount(page: Page) { + await page.addInitScript(key => { + if (sessionStorage.getItem('buffer.deletion-fixture')) return; + sessionStorage.setItem('buffer.deletion-fixture', 'seeded'); + localStorage.setItem(key, JSON.stringify({ version: 2, rules: [], events: [], deliveries: [], monitors: [] })); + localStorage.setItem('buffer.device-reports.v1', JSON.stringify({ version: 1, reports: [] })); + }, rehearsalKey); + await page.route(reports, route => route.fulfill({ json: [] })); + await page.goto('/app'); + await page.locator('button[data-report-storage="cloud"]').click(); + const dialog = page.getByRole('dialog', { name: 'Saved perspectives.' }); + await expect(dialog.getByText('No reports saved yet.')).toBeVisible(); + return dialog; +} + +test('a signed-in person deletes their account after an in-page confirmation', async ({ page }) => { + const session = authMockSession(person); + await installAuthMock(page, { session }); + const calls: Request[] = []; + await page.route(deletion, route => { calls.push(route.request()); return route.fulfill({ json: person.id }); }); + let signedOut = 0; + await page.route(`${SUPABASE_ORIGIN}/auth/v1/logout**`, route => { signedOut++; return route.fulfill({ status: 403, json: { code: 'user_not_found', msg: 'User from sub claim in JWT does not exist' } }); }); + const dialog = await openAccount(page); + + const section = dialog.getByRole('region', { name: 'Delete account' }); + await section.getByRole('button', { name: 'Delete account…' }).click(); + await expect(section.getByRole('heading', { name: `Delete ${person.email} permanently?` })).toBeFocused(); + for (const item of ['Saved reports', 'Monitored wallet addresses and alert rules', 'Alert destinations, events and delivery records']) await expect(section).toContainText(item); + await expect(section.getByRole('link', { name: 'How deletion works' })).toHaveAttribute('href', '/privacy#delete-account'); + await section.getByRole('button', { name: 'Keep my account' }).click(); + await expect(section.getByRole('button', { name: 'Delete account…' })).toBeFocused(); + expect(calls).toHaveLength(0); + + await section.getByRole('button', { name: 'Delete account…' }).click(); + await section.getByRole('button', { name: 'Delete account permanently' }).click(); + + const notice = page.getByRole('status').filter({ hasText: 'Account deleted.' }); + await expect(notice).toBeVisible(); + await expect(notice).toContainText('You are signed out on this device.'); + await expect(page.locator('a.cloud-sign-in')).toBeVisible(); + await expect(dialog).toBeHidden(); + expect(calls).toHaveLength(1); + expect(calls[0].method()).toBe('POST'); + expect(calls[0].postData()).toBe('{}'); + // The caller's own session authorizes the call; the body names no account. + expect(calls[0].headers().authorization).toBe(`Bearer ${session.access_token}`); + expect(signedOut).toBe(1); + expect(await page.evaluate(([session, alerts]) => [localStorage.getItem(session), localStorage.getItem(alerts), localStorage.getItem('buffer.device-reports.v1') !== null], [AUTH_STORAGE_KEY, rehearsalKey])).toEqual([null, null, true]); + await notice.getByRole('button', { name: 'Dismiss' }).click(); + await expect(notice).toHaveCount(0); +}); + +test('an unconfirmed deletion keeps the session, says so, and can be retried', async ({ page }) => { + await installAuthMock(page, { session: authMockSession(person) }); + let reply: 'unavailable' | 'expired' | 'deleted' = 'unavailable'; + let calls = 0; + await page.route(deletion, route => { + calls++; + if (reply === 'unavailable') return route.fulfill({ status: 503, json: { message: 'Mock unavailable' } }); + if (reply === 'expired') return route.fulfill({ status: 401, json: { code: 'PGRST301', message: 'JWT expired' } }); + return route.fulfill({ json: person.id }); + }); + const dialog = await openAccount(page); + const section = dialog.getByRole('region', { name: 'Delete account' }); + await section.getByRole('button', { name: 'Delete account…' }).click(); + await section.getByRole('button', { name: 'Delete account permanently' }).click(); + await expect(section.getByRole('status')).toHaveText('Account deletion could not be confirmed. Try again; repeating it is safe.'); + expect(await page.evaluate(key => JSON.parse(localStorage.getItem(key) || 'null')?.user?.id, AUTH_STORAGE_KEY)).toBe(person.id); + expect(await page.evaluate(key => localStorage.getItem(key) !== null, rehearsalKey)).toBe(true); + + reply = 'expired'; + await section.getByRole('button', { name: 'Delete account permanently' }).click(); + await expect(section.getByRole('status')).toHaveText('Your session has expired. Nothing was deleted. Sign in again, then retry.'); + await expect(dialog.getByText(person.email!, { exact: true })).toBeVisible(); + + reply = 'deleted'; + await section.getByRole('button', { name: 'Delete account permanently' }).click(); + await expect(page.getByRole('status').filter({ hasText: 'Account deleted.' })).toBeVisible(); + expect(calls).toBe(3); +}); + +test('closing the dialog while a deletion is in flight neither cancels it nor hides its result', async ({ page }) => { + await installAuthMock(page, { session: authMockSession(person) }); + let release: (() => Promise) | undefined; + await page.route(deletion, route => { release = () => route.fulfill({ json: person.id }).catch(() => {}); }); + const dialog = await openAccount(page); + const section = dialog.getByRole('region', { name: 'Delete account' }); + await section.getByRole('button', { name: 'Delete account…' }).click(); + await section.getByRole('button', { name: 'Delete account permanently' }).click(); + await expect(section.getByRole('button', { name: 'Deleting your account…' })).toBeDisabled(); + await expect(dialog.getByRole('button', { name: 'Close saved reports' })).toBeDisabled(); + await page.keyboard.press('Escape'); + await expect(dialog).toBeVisible(); + await expect.poll(() => Boolean(release)).toBe(true); + await release!(); + await expect(page.getByRole('status').filter({ hasText: 'Account deleted.' })).toBeVisible(); + await expect(page.locator('a.cloud-sign-in')).toBeVisible(); +}); diff --git a/e2e/brand-motion.spec.ts b/e2e/brand-motion.spec.ts index 9109a3f..e500c91 100644 --- a/e2e/brand-motion.spec.ts +++ b/e2e/brand-motion.spec.ts @@ -2,7 +2,7 @@ import { expect, test } from '@playwright/test'; test('wordmarks share the landing header typography and blue across pages and footer', async ({ page }) => { const identities = []; - for (const path of ['/', '/app', '/demo', '/auth']) { + for (const path of ['/', '/app', '/demo', '/auth', '/privacy', '/terms']) { await page.goto(path); for (const brand of await page.locator('[data-brand="buffer"]').all()) { identities.push(await brand.evaluate(element => { diff --git a/e2e/legal.spec.ts b/e2e/legal.spec.ts new file mode 100644 index 0000000..cd06743 --- /dev/null +++ b/e2e/legal.spec.ts @@ -0,0 +1,80 @@ +import { expect, test, type Page } from '@playwright/test'; + +async function noOverflow(page: Page) { + expect(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth)).toBe(true); +} + +test('the privacy policy is public, specific to Buffer and states what deletion removes', async ({ page }) => { + const response = await page.goto('/privacy'); + expect(response?.status()).toBe(200); + await expect(page).toHaveTitle('Privacy policy — Buffer'); + await expect(page.getByRole('heading', { level: 1, name: 'Privacy policy' })).toBeVisible(); + const main = page.getByRole('main'); + await expect(main).toContainText('Last updated: 24 October 2026'); + await expect(main).toContainText('Operator Uplift'); + await expect(main).toContainText('IPs are hashed for rate limiting and no address is stored.'); + await expect(page.locator('#rate-limiting')).toContainText('HMAC-SHA-256 under a random key that never leaves our database'); + await expect(page.locator('#rate-limiting')).toContainText('No counter is kept more than five minutes after your last request.'); + await expect(page.locator('#retention')).toContainText('no later than five minutes after your last request'); + await expect(main).not.toContainText('one-way SHA-256'); + for (const processor of ['Vercel', 'Supabase', 'Solana RPC provider', 'Velocity', 'Pacifica', 'Drift', 'Jupiter', 'Discord']) await expect(main).toContainText(processor); + for (const record of ['Saved reports', 'Monitored wallet addresses and alert rules', 'Alert destinations', 'Alert events and delivery records']) await expect(page.locator('#delete-account')).toContainText(record); + await expect(page.locator('#delete-account')).toContainText('BUFFER_WEBHOOK_DESTINATIONS_JSON'); + await expect(page.locator('#processors')).toContainText('SOLANA_DEVNET_RPC_URL'); + await expect(page.locator('#contact')).toContainText('GitHub issues are public: never post your email address, wallet address or other personal details there.'); + await expect(main).not.toContainText('arrange a private way'); + await expect(main).toContainText('18'); + await expect(main.getByRole('link', { name: 'github.com/operatoruplift/buffer/issues' }).first()).toHaveAttribute('href', 'https://github.com/operatoruplift/buffer/issues'); + await expect(main.getByRole('link', { name: 'Terms of use' }).first()).toHaveAttribute('href', '/terms'); + await expect(page.locator('meta[name="robots"]')).toHaveCount(0); + await noOverflow(page); +}); + +test('the terms carry the Solana dApp Store clause and the read-only limits', async ({ page }) => { + const response = await page.goto('/terms'); + expect(response?.status()).toBe(200); + await expect(page).toHaveTitle('Terms of use — Buffer'); + await expect(page.getByRole('heading', { level: 1, name: 'Terms of use' })).toBeVisible(); + const main = page.getByRole('main'); + await expect(main).toContainText('Last updated: 24 October 2026'); + await expect(main).toContainText('not trading advice'); + await expect(main).toContainText('cross-margin-hold-others-v1'); + await expect(main).toContainText('never asks for your seed phrase or private key'); + await expect(main).toContainText('Alerts can be delayed or fail'); + await expect(page.locator('#dapp-store')).toContainText('If you obtained Buffer through the Solana dApp Store, these terms are between you and Operator Uplift only.'); + await expect(page.locator('#dapp-store')).toContainText('(the Solana Mobile Parties) are not a party to these terms and have no responsibility or liability to you in connection with Buffer'); + await expect(page.locator('#dapp-store')).toContainText('protect the Solana Mobile Parties to the same extent as they protect Operator Uplift'); + for (const heading of ['No warranty', 'Limitation of liability', 'Governing law', 'Changes to these terms', 'Contact']) { + await expect(main.getByRole('heading', { name: heading })).toBeVisible(); + } + await expect(main.getByRole('link', { name: 'Privacy policy' }).first()).toHaveAttribute('href', '/privacy'); + await noOverflow(page); +}); + +test('the landing footer, the workspace and the sitemap all reach the legal pages', async ({ page, request }) => { + await page.goto('/'); + const legal = page.getByRole('navigation', { name: 'Footer legal navigation', exact: true }); + await expect(legal.getByRole('link', { name: 'Terms of use', exact: true })).toHaveAttribute('href', '/terms'); + await legal.getByRole('link', { name: 'Privacy policy', exact: true }).click(); + await expect(page).toHaveURL(/\/privacy$/); + await expect(page.getByRole('heading', { level: 1, name: 'Privacy policy' })).toBeVisible(); + + await page.goto('/app'); + const workspaceLegal = page.getByRole('navigation', { name: 'Legal', exact: true }); + await expect(workspaceLegal.getByRole('link', { name: 'Privacy', exact: true })).toBeVisible(); + await workspaceLegal.getByRole('link', { name: 'Terms', exact: true }).click(); + await expect(page).toHaveURL(/\/terms$/); + await expect(page.getByRole('heading', { level: 1, name: 'Terms of use' })).toBeVisible(); + + const sitemap = await (await request.get('/sitemap.xml')).text(); + expect(sitemap).toContain('https://bufferonsolana.vercel.app/privacy'); + expect(sitemap).toContain('https://bufferonsolana.vercel.app/terms'); +}); + +test('the landing hero describes the read-only wallet connection accurately', async ({ page }) => { + await page.goto('/'); + const note = page.locator('.buffer-hero-note'); + await expect(note).toHaveText('Read-only wallet connection. No signatures or trading permissions.'); + await expect(page.getByText('No wallet connection.', { exact: false })).toHaveCount(0); + await expect(page.locator('#privacy').getByRole('link', { name: 'Read the privacy policy' })).toHaveAttribute('href', '/privacy'); +}); diff --git a/package-lock.json b/package-lock.json index 1cf354b..5f080c5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,7 @@ "@wallet-standard/app": "^1.1.1", "@wallet-standard/base": "^1.1.0", "decimal.js": "10.6.0", - "next": "16.3.4", + "next": "16.4.3", "react": "19.3.0", "react-dom": "19.3.0", "server-only": "0.0.1", @@ -29,9 +29,11 @@ "@types/react": "19.2.7", "@types/react-dom": "19.2.3", "eslint": "9.39.1", - "eslint-config-next": "16.3.4", + "eslint-config-next": "16.3.8", + "rolldown": "1.2.8", + "sharp": "0.35.5", "typescript": "5.9.3", - "vitest": "5.0.0" + "vitest": "5.0.5" }, "engines": { "node": "24.x" @@ -970,16 +972,16 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/@img/colour/-/colour-1.1.0.tgz", "integrity": "sha512-Td76q7j57o/tLVdgS746cYARfSyxk8iEfRxewL9h4OMzYhbW4TAcppl0mT4eyqXddh6L/jwoM75mo7ixa/pCeQ==", + "devOptional": true, "license": "MIT", - "optional": true, "engines": { "node": ">=18" } }, "node_modules/@img/sharp-darwin-arm64": { - "version": "0.35.4", - "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.35.4.tgz", - "integrity": "sha512-Uhfl4V4lhP2nbUVF9+hyH1+luj86f1gUFeo8ALYxFoULoU+G87D43BfeMP8XHsk9boxAnCY/bf2EHwhA7MuGsA==", + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.35.5.tgz", + "integrity": "sha512-QRUlFQ0WxvdWyqqG/WtI3iupfD5rBzmCHXSdPsY91sAtVtTo7Q4cb6zOccZ3gqEqkr0f1As1ehLqmEpDsRf+lg==", "cpu": [ "arm64" ], @@ -995,13 +997,13 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-darwin-arm64": "1.3.3" + "@img/sharp-libvips-darwin-arm64": "1.3.4" } }, "node_modules/@img/sharp-darwin-x64": { - "version": "0.35.4", - "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.35.4.tgz", - "integrity": "sha512-hWniXY3bG5qKpkKrAwPe4y+VTPmf086YQAnkxWh7uA1YrlRouWGa0M0Mxj3ZjnXFkv7/TD1bTy9lGUK26vRvWw==", + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.35.5.tgz", + "integrity": "sha512-+BR255RhDlpygUpOc/Jdt1nT6DQ3XG/ERo5wbcdOf5Q320dKtPCKPLR1LJs9VGXRaMa8l1uUa0tkCNOXiAxZUw==", "cpu": [ "x64" ], @@ -1017,20 +1019,20 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-darwin-x64": "1.3.3" + "@img/sharp-libvips-darwin-x64": "1.3.4" } }, "node_modules/@img/sharp-freebsd-wasm32": { - "version": "0.35.4", - "resolved": "https://registry.npmjs.org/@img/sharp-freebsd-wasm32/-/sharp-freebsd-wasm32-0.35.4.tgz", - "integrity": "sha512-lIsKw/BU+kjB4eZjxrYrZmwOJYi3Ajrv66iAlBmUPyKc3HpnloevB1g3wxGD9P/5BbQ1brBGl65VRRrCvQDEqA==", + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-freebsd-wasm32/-/sharp-freebsd-wasm32-0.35.5.tgz", + "integrity": "sha512-Y/z91nEZ4uIBX5X3nfTovjU9lHNKFYbL2lpHCLVNmXQK03VIZvXBBt0KxbPGp2SdGSF+2mQU4e+hQaWOt86iAw==", "license": "Apache-2.0", "optional": true, "os": [ "freebsd" ], "dependencies": { - "@img/sharp-wasm32": "0.35.4" + "@img/sharp-wasm32": "0.35.5" }, "engines": { "node": ">=20.9.0" @@ -1040,9 +1042,9 @@ } }, "node_modules/@img/sharp-libvips-darwin-arm64": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.3.3.tgz", - "integrity": "sha512-suTBPTDGrI9WodccaDdwZItTSaBYASlBk1NSfElSHrUfzu3szG6lvIF58+WiFvnfzuK8ZBFS5zE00PxqxnRiPg==", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.3.4.tgz", + "integrity": "sha512-5R89nBYiRdUlSWJxPhO+GVtaXzXSxKnRu/xqMn3KTA3L9EB9Oy/P+Nn2f2vlhPuUdy/Zusb2DarbyTpGCfEDuw==", "cpu": [ "arm64" ], @@ -1056,9 +1058,9 @@ } }, "node_modules/@img/sharp-libvips-darwin-x64": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.3.3.tgz", - "integrity": "sha512-FVJZ5mITMobmXIz/hPDTw0EintTW5H3WfrxwLqEqjiIihlu+hVRyGrFQ60xl0Lxn7Bt3zdpevPaQi0HEzqz9fw==", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.3.4.tgz", + "integrity": "sha512-iR2OKH80yi0U+dUplyh3/xdpFvps6YkCwsXenIJxqxR1v9o+xtKTGbS9H7cps+2Vxjc8B1j96p75NmTGjIhtpQ==", "cpu": [ "x64" ], @@ -1072,12 +1074,15 @@ } }, "node_modules/@img/sharp-libvips-linux-arm": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.3.3.tgz", - "integrity": "sha512-3rbU4vqXXc3hY/OiXdl52xZvT0F1yEngWfvqudtPJg/KkyiaQw2DRsFrNzpmLvfavbwOq3qXn36GP8obHRULQA==", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.3.4.tgz", + "integrity": "sha512-LmRtTsOHuvM2+wlO2Db37dx5MiZhB0FvSunciw48YjdOkZz9KAiRbm8ujeMOA1INqmei5NapFxYEK1D1ZSidmw==", "cpu": [ "arm" ], + "libc": [ + "glibc" + ], "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -1088,12 +1093,15 @@ } }, "node_modules/@img/sharp-libvips-linux-arm64": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.3.3.tgz", - "integrity": "sha512-0DaL0A6Xu6sQSQFwe4iVCrKWU2cCTItnRsYsCdxAMm9NF6twAA9BKnoqy4hqz4+azQ0JHuA26qiUKsf1XJ/v5A==", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.3.4.tgz", + "integrity": "sha512-Y3dgX/6lE2QhQb+Gxy0WZxfg9MEm/JBjamZpS2IklP7xIQoKN4hzAm7KcMVGtaVDt3neE9OKBC7vAfonA/Lr1A==", "cpu": [ "arm64" ], + "libc": [ + "glibc" + ], "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -1104,12 +1112,15 @@ } }, "node_modules/@img/sharp-libvips-linux-ppc64": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.3.3.tgz", - "integrity": "sha512-cdn1OvUBwsXhbC0zSzJnNzf5MZ/mTrobawDvNXBTxe8VtqKAm0sRuEY2Evzovb/w9JMk4TvRxqt1mekSuJz64w==", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.3.4.tgz", + "integrity": "sha512-Le6boB8Tai0Nis+gIxIpKx68UDVVIqdR8Tin5Yf1z2LJJQLDJvCDRqRu+jC2qCoD+eIomonmOwB4smBRxfVpYQ==", "cpu": [ "ppc64" ], + "libc": [ + "glibc" + ], "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -1120,12 +1131,15 @@ } }, "node_modules/@img/sharp-libvips-linux-riscv64": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.3.3.tgz", - "integrity": "sha512-HjPVx7yKz+0lqdhDlTw1tt90wamBoxhiXpvl1XZpJLiHH4RCJ5yDTqH+VlYPv2fwFs89JFw4c1IexYOcQUi4IQ==", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.3.4.tgz", + "integrity": "sha512-aHkkIEHPRdQEegJN20MLmGtxYD9R2wQr3Cwpddnu5+YKMt6Uzax7S9h5gpZTo8wyrGuZSlfQ63OevL5mTyOC7Q==", "cpu": [ "riscv64" ], + "libc": [ + "glibc" + ], "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -1136,12 +1150,15 @@ } }, "node_modules/@img/sharp-libvips-linux-s390x": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.3.3.tgz", - "integrity": "sha512-neWLh+3yCNThxnfy3c4BbVBeGgt9aftno+XbT56iK28RgeDs3UOFWviLWlUu0bArYVYJaFDK+RRohbicUNCm8Q==", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.3.4.tgz", + "integrity": "sha512-ra/mB6MikESDUO7Yg+Mi95bFBb9GsObURuhnOv3OqknjGe9sZrG8tCe9q0xSIGrtLgvgw0gKnFWcK4blSgQOuQ==", "cpu": [ "s390x" ], + "libc": [ + "glibc" + ], "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -1152,12 +1169,15 @@ } }, "node_modules/@img/sharp-libvips-linux-x64": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.3.3.tgz", - "integrity": "sha512-4vKmvAst9nrowcqquKFAyZJUDolUaIp8uRiN0mWFguJ1IplC9/pitXtlnnlU4aa/eJw3J7i67V+pwUL+wZGdsA==", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.3.4.tgz", + "integrity": "sha512-GJ//SSXbnwSDes02umB3nDJLFcQzw8a18V8fyhqr6tV515tOEMdImjjxj1AoafMRz56F3PHgftnj1QEKSU1zkw==", "cpu": [ "x64" ], + "libc": [ + "glibc" + ], "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -1168,12 +1188,15 @@ } }, "node_modules/@img/sharp-libvips-linuxmusl-arm64": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.3.3.tgz", - "integrity": "sha512-Y9kQaLMuNoB0bPYOOdcZMaseNrFpPodIWWMrx+CZyydf2xn68j9WYc6sWWRrDwNkzCQjKYfc68L7jKjGlHMibw==", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.3.4.tgz", + "integrity": "sha512-hvulFwtjUcagsis6BBxHwGFwWoNZjgYmULGVrZcyfNbjA8hKILbRxGg15/7w5HDyXHXUos/j6baAWqnCyQ2DWA==", "cpu": [ "arm64" ], + "libc": [ + "musl" + ], "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -1184,12 +1207,15 @@ } }, "node_modules/@img/sharp-libvips-linuxmusl-x64": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.3.3.tgz", - "integrity": "sha512-fj8Mv0HHfD1Rr+4I68+3agJynxDWtBFgicTbSOb9Bke6pIwzGcJ+RX/yHjmiEGFMCavY/dxvem7MyNaJF+wDiw==", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.3.4.tgz", + "integrity": "sha512-6zXKeE/p39I1AmA3cJG35eyBGNqNddLnUXjhwBnsGjFPWqf5VKkDBEqaEkPDoTEtkxwi2vv8Tcr2mDyP4So7Fg==", "cpu": [ "x64" ], + "libc": [ + "musl" + ], "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -1200,12 +1226,15 @@ } }, "node_modules/@img/sharp-linux-arm": { - "version": "0.35.4", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.35.4.tgz", - "integrity": "sha512-7OAS8gI0EReKGVN2HssHlM6umJgxF5VI3xN0p9FA91p/YO+ou5hiNghLdZ5BEHztwaaK5+bLKRf8x/o2L2nk9A==", + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.35.5.tgz", + "integrity": "sha512-LEaXK2WdXVK5ykcw0buWyPMsmLLL2vpHLD6yrNSW+JGEL3BZPA4tpKN6iaMc4AxTTAoaX/sU1rOL51lcIz48ZQ==", "cpu": [ "arm" ], + "libc": [ + "glibc" + ], "license": "Apache-2.0", "optional": true, "os": [ @@ -1218,16 +1247,19 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linux-arm": "1.3.3" + "@img/sharp-libvips-linux-arm": "1.3.4" } }, "node_modules/@img/sharp-linux-arm64": { - "version": "0.35.4", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.35.4.tgz", - "integrity": "sha512-De4jpEnAU8Hd5oT0j1G3uL4ZvTuipVMn7YC6vPaJhy6/7EwEae0SVAoBrUMYQbkLGDm85taVWwuPc1a44LTzCQ==", + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.35.5.tgz", + "integrity": "sha512-LYVx5JTsOM2CBzmxreh+nl64/3H6Xb09iSLknqH47z2T2DFFxDeFLP5y4dJwe6H7uGQlHPyEEtIqyo3DYsRwdQ==", "cpu": [ "arm64" ], + "libc": [ + "glibc" + ], "license": "Apache-2.0", "optional": true, "os": [ @@ -1240,16 +1272,19 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linux-arm64": "1.3.3" + "@img/sharp-libvips-linux-arm64": "1.3.4" } }, "node_modules/@img/sharp-linux-ppc64": { - "version": "0.35.4", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.35.4.tgz", - "integrity": "sha512-2oYZJeIl4kCcMGk4ouZVjnkCtFrpQFlNEtJ6GbxzhHQchwH0NH/qEb9ykmOl29dqwMq+JhFdZn+1ak2FKhI9fQ==", + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.35.5.tgz", + "integrity": "sha512-QVxAAq8evVRI9ia2vqgwrmWucn5Dfv+JdWzj75pD8omHLPSP7f8p20O8jxzjCcuCEQEOtYOZUmX1hkiZ0kdevA==", "cpu": [ "ppc64" ], + "libc": [ + "glibc" + ], "license": "Apache-2.0", "optional": true, "os": [ @@ -1262,16 +1297,19 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linux-ppc64": "1.3.3" + "@img/sharp-libvips-linux-ppc64": "1.3.4" } }, "node_modules/@img/sharp-linux-riscv64": { - "version": "0.35.4", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.35.4.tgz", - "integrity": "sha512-cPbNChoRURAWdebDIHSenxRpgEdy7JkPydSnUxRm9VvKD7m0/xVaR/8Fzlu81pk5nHEvHH87UZUA7cTtwnbJSA==", + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.35.5.tgz", + "integrity": "sha512-LtdreXguaavKODPIfzJ4kffx7UNt1omwtK0rch4EBbbSTXPnxWmYSayXdLJw0fJzQ97kHt1gL/yh4tvU+nCyRQ==", "cpu": [ "riscv64" ], + "libc": [ + "glibc" + ], "license": "Apache-2.0", "optional": true, "os": [ @@ -1284,16 +1322,19 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linux-riscv64": "1.3.3" + "@img/sharp-libvips-linux-riscv64": "1.3.4" } }, "node_modules/@img/sharp-linux-s390x": { - "version": "0.35.4", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.35.4.tgz", - "integrity": "sha512-RY0JFY8Fd6RonCBtHz+DvadaPkXDSI1AUn6yWL9TipqkZ1vY8w8evqdgyDFnkm4/K1ve1TvZiaePP5oSd4+WVQ==", + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.35.5.tgz", + "integrity": "sha512-UZasTOFiYzotTsGOCu42BfUzP6Tu6Do/947iRm1RsLKvlllxwGcn4RN27LibGWceix4Y+Pmw3jsnTcCQIgWjqA==", "cpu": [ "s390x" ], + "libc": [ + "glibc" + ], "license": "Apache-2.0", "optional": true, "os": [ @@ -1306,16 +1347,19 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linux-s390x": "1.3.3" + "@img/sharp-libvips-linux-s390x": "1.3.4" } }, "node_modules/@img/sharp-linux-x64": { - "version": "0.35.4", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.35.4.tgz", - "integrity": "sha512-9qvvEAuk8k89TfWUoX2htWjbAMX8p+NxCppjpcg5k6xMsjhBQPTsoIh36h9Qde4WRuGpJeYnOjdosDn/cnv+OA==", + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.35.5.tgz", + "integrity": "sha512-SxFtLTeJInhAA9Q836kux2vZNeOBQEx658qvbboZScr0wIARym3IcGmW7KpVD5sbVg0Ojy+udFQdayYIZyoNog==", "cpu": [ "x64" ], + "libc": [ + "glibc" + ], "license": "Apache-2.0", "optional": true, "os": [ @@ -1328,16 +1372,19 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linux-x64": "1.3.3" + "@img/sharp-libvips-linux-x64": "1.3.4" } }, "node_modules/@img/sharp-linuxmusl-arm64": { - "version": "0.35.4", - "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.35.4.tgz", - "integrity": "sha512-KB5jxpfWQTr0nc3xdHtWChdbifHrBGsd2SM62Eyxrl8afikm+f5qGBU75SJIZBT/S1MC8XyacdlXBMSWq6OURA==", + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.35.5.tgz", + "integrity": "sha512-9HbMclmI1zlNkFRs3z9/eBtDjfD0sGlrX1z6b1qwmiFY5ElDLh4BC0LPBdVp7z1DXFiKlIcznf+ZlsuZzLxQqg==", "cpu": [ "arm64" ], + "libc": [ + "musl" + ], "license": "Apache-2.0", "optional": true, "os": [ @@ -1350,16 +1397,19 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linuxmusl-arm64": "1.3.3" + "@img/sharp-libvips-linuxmusl-arm64": "1.3.4" } }, "node_modules/@img/sharp-linuxmusl-x64": { - "version": "0.35.4", - "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.35.4.tgz", - "integrity": "sha512-f+eZJZIQNEEd26RPSW+76chwOf1XtA2Y/O+5ocVyLliHkeih3e+jhLVBdNTd2rS3IbNXK8+ug93Vf5ZXtF5Lxg==", + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.35.5.tgz", + "integrity": "sha512-4KOphqB035HrVdqLZfCgMzzERrQkkzOwRhl4OAkRO1YCldbaFjySXMaK534Mo0V+LndnlJk+sbUyLeU0ULyD1A==", "cpu": [ "x64" ], + "libc": [ + "musl" + ], "license": "Apache-2.0", "optional": true, "os": [ @@ -1372,13 +1422,13 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linuxmusl-x64": "1.3.3" + "@img/sharp-libvips-linuxmusl-x64": "1.3.4" } }, "node_modules/@img/sharp-wasm32": { - "version": "0.35.4", - "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.35.4.tgz", - "integrity": "sha512-zQnl4Kwp7Q6NHsENtU2T/00Zi+w3AQNwz3+UaTyVBy2FpXrzXzGjndpK61onhZjRtRpQXxCTeqw19bVyXOh7jA==", + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.35.5.tgz", + "integrity": "sha512-Ptsga1su4tQx+LLF1ECS9U6nz5kmrXKo6XVbtR48Ke3ZRxxgaWBu7IDtEe1quo8hiupwm6WFqxVlXaSf7IINGQ==", "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT", "optional": true, "dependencies": { @@ -1392,16 +1442,16 @@ } }, "node_modules/@img/sharp-webcontainers-wasm32": { - "version": "0.35.4", - "resolved": "https://registry.npmjs.org/@img/sharp-webcontainers-wasm32/-/sharp-webcontainers-wasm32-0.35.4.tgz", - "integrity": "sha512-ESfNkywmCfPNyaZjxooddJQiQ+l/nTpGEOGthxiLnIHXC/CmcBixnfwUleX9mCz9ovrUUvKMap/pm8RYbzfwaA==", + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-webcontainers-wasm32/-/sharp-webcontainers-wasm32-0.35.5.tgz", + "integrity": "sha512-hfhF/FmoQyTUkA0bIKFOtw536BQSeBMe6BF6QyWlrPxT754+TFLaZ7sKKTfvvM0yJgKgaYTwnFCIZ/GuDw5SUA==", "cpu": [ "wasm32" ], "license": "Apache-2.0", "optional": true, "dependencies": { - "@img/sharp-wasm32": "0.35.4" + "@img/sharp-wasm32": "0.35.5" }, "engines": { "node": ">=20.9.0" @@ -1411,9 +1461,9 @@ } }, "node_modules/@img/sharp-win32-arm64": { - "version": "0.35.4", - "resolved": "https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.35.4.tgz", - "integrity": "sha512-iNdlBX9gLVvqe2I3uIJSIKTq6wckP/DYxZtcqxm09x5Gi24DnFBmPAWZmr60ZyYMG0xlzo6goG3670ar+RXvRw==", + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.35.5.tgz", + "integrity": "sha512-X4t7g+7ZA5DKblCBEXGjUqqemj4vczING/5viFwAL8h4N3qYeyjwdCvRLHi4EdOUI+2Z7UFlp1VM+p/AuEtm6Q==", "cpu": [ "arm64" ], @@ -1430,9 +1480,9 @@ } }, "node_modules/@img/sharp-win32-ia32": { - "version": "0.35.4", - "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.35.4.tgz", - "integrity": "sha512-kqRsbaa5CS6KHlpxnN7WhE6vAAugXyZButpRdvDWetlv6Qv4N9WTcrWzF7tXfB9T7MsoadqdI8hmwLq6UlLvtw==", + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.35.5.tgz", + "integrity": "sha512-5Zm82LoBc43nhwNybZlG7Y1KO//Zhsn306fQl29ZOuStHLGTo3BWL83q3cznX0poxSAMuYL1On/BHBxkBeKr6A==", "cpu": [ "ia32" ], @@ -1449,9 +1499,9 @@ } }, "node_modules/@img/sharp-win32-x64": { - "version": "0.35.4", - "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.35.4.tgz", - "integrity": "sha512-XtmnYhBcrORsJ4XJngyzr/EWP0hRZLAZRFaApdKuviyqF78+ylxh2y06ZmtULAMOnObJ3ucpN0AcwSWnMowTRg==", + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.35.5.tgz", + "integrity": "sha512-x76eH0vEiHlcMQu8Y8IenntaACtddpT6W0wmXtWrnKcnKI7ME5DdgqhAD6SEWOEl1v2zDvkZDhFA9KnURwpfqg==", "cpu": [ "x64" ], @@ -1695,15 +1745,15 @@ } }, "node_modules/@next/env": { - "version": "16.3.4", - "resolved": "https://registry.npmjs.org/@next/env/-/env-16.3.4.tgz", - "integrity": "sha512-cjWZnUUa6jZq2kFaNe/ZyJdZonOZ/QoN0Zka2nz/FLOrfx14pQuM9c5RaSVkWMqgdt4ksgPAMWPyHSs/CyV48Q==", + "version": "16.4.3", + "resolved": "https://registry.npmjs.org/@next/env/-/env-16.4.3.tgz", + "integrity": "sha512-a7tz1QCcWWkwC/rPJcPMJk/UNRu9CFhDd3OHYE5hddbJrs8BqRTalxI6GlKCWEGzRLHN+S/B7a4PAHCtm25aBQ==", "license": "MIT" }, "node_modules/@next/eslint-plugin-next": { - "version": "16.3.4", - "resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-16.3.4.tgz", - "integrity": "sha512-szW9y2Aumu4z88YXfTzcFsgUAg2k64uzbtcO5L9f1AKS4w/GUKJcbFllRflROVyNPgJtGOnvNxiyp3v6b+prIA==", + "version": "16.3.8", + "resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-16.3.8.tgz", + "integrity": "sha512-eCR9RcLTZrVS+K3+VOhi0xMdUUGNuriCHHhU1ZoABC/QQ/Gp0OWbLKQxV2/9DkmihYdYRcQWFmZXW8M1AMUXYw==", "dev": true, "license": "MIT", "dependencies": { @@ -1744,9 +1794,9 @@ } }, "node_modules/@next/swc-darwin-arm64": { - "version": "16.3.4", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-16.3.4.tgz", - "integrity": "sha512-iBr3I5LZNk5/bgl5//iTgD2tcym14MX0Xo7fD//u9dYAEgGzza1y9oywluPtf74YnOswVdH1908aK9xVz7zQTw==", + "version": "16.4.3", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-16.4.3.tgz", + "integrity": "sha512-4yq5EXBt+VDtAZwTyfijaFp5D2C5oz3Ikw5a2kiX2K9nw72vrZX2q5UuAlkPtUMO1tQz6JTKpaKWjS7OOefTDQ==", "cpu": [ "arm64" ], @@ -1760,9 +1810,9 @@ } }, "node_modules/@next/swc-darwin-x64": { - "version": "16.3.4", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-16.3.4.tgz", - "integrity": "sha512-2dpiSyl2Jw/NrBPaU2MAKGSa+2MR82pJIn4Sm5Rjr+gxAeuh0z158Su3Z2O8zn7UNNq+ej4bToed6RcRN/Lydg==", + "version": "16.4.3", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-16.4.3.tgz", + "integrity": "sha512-1Rvkn/LUhnEF8WxnRkOrqGhbwXui1bkWFxONKIbN+r7C+9KHDSZ+iUoj4CzymVMWUyZIyx9szcb9+kbKhD500A==", "cpu": [ "x64" ], @@ -1776,12 +1826,15 @@ } }, "node_modules/@next/swc-linux-arm64-gnu": { - "version": "16.3.4", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-16.3.4.tgz", - "integrity": "sha512-+t+U8HZT+fApePCS5h89CSH3datz29MkzyfCn+6fpsZBG/oiEOhINcb9rtkv6sdpToLGFn2e6146NzaKCXkqrA==", + "version": "16.4.3", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-16.4.3.tgz", + "integrity": "sha512-dCKpXErGg3abUM6t5JTJV/ottVBTStJB5lRJTbgdUdQaQ+jNHiK56Hsc0YAEg/rinSh42hYG3HWiYmEMdilnxg==", "cpu": [ "arm64" ], + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -1792,12 +1845,15 @@ } }, "node_modules/@next/swc-linux-arm64-musl": { - "version": "16.3.4", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-16.3.4.tgz", - "integrity": "sha512-mx03GNs1ocQA5JQ4FxDMmIsNkdrZh8cuezKCrId28e5/gIPU/l7Kcy2+vmCCzdjnnmXJy+iOAu+7K0QppO6Urg==", + "version": "16.4.3", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-16.4.3.tgz", + "integrity": "sha512-WwYbhWkhYBvBtib1K4W0kL8MW2snBD2A5b3SN4vPpqalZbZs5+bQ1yzAdepVoOqrFfEW3dmREy4Zs1MrWcrFbw==", "cpu": [ "arm64" ], + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ @@ -1808,12 +1864,15 @@ } }, "node_modules/@next/swc-linux-x64-gnu": { - "version": "16.3.4", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-16.3.4.tgz", - "integrity": "sha512-YIhGY6fSMfha52bnVxnzc9zaVBzJg+cqQTOD8tXIBSx4fuv0pVMxQTE0PaS59YhnMOiYiG09IMwxJAf/CFm/Dw==", + "version": "16.4.3", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-16.4.3.tgz", + "integrity": "sha512-QymWvfUwDEC5/lpJOsxX5VAbyoR2D13+2Jsjz4be7gT4LPqEgdpkeLIR/HFfCLgKzoMhpJbp6I/JnogyNZHcaA==", "cpu": [ "x64" ], + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -1824,12 +1883,15 @@ } }, "node_modules/@next/swc-linux-x64-musl": { - "version": "16.3.4", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-16.3.4.tgz", - "integrity": "sha512-+eaaX6axpDb0yF1GCpiERe6njplvdC+nks/fKfcHu3XPGRrald8P3/X7yv7QLdjA51knnxwl9pxdIJsg+w1L+Q==", + "version": "16.4.3", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-16.4.3.tgz", + "integrity": "sha512-Vmjd9D7DpA4Vv3cUlr82QWgJD/BQZmns801vtC5VWHg6jCIA4a5vMKpQnfrM2pyCrp2eV0ENdUg4PlN3bAc2Yw==", "cpu": [ "x64" ], + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ @@ -1840,9 +1902,9 @@ } }, "node_modules/@next/swc-win32-arm64-msvc": { - "version": "16.3.4", - "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-16.3.4.tgz", - "integrity": "sha512-0jcXW7Xs/uzICrmgV3MhDYDeRy++1CqnpDIerlPIqYO4bhzB4WNbX/aRnQclustsAyTkFKB0z6rbcjmNg5tR8A==", + "version": "16.4.3", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-16.4.3.tgz", + "integrity": "sha512-lG1pPdPLk7gTyGb00n5JIMLdBJgjb+UEhSdZvFbhUMg0DyC6z4B7RnpSKF9VCd4imkLObVbXOFA0kFCpw7yFow==", "cpu": [ "arm64" ], @@ -1856,9 +1918,9 @@ } }, "node_modules/@next/swc-win32-x64-msvc": { - "version": "16.3.4", - "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-16.3.4.tgz", - "integrity": "sha512-vvBzwu1pYQCp92maZCFCIw/XgOTMR5tur9GjakwIo2cmwRTMKajRZZDS9+e4KsUZWKu1E007WUeAFXRRjZeuzw==", + "version": "16.4.3", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-16.4.3.tgz", + "integrity": "sha512-NmQC9RkJdnPXRaMxtkCzobB3teVjqF33oSOnwDfi+XYGWWYpt+xlGK3mtktSKLbdjwaWbJu2OkkMiRFGUUncKg==", "cpu": [ "x64" ], @@ -2005,7 +2067,6 @@ "integrity": "sha512-Efcc+iF0j3Bf67YjEqIqWXbX5XddXoK/Mw4K1/JuXwRCZ8N16VR7iT23nlCc9XrveFVh/E5Rqs2StT0V8v9LdA==", "dev": true, "license": "MIT", - "peer": true, "funding": { "url": "https://github.com/sponsors/oxc-project" } @@ -2216,9 +2277,9 @@ } }, "node_modules/@react-native/asset-utils": { - "version": "0.87.1", - "resolved": "https://registry.npmjs.org/@react-native/asset-utils/-/asset-utils-0.87.1.tgz", - "integrity": "sha512-FeFnbn9ENPs7IVBzZt1bBWfiRGvT4q+CsWwXGFyKVW/1ol3ylBRuTtXBGHIAmcNN4fUR60nSXsCN19pzNHkPgA==", + "version": "0.88.0", + "resolved": "https://registry.npmjs.org/@react-native/asset-utils/-/asset-utils-0.88.0.tgz", + "integrity": "sha512-Bj1DxQt5f4OrjdlgSVkZT37Z3hx5hUIN5AUDSqL/e99vgtTcqj5vnm067epZL1EF/QiqsniZO8Q1GSkItOakDg==", "license": "MIT", "peer": true, "engines": { @@ -2226,15 +2287,15 @@ } }, "node_modules/@react-native/codegen": { - "version": "0.87.1", - "resolved": "https://registry.npmjs.org/@react-native/codegen/-/codegen-0.87.1.tgz", - "integrity": "sha512-qbaqEdlUfj2vRgvWTpMoNgHnEqAhAYJLUrpGkb0WC9n0kdtqUvgigpz4bDktZwolM9BemXwgGFgyiAnbs3t0xw==", + "version": "0.88.0", + "resolved": "https://registry.npmjs.org/@react-native/codegen/-/codegen-0.88.0.tgz", + "integrity": "sha512-SAGg+XfzsrPiYTscbKa9bo2/H2ei2TjyxW8RTMq2Ps661kRK3AnmpMGVfrEFshEMr3FGEbuQIvj86X98kaXlRA==", "license": "MIT", "peer": true, "dependencies": { "@babel/core": "^7.25.2", "@babel/parser": "^7.29.0", - "hermes-parser": "0.36.1", + "flow-parser": "0.327.0", "invariant": "^2.2.4", "nullthrows": "^1.1.1", "tinyglobby": "^0.2.15", @@ -2247,35 +2308,19 @@ "@babel/core": "*" } }, - "node_modules/@react-native/codegen/node_modules/hermes-estree": { - "version": "0.36.1", - "resolved": "https://registry.npmjs.org/hermes-estree/-/hermes-estree-0.36.1.tgz", - "integrity": "sha512-guv1nQ6IJ7S83NRFPWc3SA7IBZrdNC9kapwOq6uXvF4wP+sDCgjzQbKPCoyYmoyZRzztF/n/c36l/rccCZSiCw==", - "license": "MIT", - "peer": true - }, - "node_modules/@react-native/codegen/node_modules/hermes-parser": { - "version": "0.36.1", - "resolved": "https://registry.npmjs.org/hermes-parser/-/hermes-parser-0.36.1.tgz", - "integrity": "sha512-GApNk4zLHi2UWoWZZkx7LNCOSzLSc5lB55pZ/PhK7ycFeg7u5LcF88p/WbpIi1XUDtE0MpHE3uRR3u3KB7TjSQ==", - "license": "MIT", - "peer": true, - "dependencies": { - "hermes-estree": "0.36.1" - } - }, "node_modules/@react-native/community-cli-plugin": { - "version": "0.87.1", - "resolved": "https://registry.npmjs.org/@react-native/community-cli-plugin/-/community-cli-plugin-0.87.1.tgz", - "integrity": "sha512-aGBae6v+ngy8fIpU1EOaVxn/8DOgmJNphEdn5Eb0wTchUCxr8bDjpTJYNdrptyn3qI/elk8r9agQ2OBaFvrRlw==", + "version": "0.88.0", + "resolved": "https://registry.npmjs.org/@react-native/community-cli-plugin/-/community-cli-plugin-0.88.0.tgz", + "integrity": "sha512-WrQdXbjVt1gwAay8ZzYtpOi9ly99ksJ0VMYFdVcMe6nq3vtiRgqKRpHgCdN6ySIbtr5o+aJ+Vr7OTDY98ec/Ow==", "license": "MIT", "peer": true, "dependencies": { - "@react-native/asset-utils": "0.87.1", - "@react-native/dev-middleware": "0.87.1", + "@react-native/asset-utils": "0.88.0", + "@react-native/dev-middleware": "0.88.0", + "commander": "^12.0.0", "debug": "^4.4.0", "invariant": "^2.2.4", - "metro": "^0.87.0", + "metro": "^0.87.1", "semver": "^7.1.3" }, "engines": { @@ -2283,7 +2328,7 @@ }, "peerDependencies": { "@react-native-community/cli": "*", - "@react-native/metro-config": "0.87.1" + "@react-native/metro-config": "0.88.0" }, "peerDependenciesMeta": { "@react-native-community/cli": { @@ -2295,9 +2340,9 @@ } }, "node_modules/@react-native/debugger-frontend": { - "version": "0.87.1", - "resolved": "https://registry.npmjs.org/@react-native/debugger-frontend/-/debugger-frontend-0.87.1.tgz", - "integrity": "sha512-RNm7soJB+8YSauLnsCCylA1eVfT6JWaDTPUEF01uu9YwDyZ7remKlZbXtmVbtscbNGcp+hbI4iZUdVOpQWsHuA==", + "version": "0.88.0", + "resolved": "https://registry.npmjs.org/@react-native/debugger-frontend/-/debugger-frontend-0.88.0.tgz", + "integrity": "sha512-v5cnBaaWhDRPcQv8EC20zj53jOAKH7u2wnzzXS4JTNu+diPC+cA2+kC7rq3eKI5vGhlAcG2kDPoViRuC0AY0oA==", "license": "BSD-3-Clause", "peer": true, "engines": { @@ -2305,9 +2350,9 @@ } }, "node_modules/@react-native/debugger-shell": { - "version": "0.87.1", - "resolved": "https://registry.npmjs.org/@react-native/debugger-shell/-/debugger-shell-0.87.1.tgz", - "integrity": "sha512-eNbKjcnseJIjy5XCDwyhKOT1ngOg3Dv1fVxTDtnVFqdqjqsbfY4v9JuJG1RZJ7+mFoRRe05HE8GSQU8B7n5xwQ==", + "version": "0.88.0", + "resolved": "https://registry.npmjs.org/@react-native/debugger-shell/-/debugger-shell-0.88.0.tgz", + "integrity": "sha512-p82zT8ZKNx7nIm/8zf8pi55sxm5KQBm8td47kzoJysTdqHLyPsRMUvDXtvCJIWadHSv7RJ6t/yiCc+IoImLBtw==", "license": "MIT", "peer": true, "dependencies": { @@ -2320,22 +2365,20 @@ } }, "node_modules/@react-native/dev-middleware": { - "version": "0.87.1", - "resolved": "https://registry.npmjs.org/@react-native/dev-middleware/-/dev-middleware-0.87.1.tgz", - "integrity": "sha512-KgvAGUaVl6/XrWFAPK8e0ojDRbsdBjr4bnwyn6PC3CwxPQc5iv+i7hMoUwYS8ORSkHKfjt+cV86/mBQ4lG8yfA==", + "version": "0.88.0", + "resolved": "https://registry.npmjs.org/@react-native/dev-middleware/-/dev-middleware-0.88.0.tgz", + "integrity": "sha512-sHLxVHOwfkF672ZzMepNh4d3IKbrZy3qXDKWSwN5LC5VJkzzZ5FdmSPP4N/CCn2pcKJ4oSqvojXwN4De3Xk92A==", "license": "MIT", "peer": true, "dependencies": { "@isaacs/ttlcache": "^1.4.1", - "@react-native/debugger-frontend": "0.87.1", - "@react-native/debugger-shell": "0.87.1", - "chrome-launcher": "^0.15.2", - "chromium-edge-launcher": "^0.3.0", + "@react-native/debugger-frontend": "0.88.0", + "@react-native/debugger-shell": "0.88.0", "connect": "^3.6.5", "debug": "^4.4.0", "invariant": "^2.2.4", "nullthrows": "^1.1.1", - "open": "^7.0.3", + "open": "^8.4.2", "serve-static": "^1.16.2", "ws": "^7.5.10" }, @@ -2343,21 +2386,6 @@ "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" } }, - "node_modules/@react-native/dev-middleware/node_modules/utf-8-validate": { - "version": "5.0.10", - "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.10.tgz", - "integrity": "sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==", - "hasInstallScript": true, - "license": "MIT", - "optional": true, - "peer": true, - "dependencies": { - "node-gyp-build": "^4.3.0" - }, - "engines": { - "node": ">=6.14.2" - } - }, "node_modules/@react-native/dev-middleware/node_modules/ws": { "version": "7.5.13", "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.13.tgz", @@ -2381,9 +2409,9 @@ } }, "node_modules/@react-native/gradle-plugin": { - "version": "0.87.1", - "resolved": "https://registry.npmjs.org/@react-native/gradle-plugin/-/gradle-plugin-0.87.1.tgz", - "integrity": "sha512-bZ5X2BNxaSlfp2KlDtUM910QqW9G1yTIeZXghuv4ag8SAQLzm5Mf9j5GjJfT6ax2Qo2aRT15Vi3Tro/yLGJstA==", + "version": "0.88.0", + "resolved": "https://registry.npmjs.org/@react-native/gradle-plugin/-/gradle-plugin-0.88.0.tgz", + "integrity": "sha512-4jPSKslOfJj8NKY/jv9qmWkxZYmqPyamoS3Vs0JOFxw9t4PM6L/ea0fUsjNV0LxC9zJlvWilPJOCTOf7h8wlyw==", "license": "MIT", "peer": true, "engines": { @@ -2391,16 +2419,16 @@ } }, "node_modules/@react-native/normalize-colors": { - "version": "0.87.1", - "resolved": "https://registry.npmjs.org/@react-native/normalize-colors/-/normalize-colors-0.87.1.tgz", - "integrity": "sha512-8+AutemzX+a7cuKgTUyb7JUk3sFYgLyrSnlTLrL6LuW/LKDE+FYE8lJGWYhJPJcE51Ge1D8yRzxgQEdEFZtuIw==", + "version": "0.88.0", + "resolved": "https://registry.npmjs.org/@react-native/normalize-colors/-/normalize-colors-0.88.0.tgz", + "integrity": "sha512-eZCu3tGAQCfvMCPQJVY4dmoMX8ZZYBvqIGHX7lwOYyzNK+Dl8e5ky7ZoXub1Rq75oSrQXNNmSP2CDjNNXXZpFQ==", "license": "MIT", "peer": true }, "node_modules/@react-native/virtualized-lists": { - "version": "0.87.1", - "resolved": "https://registry.npmjs.org/@react-native/virtualized-lists/-/virtualized-lists-0.87.1.tgz", - "integrity": "sha512-qSZjeX3UJrDvyfjf7yc3E68rp1XnzE+5nu8ImklhkVC0+p/XiaHPb/KGkRqDdnQyWHN55BRYSsCMEwgVI6WRNQ==", + "version": "0.88.0", + "resolved": "https://registry.npmjs.org/@react-native/virtualized-lists/-/virtualized-lists-0.88.0.tgz", + "integrity": "sha512-zpZIOAbobdS93edwHkNUdGDzvElNeQJqukRERRPns3/ucPvuMd2G4fYpmVJSVjhxtGCcLLB1PFndLYYfwaYoBQ==", "license": "MIT", "peer": true, "dependencies": { @@ -2413,7 +2441,7 @@ "peerDependencies": { "@types/react": "^19.2.0", "react": "*", - "react-native": "0.87.1" + "react-native": "0.88.0" }, "peerDependenciesMeta": { "@types/react": { @@ -2434,7 +2462,6 @@ "os": [ "android" ], - "peer": true, "engines": { "node": "^20.19.0 || >=22.12.0" } @@ -2452,7 +2479,6 @@ "os": [ "android" ], - "peer": true, "engines": { "node": "^20.19.0 || >=22.12.0" } @@ -2470,7 +2496,6 @@ "os": [ "darwin" ], - "peer": true, "engines": { "node": "^20.19.0 || >=22.12.0" } @@ -2488,7 +2513,6 @@ "os": [ "darwin" ], - "peer": true, "engines": { "node": "^20.19.0 || >=22.12.0" } @@ -2506,7 +2530,6 @@ "os": [ "freebsd" ], - "peer": true, "engines": { "node": "^20.19.0 || >=22.12.0" } @@ -2524,7 +2547,6 @@ "os": [ "linux" ], - "peer": true, "engines": { "node": "^20.19.0 || >=22.12.0" } @@ -2542,7 +2564,6 @@ "os": [ "linux" ], - "peer": true, "engines": { "node": "^20.19.0 || >=22.12.0" } @@ -2560,7 +2581,6 @@ "os": [ "linux" ], - "peer": true, "engines": { "node": "^20.19.0 || >=22.12.0" } @@ -2578,7 +2598,6 @@ "os": [ "linux" ], - "peer": true, "engines": { "node": "^20.19.0 || >=22.12.0" } @@ -2596,7 +2615,6 @@ "os": [ "linux" ], - "peer": true, "engines": { "node": "^20.19.0 || >=22.12.0" } @@ -2614,7 +2632,6 @@ "os": [ "linux" ], - "peer": true, "engines": { "node": "^20.19.0 || >=22.12.0" } @@ -2632,7 +2649,6 @@ "os": [ "linux" ], - "peer": true, "engines": { "node": "^20.19.0 || >=22.12.0" } @@ -2650,7 +2666,6 @@ "os": [ "openharmony" ], - "peer": true, "engines": { "node": "^20.19.0 || >=22.12.0" } @@ -2668,7 +2683,6 @@ "os": [ "win32" ], - "peer": true, "engines": { "node": "^20.19.0 || >=22.12.0" } @@ -2686,7 +2700,6 @@ "os": [ "win32" ], - "peer": true, "engines": { "node": "^20.19.0 || >=22.12.0" } @@ -2696,8 +2709,7 @@ "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz", "integrity": "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/@rtsao/scc": { "version": "1.1.0", @@ -10207,9 +10219,9 @@ } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { - "version": "5.0.9", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.9.tgz", - "integrity": "sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg==", + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz", + "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", "dev": true, "license": "MIT", "dependencies": { @@ -11886,22 +11898,22 @@ } }, "node_modules/@vitest/mocker": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-5.0.0.tgz", - "integrity": "sha512-66PGTMIiVJP3t4a5yxU9qPtf7MdTBs8jmToMvy+HVflB3Yy13WJZTtPePdvU+wjRV02SKK5doLbSA6o9pwOmiA==", + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-5.0.5.tgz", + "integrity": "sha512-xLL3lkDegJZw+MGoGaCCsFayDZthGgpAtr3Vziyfc4p7xH89K7KRPcRBBh/kEYm0Aqkt5DtTmkYpBtRV/FrHZg==", "dev": true, "license": "MIT", "dependencies": { "@jridgewell/trace-mapping": "0.3.31", - "@vitest/spy": "5.0.0", + "@vitest/spy": "5.0.5", "estree-walker": "^3.0.3", - "magic-string": "^1.2.3" + "magic-string": "^1.4.3" }, "funding": { "url": "https://opencollective.com/vitest" }, "peerDependencies": { - "msw": "^2.4.9", + "msw": "^2.4.9 || ^3.0.0", "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" }, "peerDependenciesMeta": { @@ -11914,9 +11926,9 @@ } }, "node_modules/@vitest/spy": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-5.0.0.tgz", - "integrity": "sha512-uy+luWBAPw9XfthoHi5AkfHUnuPYEESjl0p/r+meoBnU8bxg5GDQ3Ey8MjcJ6sqahkL4PFyrvfMJJBw7LbU06g==", + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-5.0.5.tgz", + "integrity": "sha512-lwJRExuH417257Q5wv9QYugN9IMJkoxcrKrYxGPQkBzl7wlNpTUxD/5yNX4ESKVUIShKPgkGchYPFMWOOk0wzw==", "dev": true, "license": "MIT", "funding": { @@ -12476,33 +12488,6 @@ "node": ">= 0.4" } }, - "node_modules/babel-plugin-syntax-hermes-parser": { - "version": "0.36.1", - "resolved": "https://registry.npmjs.org/babel-plugin-syntax-hermes-parser/-/babel-plugin-syntax-hermes-parser-0.36.1.tgz", - "integrity": "sha512-ycduwJbvdvIMmVvlAZqGggS+pm5Eu4Bk9pcV9Sm2Z4PJNRVsKkv0g7vHj+LeuC1gHTeF67sJXFOq61IlqCa2hA==", - "license": "MIT", - "peer": true, - "dependencies": { - "hermes-parser": "0.36.1" - } - }, - "node_modules/babel-plugin-syntax-hermes-parser/node_modules/hermes-estree": { - "version": "0.36.1", - "resolved": "https://registry.npmjs.org/hermes-estree/-/hermes-estree-0.36.1.tgz", - "integrity": "sha512-guv1nQ6IJ7S83NRFPWc3SA7IBZrdNC9kapwOq6uXvF4wP+sDCgjzQbKPCoyYmoyZRzztF/n/c36l/rccCZSiCw==", - "license": "MIT", - "peer": true - }, - "node_modules/babel-plugin-syntax-hermes-parser/node_modules/hermes-parser": { - "version": "0.36.1", - "resolved": "https://registry.npmjs.org/hermes-parser/-/hermes-parser-0.36.1.tgz", - "integrity": "sha512-GApNk4zLHi2UWoWZZkx7LNCOSzLSc5lB55pZ/PhK7ycFeg7u5LcF88p/WbpIi1XUDtE0MpHE3uRR3u3KB7TjSQ==", - "license": "MIT", - "peer": true, - "dependencies": { - "hermes-estree": "0.36.1" - } - }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -12591,9 +12576,9 @@ } }, "node_modules/brace-expansion": { - "version": "1.1.18", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.18.tgz", - "integrity": "sha512-Edep/X9fGqVNmzKBVsDYIOtD+z1tuezV70LBjdCst9Tqu76lsnvRiZ6oTic1n+/BIwX6QDGAO94PN4N2SADvtw==", + "version": "1.1.21", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.21.tgz", + "integrity": "sha512-9zeA+KLZNNzglF2TPKRQEDyx6Yby7daAkuy8MiPzpXPsYDWi/DRM8jmwUDxokQjYqBpv5DgPiwD4h4ZZSy1Ujw==", "dev": true, "license": "MIT", "dependencies": { @@ -12656,10 +12641,10 @@ } }, "node_modules/bser": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", - "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==", - "license": "Apache-2.0", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.2.tgz", + "integrity": "sha512-V2o8YS2EhrKMO9AumnkK0ynynfFlsajpYupwq7S46H5mhcanwxDkNTw3K67wPIcKTH1ffkA4vhMOtAc7gRmPZw==", + "license": "MIT", "peer": true, "dependencies": { "node-int64": "^0.4.0" @@ -12809,9 +12794,9 @@ "license": "CC-BY-4.0" }, "node_modules/chai": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/chai/-/chai-6.2.2.tgz", - "integrity": "sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-6.3.0.tgz", + "integrity": "sha512-XWAtwJ6OHO+tj0EKCs0Y2UamnyOxseZWltU4x2U2wh8g4AigdjwvtUjvLP2tqkA/avxHEtzxNaqGq/YGNwckKg==", "dev": true, "license": "MIT", "engines": { @@ -12830,39 +12815,6 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/chrome-launcher": { - "version": "0.15.2", - "resolved": "https://registry.npmjs.org/chrome-launcher/-/chrome-launcher-0.15.2.tgz", - "integrity": "sha512-zdLEwNo3aUVzIhKhTtXfxhdvZhUghrnmkvcAq2NoDd+LeOHKf03H5jwZ8T/STsAlzyALkBVK552iaG1fGf1xVQ==", - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@types/node": "*", - "escape-string-regexp": "^4.0.0", - "is-wsl": "^2.2.0", - "lighthouse-logger": "^1.0.0" - }, - "bin": { - "print-chrome-path": "bin/print-chrome-path.js" - }, - "engines": { - "node": ">=12.13.0" - } - }, - "node_modules/chromium-edge-launcher": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/chromium-edge-launcher/-/chromium-edge-launcher-0.3.0.tgz", - "integrity": "sha512-p03azHlGjtyRvFEee3cyvtsRYdniSkwjkzmM/KmVnqT5d7QkkwpJBhis/zCLMYdQMVJ5tt140TBNqqrZPaWeFA==", - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@types/node": "*", - "escape-string-regexp": "^4.0.0", - "is-wsl": "^2.2.0", - "lighthouse-logger": "^1.0.0", - "mkdirp": "^1.0.4" - } - }, "node_modules/ci-info": { "version": "3.9.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", @@ -13166,6 +13118,16 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/define-lazy-prop": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", + "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, "node_modules/define-properties": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", @@ -13564,6 +13526,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, "license": "MIT", "engines": { "node": ">=10" @@ -13634,13 +13597,13 @@ } }, "node_modules/eslint-config-next": { - "version": "16.3.4", - "resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-16.3.4.tgz", - "integrity": "sha512-35/8RM10huEL9vlr8hUZMERMENHBrnyHN3ZZkF9efSgzGaqK34jIqry44A956//zriUhUAUW0XSkcolhrryqAA==", + "version": "16.3.8", + "resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-16.3.8.tgz", + "integrity": "sha512-81vovwMe6NGnoFsl0KUJWzlS+y239i3fdsxs49gSEX3pDQW2cuKy+fxUPXNkQqqx6OCPheYPtBlSufc9aZ0k+w==", "dev": true, "license": "MIT", "dependencies": { - "@next/eslint-plugin-next": "16.3.4", + "@next/eslint-plugin-next": "16.3.8", "eslint-import-resolver-node": "^0.3.6", "eslint-import-resolver-typescript": "^3.5.2", "eslint-plugin-import": "^2.32.0", @@ -14155,13 +14118,13 @@ } }, "node_modules/fb-watchman": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", - "integrity": "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==", - "license": "Apache-2.0", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.4.tgz", + "integrity": "sha512-tGQtaoYisPDriJBN0mT5yZSyNETnJGA1gTYxaVRAE5KUO3LI9kPUc9WIu8JXcxaIci+faIKlzXqXyPgrmubtBQ==", + "license": "MIT", "peer": true, "dependencies": { - "bser": "2.1.1" + "bser": "2.1.2" } }, "node_modules/file-entry-cache": { @@ -14310,9 +14273,9 @@ "peer": true }, "node_modules/flow-estree": { - "version": "0.331.0", - "resolved": "https://registry.npmjs.org/flow-estree/-/flow-estree-0.331.0.tgz", - "integrity": "sha512-FVLYkSL/ITb/QXBEQvNWPjPooRGswuUtGOwrH+puSlMDneNkxy640+FZsk/TfKL+b7Wbw/Fg9FTUv2bMQDpj2w==", + "version": "0.327.0", + "resolved": "https://registry.npmjs.org/flow-estree/-/flow-estree-0.327.0.tgz", + "integrity": "sha512-f9vK751YUzD0qaHSpKc5/qQM6gqOlgGS+4ZRqTNcZOpVqn3mC55yEQ6dUG2K1eaVm5FbKkz9CFWe6XNvrkQFQg==", "license": "MIT", "peer": true, "engines": { @@ -14320,22 +14283,22 @@ } }, "node_modules/flow-parser": { - "version": "0.331.0", - "resolved": "https://registry.npmjs.org/flow-parser/-/flow-parser-0.331.0.tgz", - "integrity": "sha512-vEZcHIlnKeN8JSVtYFczj8sWJfHIJOkz+YG00O/oul/Bete+t1ZhTi+O6JRRLFYvGW+yJkZ0YgL16iStnbkUqQ==", + "version": "0.327.0", + "resolved": "https://registry.npmjs.org/flow-parser/-/flow-parser-0.327.0.tgz", + "integrity": "sha512-/MYZ5hXWf5ozpbdfUDmazMgQXviLxWEiRLH3MppEGDdW0itRVqmB5UaU7QX+SBCDNiq+gEesSVn8nlxmPDyDkw==", "license": "MIT", "peer": true, "dependencies": { - "flow-estree": "0.331.0" + "flow-estree": "0.327.0" }, "engines": { "node": ">=0.4.0" } }, "node_modules/follow-redirects": { - "version": "1.16.0", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.16.0.tgz", - "integrity": "sha512-y5rN/uOsadFT/JfYwhxRS5R7Qce+g3zG97+JrtFZlC9klX/W5hD7iiLzScI4nZqUS7DNUdhPgw4xI8W2LuXlUw==", + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.16.1.tgz", + "integrity": "sha512-FNvFGzoMLWmE6Yj9spb/zjd7yiNCHiAW9/Tg9CXrQ8wuu32HtlJOwWO11OJafl5FfY3DxTdQ0vj42zU1kvv5jg==", "funding": [ { "type": "individual", @@ -14976,9 +14939,9 @@ ] }, "node_modules/hermes-compiler": { - "version": "250829098.0.17", - "resolved": "https://registry.npmjs.org/hermes-compiler/-/hermes-compiler-250829098.0.17.tgz", - "integrity": "sha512-qG1PXzTEtriF6oQLZF3vyHhSMxOdW5h2TqqLri0rdpstPustd2fSvRZQMVAPdlhgFwBfYnj3OUZtiO6LjYsEFw==", + "version": "260318099.0.4", + "resolved": "https://registry.npmjs.org/hermes-compiler/-/hermes-compiler-260318099.0.4.tgz", + "integrity": "sha512-8odcPFkPC82HlqCl0C5QI9mBN4rEAT+IAo55sJhzwKw//K3qZloiv3ex6J2O8CuBbhdmkJozfidNsset2KH25w==", "license": "MIT", "peer": true }, @@ -15729,21 +15692,6 @@ "ws": "*" } }, - "node_modules/jayson/node_modules/utf-8-validate": { - "version": "5.0.10", - "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.10.tgz", - "integrity": "sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==", - "hasInstallScript": true, - "license": "MIT", - "optional": true, - "peer": true, - "dependencies": { - "node-gyp-build": "^4.3.0" - }, - "engines": { - "node": ">=6.14.2" - } - }, "node_modules/jayson/node_modules/ws": { "version": "7.5.13", "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.13.tgz", @@ -16049,34 +15997,6 @@ "node": ">= 0.8.0" } }, - "node_modules/lighthouse-logger": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/lighthouse-logger/-/lighthouse-logger-1.4.2.tgz", - "integrity": "sha512-gPWxznF6TKmUHrOQjlVo2UbaL2EJ71mb2CCeRs/2qBpi4L/g4LUVc9+3lKQ6DTUZwJswfM7ainGrLO1+fOqa2g==", - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "debug": "^2.6.9", - "marky": "^1.2.2" - } - }, - "node_modules/lighthouse-logger/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "license": "MIT", - "peer": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/lighthouse-logger/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "license": "MIT", - "peer": true - }, "node_modules/lightningcss": { "version": "1.33.0", "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.33.0.tgz", @@ -16226,6 +16146,9 @@ "arm64" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MPL-2.0", "optional": true, "os": [ @@ -16248,6 +16171,9 @@ "arm64" ], "dev": true, + "libc": [ + "musl" + ], "license": "MPL-2.0", "optional": true, "os": [ @@ -16270,6 +16196,9 @@ "x64" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MPL-2.0", "optional": true, "os": [ @@ -16292,6 +16221,9 @@ "x64" ], "dev": true, + "libc": [ + "musl" + ], "license": "MPL-2.0", "optional": true, "os": [ @@ -16437,22 +16369,15 @@ "optional": true }, "node_modules/magic-string": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-1.3.1.tgz", - "integrity": "sha512-rm91zr2Ou+XueDTohjQQjdQEcYM6zVi8KVUCG8Ec3vHwUEKrhSdCNyfuIywkA6hcCAteIn0ZOtAHA6eGpiX+Pg==", + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-1.4.3.tgz", + "integrity": "sha512-z12OxmaPGE0F4xlpGdjuAUckipLpQlTAuAmyGhNoD7ODpYUzvDfvtxUbjM/jwznyP178oju/KDdyi220wNJ0RQ==", "dev": true, "license": "MIT", "dependencies": { "@jridgewell/sourcemap-codec": "^1.6.0" } }, - "node_modules/marky": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/marky/-/marky-1.3.0.tgz", - "integrity": "sha512-ocnPZQLNpvbedwTy9kNrQEsknEfgvcLMvOtz3sFeWApDq1MXH1TqkCIx58xlpESsfwQOnuBO9beyQuNGzVvuhQ==", - "license": "Apache-2.0", - "peer": true - }, "node_modules/math-intrinsics": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", @@ -16568,6 +16493,29 @@ "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" } }, + "node_modules/metro-babel-transformer/node_modules/flow-estree": { + "version": "0.331.0", + "resolved": "https://registry.npmjs.org/flow-estree/-/flow-estree-0.331.0.tgz", + "integrity": "sha512-FVLYkSL/ITb/QXBEQvNWPjPooRGswuUtGOwrH+puSlMDneNkxy640+FZsk/TfKL+b7Wbw/Fg9FTUv2bMQDpj2w==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=18" + } + }, + "node_modules/metro-babel-transformer/node_modules/flow-parser": { + "version": "0.331.0", + "resolved": "https://registry.npmjs.org/flow-parser/-/flow-parser-0.331.0.tgz", + "integrity": "sha512-vEZcHIlnKeN8JSVtYFczj8sWJfHIJOkz+YG00O/oul/Bete+t1ZhTi+O6JRRLFYvGW+yJkZ0YgL16iStnbkUqQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "flow-estree": "0.331.0" + }, + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/metro-cache": { "version": "0.87.1", "resolved": "https://registry.npmjs.org/metro-cache/-/metro-cache-0.87.1.tgz", @@ -16801,6 +16749,29 @@ "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" } }, + "node_modules/metro/node_modules/flow-estree": { + "version": "0.331.0", + "resolved": "https://registry.npmjs.org/flow-estree/-/flow-estree-0.331.0.tgz", + "integrity": "sha512-FVLYkSL/ITb/QXBEQvNWPjPooRGswuUtGOwrH+puSlMDneNkxy640+FZsk/TfKL+b7Wbw/Fg9FTUv2bMQDpj2w==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=18" + } + }, + "node_modules/metro/node_modules/flow-parser": { + "version": "0.331.0", + "resolved": "https://registry.npmjs.org/flow-parser/-/flow-parser-0.331.0.tgz", + "integrity": "sha512-vEZcHIlnKeN8JSVtYFczj8sWJfHIJOkz+YG00O/oul/Bete+t1ZhTi+O6JRRLFYvGW+yJkZ0YgL16iStnbkUqQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "flow-estree": "0.331.0" + }, + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/metro/node_modules/mime-db": { "version": "1.54.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", @@ -16828,21 +16799,6 @@ "url": "https://opencollective.com/express" } }, - "node_modules/metro/node_modules/utf-8-validate": { - "version": "5.0.10", - "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.10.tgz", - "integrity": "sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==", - "hasInstallScript": true, - "license": "MIT", - "optional": true, - "peer": true, - "dependencies": { - "node-gyp-build": "^4.3.0" - }, - "engines": { - "node": ">=6.14.2" - } - }, "node_modules/metro/node_modules/ws": { "version": "7.5.13", "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.13.tgz", @@ -16935,19 +16891,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "license": "MIT", - "peer": true, - "bin": { - "mkdirp": "bin/cmd.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -17013,12 +16956,12 @@ } }, "node_modules/next": { - "version": "16.3.4", - "resolved": "https://registry.npmjs.org/next/-/next-16.3.4.tgz", - "integrity": "sha512-/Ztf6CeRH+ejEXUrYtqI4gkS66eFIHuSwqi60RgcpWKodxFZx2/dqVCMKBwILfAHXQ+F1b1vAudgj3mnxqtoIA==", + "version": "16.4.3", + "resolved": "https://registry.npmjs.org/next/-/next-16.4.3.tgz", + "integrity": "sha512-OqxKTGi9u80FydydsMNYNjnuje9Au+kvHlt2GZ//ftdpDHm1dxKqAaENoOOTX5wKzn+9vaKUNIfZeyZUuLhCnA==", "license": "MIT", "dependencies": { - "@next/env": "16.3.4", + "@next/env": "16.4.3", "@swc/helpers": "0.5.23", "baseline-browser-mapping": "^2.9.19", "caniuse-lite": "^1.0.30001579", @@ -17032,15 +16975,15 @@ "node": ">=20.9.0" }, "optionalDependencies": { - "@next/swc-darwin-arm64": "16.3.4", - "@next/swc-darwin-x64": "16.3.4", - "@next/swc-linux-arm64-gnu": "16.3.4", - "@next/swc-linux-arm64-musl": "16.3.4", - "@next/swc-linux-x64-gnu": "16.3.4", - "@next/swc-linux-x64-musl": "16.3.4", - "@next/swc-win32-arm64-msvc": "16.3.4", - "@next/swc-win32-x64-msvc": "16.3.4", - "sharp": "^0.35.4" + "@next/swc-darwin-arm64": "16.4.3", + "@next/swc-darwin-x64": "16.4.3", + "@next/swc-linux-arm64-gnu": "16.4.3", + "@next/swc-linux-arm64-musl": "16.4.3", + "@next/swc-linux-x64-gnu": "16.4.3", + "@next/swc-linux-x64-musl": "16.4.3", + "@next/swc-win32-arm64-msvc": "16.4.3", + "@next/swc-win32-x64-msvc": "16.4.3", + "sharp": "^0.35.5" }, "peerDependencies": { "@opentelemetry/api": "^1.1.0", @@ -17322,9 +17265,9 @@ } }, "node_modules/obug": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/obug/-/obug-2.2.1.tgz", - "integrity": "sha512-XrsrhT5sybtKI6wakr2SPOlGZWWYbUXZ7a0jT8/QOeAPau+1X/bSegNe5YR75oJmEZQbKningirmGOEJCIk61Q==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/obug/-/obug-3.0.0.tgz", + "integrity": "sha512-5vvB5+W7ePv+p3uqxi+RcW1XAzLW0/hxt3/4X4Lc4qHudzOhmBiBwOY6DRob4WnanAEGvNcLjF+KNOufrUoEQw==", "dev": true, "funding": [ "https://github.com/sponsors/sxzz", @@ -17349,17 +17292,18 @@ } }, "node_modules/open": { - "version": "7.4.2", - "resolved": "https://registry.npmjs.org/open/-/open-7.4.2.tgz", - "integrity": "sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==", + "version": "8.4.2", + "resolved": "https://registry.npmjs.org/open/-/open-8.4.2.tgz", + "integrity": "sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==", "license": "MIT", "peer": true, "dependencies": { - "is-docker": "^2.0.0", - "is-wsl": "^2.1.1" + "define-lazy-prop": "^2.0.0", + "is-docker": "^2.1.1", + "is-wsl": "^2.2.0" }, "engines": { - "node": ">=8" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -17919,21 +17863,6 @@ "ws": "^7" } }, - "node_modules/react-devtools-core/node_modules/utf-8-validate": { - "version": "5.0.10", - "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.10.tgz", - "integrity": "sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==", - "hasInstallScript": true, - "license": "MIT", - "optional": true, - "peer": true, - "dependencies": { - "node-gyp-build": "^4.3.0" - }, - "engines": { - "node": ">=6.14.2" - } - }, "node_modules/react-devtools-core/node_modules/ws": { "version": "7.5.13", "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.13.tgz", @@ -17976,36 +17905,35 @@ "license": "MIT" }, "node_modules/react-native": { - "version": "0.87.1", - "resolved": "https://registry.npmjs.org/react-native/-/react-native-0.87.1.tgz", - "integrity": "sha512-DJKG6ANoD7BtrE4z9DewiSD7/RxCX73lK5Pu49aUr85P3333Dm2roTiP0rRjQNDZdVizHSOmstWfwF/o9EjCRA==", + "version": "0.88.0", + "resolved": "https://registry.npmjs.org/react-native/-/react-native-0.88.0.tgz", + "integrity": "sha512-v/wee0nYWcammMYBnSat/e3WY/5iaf9YQOMcBrfKT/wPApPPlHp94hgZovBtwhMuthR01yc/8cGn0FpFTE/C4A==", "license": "MIT", "peer": true, "dependencies": { - "@react-native/asset-utils": "0.87.1", - "@react-native/codegen": "0.87.1", - "@react-native/community-cli-plugin": "0.87.1", - "@react-native/gradle-plugin": "0.87.1", - "@react-native/normalize-colors": "0.87.1", - "@react-native/virtualized-lists": "0.87.1", + "@react-native/asset-utils": "0.88.0", + "@react-native/codegen": "0.88.0", + "@react-native/community-cli-plugin": "0.88.0", + "@react-native/gradle-plugin": "0.88.0", + "@react-native/normalize-colors": "0.88.0", + "@react-native/virtualized-lists": "0.88.0", "anser": "^1.4.9", "ansi-regex": "^5.0.0", - "babel-plugin-syntax-hermes-parser": "0.36.1", "base64-js": "^1.5.1", - "commander": "^12.0.0", "flow-enums-runtime": "^0.0.6", - "hermes-compiler": "250829098.0.17", + "flow-parser": "0.327.0", + "hermes-compiler": "260318099.0.4", "invariant": "^2.2.4", "memoize-one": "^5.0.0", - "metro-runtime": "^0.87.0", - "metro-source-map": "^0.87.0", + "metro-runtime": "^0.87.1", + "metro-source-map": "^0.87.1", "nullthrows": "^1.1.1", "pretty-format": "^29.7.0", "promise": "^8.3.0", "react-devtools-core": "^6.1.5", "react-refresh": "^0.14.0", "regenerator-runtime": "^0.13.2", - "scheduler": "0.27.0", + "scheduler": "0.28.0", "semver": "^7.1.3", "stacktrace-parser": "^0.1.10", "tinyglobby": "^0.2.15", @@ -18021,7 +17949,7 @@ }, "peerDependencies": { "@types/react": "^19.1.1", - "react": "^19.2.3" + "react": "^19.3.0" }, "peerDependenciesMeta": { "@types/react": { @@ -18029,28 +17957,6 @@ } } }, - "node_modules/react-native/node_modules/scheduler": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.27.0.tgz", - "integrity": "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==", - "license": "MIT", - "peer": true - }, - "node_modules/react-native/node_modules/utf-8-validate": { - "version": "5.0.10", - "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.10.tgz", - "integrity": "sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==", - "hasInstallScript": true, - "license": "MIT", - "optional": true, - "peer": true, - "dependencies": { - "node-gyp-build": "^4.3.0" - }, - "engines": { - "node": ">=6.14.2" - } - }, "node_modules/react-native/node_modules/ws": { "version": "7.5.13", "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.13.tgz", @@ -18210,7 +18116,6 @@ "integrity": "sha512-Z67nTmhZe7anqnM/EjI392w5i/ANUinjip7QYsOyN37oayduxt3ksdX0hf5OOamkAd53BiIHfbfSzfUmzKFQqQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@oxc-project/types": "=0.149.0", "@rolldown/pluginutils": "^1.0.0" @@ -18572,11 +18477,11 @@ "peer": true }, "node_modules/sharp": { - "version": "0.35.4", - "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.35.4.tgz", - "integrity": "sha512-n++8XWcj+jCOr2IOl7h8LbKnGBDY4aPbmprMONBNFdn0ImXqpGVv5zliDs0V9HbmbCQLpbuo2ej9rAoOQTvMDA==", + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.35.5.tgz", + "integrity": "sha512-Ywn4OnzGukp7CDMrp08RQ50YKmuwG47brZgIVPTvBaaAfQlRlygrRqSrxdCiL9M+LlzLBiJ68IR1QqvzHyjC7g==", + "devOptional": true, "license": "Apache-2.0", - "optional": true, "dependencies": { "@img/colour": "^1.1.0", "detect-libc": "^2.1.2", @@ -18589,31 +18494,31 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-darwin-arm64": "0.35.4", - "@img/sharp-darwin-x64": "0.35.4", - "@img/sharp-freebsd-wasm32": "0.35.4", - "@img/sharp-libvips-darwin-arm64": "1.3.3", - "@img/sharp-libvips-darwin-x64": "1.3.3", - "@img/sharp-libvips-linux-arm": "1.3.3", - "@img/sharp-libvips-linux-arm64": "1.3.3", - "@img/sharp-libvips-linux-ppc64": "1.3.3", - "@img/sharp-libvips-linux-riscv64": "1.3.3", - "@img/sharp-libvips-linux-s390x": "1.3.3", - "@img/sharp-libvips-linux-x64": "1.3.3", - "@img/sharp-libvips-linuxmusl-arm64": "1.3.3", - "@img/sharp-libvips-linuxmusl-x64": "1.3.3", - "@img/sharp-linux-arm": "0.35.4", - "@img/sharp-linux-arm64": "0.35.4", - "@img/sharp-linux-ppc64": "0.35.4", - "@img/sharp-linux-riscv64": "0.35.4", - "@img/sharp-linux-s390x": "0.35.4", - "@img/sharp-linux-x64": "0.35.4", - "@img/sharp-linuxmusl-arm64": "0.35.4", - "@img/sharp-linuxmusl-x64": "0.35.4", - "@img/sharp-webcontainers-wasm32": "0.35.4", - "@img/sharp-win32-arm64": "0.35.4", - "@img/sharp-win32-ia32": "0.35.4", - "@img/sharp-win32-x64": "0.35.4" + "@img/sharp-darwin-arm64": "0.35.5", + "@img/sharp-darwin-x64": "0.35.5", + "@img/sharp-freebsd-wasm32": "0.35.5", + "@img/sharp-libvips-darwin-arm64": "1.3.4", + "@img/sharp-libvips-darwin-x64": "1.3.4", + "@img/sharp-libvips-linux-arm": "1.3.4", + "@img/sharp-libvips-linux-arm64": "1.3.4", + "@img/sharp-libvips-linux-ppc64": "1.3.4", + "@img/sharp-libvips-linux-riscv64": "1.3.4", + "@img/sharp-libvips-linux-s390x": "1.3.4", + "@img/sharp-libvips-linux-x64": "1.3.4", + "@img/sharp-libvips-linuxmusl-arm64": "1.3.4", + "@img/sharp-libvips-linuxmusl-x64": "1.3.4", + "@img/sharp-linux-arm": "0.35.5", + "@img/sharp-linux-arm64": "0.35.5", + "@img/sharp-linux-ppc64": "0.35.5", + "@img/sharp-linux-riscv64": "0.35.5", + "@img/sharp-linux-s390x": "0.35.5", + "@img/sharp-linux-x64": "0.35.5", + "@img/sharp-linuxmusl-arm64": "0.35.5", + "@img/sharp-linuxmusl-x64": "0.35.5", + "@img/sharp-webcontainers-wasm32": "0.35.5", + "@img/sharp-win32-arm64": "0.35.5", + "@img/sharp-win32-ia32": "0.35.5", + "@img/sharp-win32-x64": "0.35.5" }, "peerDependenciesMeta": { "@types/node": { @@ -18643,9 +18548,9 @@ } }, "node_modules/shell-quote": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.10.0.tgz", - "integrity": "sha512-w1aiOKwKuRgtwAReIIj89puqg+I7GvX4IbLrvmhXbzQsj1+Zwi4VO3+fa6ZF91TWSjIxoEkKnMeHcLEODK5ZXA==", + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.12.0.tgz", + "integrity": "sha512-PcByqNyT/38F2kDNi006HAMRJaULuBzq/FOsw3qdZvX/GA9W/jamDaRskgHjubHiftXK5sIFxLNkvrXUwcof6Q==", "license": "MIT", "peer": true, "engines": { @@ -18731,13 +18636,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/siginfo": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", - "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", - "dev": true, - "license": "ISC" - }, "node_modules/snake-case": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/snake-case/-/snake-case-3.0.4.tgz", @@ -18862,9 +18760,9 @@ } }, "node_modules/source-map-js": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", - "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.2.tgz", + "integrity": "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==", "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" @@ -18908,13 +18806,6 @@ "dev": true, "license": "MIT" }, - "node_modules/stackback": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", - "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", - "dev": true, - "license": "MIT" - }, "node_modules/stackframe": { "version": "1.3.4", "resolved": "https://registry.npmjs.org/stackframe/-/stackframe-1.3.4.tgz", @@ -18946,9 +18837,9 @@ } }, "node_modules/std-env": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/std-env/-/std-env-4.2.0.tgz", - "integrity": "sha512-oCUKSupKTHX53EyjDtuZQ64pjLJ6yYCtpmEw0goYxtjG9KpbRe8KAsl2tBUGU9DyMcJ0RwJ8GqJAFzMXcXW1Rw==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-4.3.0.tgz", + "integrity": "sha512-OtU/EgQ1kIm5KwqQpBC6ZEMXrZRui11w8zgfTWp8cdO9B8OaPsbA8bTHO2P+HNo1VlUTGMVBwPhydu6poeXiag==", "dev": true, "license": "MIT" }, @@ -19255,9 +19146,9 @@ "peer": true }, "node_modules/tinybench": { - "version": "6.1.4", - "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-6.1.4.tgz", - "integrity": "sha512-9APumHG7r4yOk4X4WlkmE71aZcv1gvin1czO3OQ1U9iJcFA5Ja/ygyb0vPOVHTthFozUYs8CLoLUlM8grb2lTQ==", + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-6.2.2.tgz", + "integrity": "sha512-nIZ2N2dFpjBsg2hgitKu7mA+FvsIJuGJOwysRngmVRRmWgR/UyPjwJj8c/fT/dhm8EkHnF5EOogRf+0Z2qrimA==", "dev": true, "license": "MIT", "engines": { @@ -19265,9 +19156,9 @@ } }, "node_modules/tinyexec": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.3.0.tgz", - "integrity": "sha512-QKAl9m8gWWGHV8jZcPeym6j+XULi6tOf1mT83WYJ4Lk2ytW/uwAWkrP0uFsdoYMdueVJ0qs26wZ+23xeB4ibNQ==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.3.1.tgz", + "integrity": "sha512-GCvB3aoys96IuDFBMcTB46JOR6mdMtAToqwiW8JlWhsoh1mhHi/xn9ss/Dg7N555GiJyEt2qzoG/NHCwM6h1EA==", "dev": true, "license": "MIT", "engines": { @@ -19834,17 +19725,17 @@ } }, "node_modules/vite": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/vite/-/vite-8.3.0.tgz", - "integrity": "sha512-lhZBVvEHefgE+HQZC9O7EBJgCU/nVzFNl7vkS4RE0APtWLP02/8QVIkQtzBxPquh7lq5/78NHipTj7ODQ6XuyQ==", + "version": "8.3.5", + "resolved": "https://registry.npmjs.org/vite/-/vite-8.3.5.tgz", + "integrity": "sha512-z1YpjieJ9g0ebTmQpLBv/oq9E3F9EIlOe+7LahW8SrE3LTiG3udBRUXQOlYXP9b+IC2q2phHeVxj9xGlw34OEQ==", "dev": true, "license": "MIT", "peer": true, "dependencies": { "lightningcss": "^1.33.0", "picomatch": "^4.0.7", - "postcss": "^8.5.28", - "rolldown": "~1.2.6", + "postcss": "^8.5.30", + "rolldown": "~1.2.14", "tinyglobby": "^0.2.17" }, "bin": { @@ -19861,7 +19752,7 @@ }, "peerDependencies": { "@types/node": "^20.19.0 || >=22.12.0", - "@vitejs/devtools": "^0.7.1", + "@vitejs/devtools": "^0.7.1 || ^0.8.0", "esbuild": "^0.27.0 || ^0.28.0", "jiti": ">=1.21.0", "less": "^4.0.0", @@ -19912,6 +19803,305 @@ } } }, + "node_modules/vite/node_modules/@oxc-project/types": { + "version": "0.155.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.155.0.tgz", + "integrity": "sha512-SeE8JPwW1xs1tHeNycjUtUBdhorRa8o4jlvjwk49R7/Z291i+4DQa7JJIgOm/TaYQZx+QrPQbVJ/9c8dMIZN8Q==", + "dev": true, + "license": "MIT", + "peer": true, + "funding": { + "url": "https://github.com/sponsors/oxc-project" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-android-arm-eabi": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.2.15.tgz", + "integrity": "sha512-aLcgK9gIJ3YRvrrtfSBbRa27F5WrpiTaPulnFpsHPxpUHgFlSgnU4854MHwoRGEBhfRJDWCS2WQ7lIjskE9Olw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-android-arm64": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.2.15.tgz", + "integrity": "sha512-xD7DdZCrbThKuxNg7ooQmvp07ys4J/pnSEMTG3/OdOWl6daC67m/Q4fL78sRHMxTH/N4fGUbYhcPM0MF5WFHkg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-darwin-arm64": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.2.15.tgz", + "integrity": "sha512-m2WuQ6r0B4OTYxyPpNLtXaMRbRDUbG8YQV2Q3KTdSSK8Th6KHCnC8jVCJt8bvYeSB5WivkkNbc85mKadaSdOxA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-darwin-x64": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.2.15.tgz", + "integrity": "sha512-5RtnsHM36nodM9WbMy+zip0LGS/G+y5wro5RHrpOlr4ac24+1zSi9kiV2MP1myZeZ/ifEHfulQcWjnAXzc2C2A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-freebsd-x64": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.2.15.tgz", + "integrity": "sha512-g3l09pyFqhu+135JKkbkwiKGQmwU5hUMUPJ4VdBADvuqR8d33L6H578rh8m7rtxbdp+VmX/+nzI7nvhSZlzpUQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-linux-arm-gnueabihf": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.2.15.tgz", + "integrity": "sha512-nIe3VugI97nGQtspPxDqA4sXMUpeiocKIP/CqpY/u/vgbT+alX+cVxu1C/oVBPKg4feNTmYovE91v4DgXvXNwQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-linux-arm64-gnu": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.2.15.tgz", + "integrity": "sha512-iTBjXx+B5QSvgI89lJfmqh4wTh8NabR1YZIIN3hNx4zSG0EVfVqkOvLulNpG4251pbd6/IAmZ/LefVk1Y4rPhw==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-linux-arm64-musl": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.2.15.tgz", + "integrity": "sha512-uN26XOnVR7rqQupG3V9oAG2EGGatWjcJHOeDOHUFCh4TBWmP2tHTFoVN13aYbwfm0aHqJAEmcwhAu6sooIjfqQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-linux-ppc64-gnu": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.2.15.tgz", + "integrity": "sha512-9nWkcdd+H+XhaA3fQIwpHnKIrfx/PQ6rO0pivr78Og07tXlUlctBBJoEYLPfhTmCR/QxEVdn6uPjHV5SymPhdw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-linux-s390x-gnu": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.2.15.tgz", + "integrity": "sha512-Ggh0ciFjLwIusLSLz7LZYEaGdxOAUJXI+Qu5JCbhPJJHEt8vP+IjRATTJheiJsdzzTYgUiHUiw3X1Ea3ZpMBdA==", + "cpu": [ + "s390x" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-linux-x64-gnu": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.2.15.tgz", + "integrity": "sha512-FHg60rS6DBePAYZ9X9F67x+JObFdmgn6tupA1C/a3B+CufFmTD4mX+e8M75tCiAO3foR/6xwVBI0KQiI7sn/rw==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-linux-x64-musl": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.2.15.tgz", + "integrity": "sha512-/cvV/7v5VGz/moiz0XKRj2dE8DzsKyhIu1KpOvJGPjRywg3yscON889UGvAe8zfiJLHup7VLjBduoGWi3HusWQ==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-openharmony-arm64": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.2.15.tgz", + "integrity": "sha512-MyzC5Hrv/sm+Z7TSGKP/j8001RO2xQm1zOpCNVL4j0cY/VhBZviludA2YFQ7i4lH6ZAXxQm0lcMdBzM+99mE7w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-win32-arm64-msvc": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.2.15.tgz", + "integrity": "sha512-+PgYiS+AH5omy6L45ZLxybasauJaj3M8buoT83D+nzPmCayXlxUV9hydhciCKVyIg0B/v0BtXPDE1uGqNwCPpg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-win32-x64-msvc": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.2.15.tgz", + "integrity": "sha512-HFZd2QNQYn1JbIi+Hpd7H+r/lkWxcfIu28nirZ6eCn2LafuvmExMlb/P96Sfx5tf7pPArw39IdhmCF8vmV+NhQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, "node_modules/vite/node_modules/picomatch": { "version": "4.0.7", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz", @@ -19927,9 +20117,9 @@ } }, "node_modules/vite/node_modules/postcss": { - "version": "8.5.28", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.28.tgz", - "integrity": "sha512-RRuzqDtt5Y9h3quz5hWhK+TPnsmVs6WwSU6LkJMeY4HstUEDuYTG8UJSdawMRzmzAtV+KEoG8N3Qg2qLy5vM/A==", + "version": "8.5.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.31.tgz", + "integrity": "sha512-YUbWYCgErwnMAVkjUnYa+KlMBzGpHwiIt/DE7f0G33AuX2LH9UcTk6KgWxd3zRU+pN3u/C+Xl3EnMLM4Hea7Sg==", "dev": true, "funding": [ { @@ -19948,34 +20138,69 @@ "license": "MIT", "peer": true, "dependencies": { - "nanoid": "^3.3.18", + "nanoid": "^3.3.20", "picocolors": "^1.1.1", - "source-map-js": "^1.2.1" + "source-map-js": "^1.2.2" }, "engines": { "node": "^10 || ^12 || >=14" } }, + "node_modules/vite/node_modules/rolldown": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.2.15.tgz", + "integrity": "sha512-6odND+fel5zVw3I4Yc2e69gvguDnX0CAAGiNDZSq4ik5WUcaLrkD2GLuog0XcODbor31hZ5ayEMgVDno+KPV5g==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@oxc-project/types": "=0.155.0", + "@rolldown/pluginutils": "^1.0.0" + }, + "bin": { + "rolldown": "bin/cli.mjs" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "optionalDependencies": { + "@rolldown/binding-android-arm-eabi": "1.2.15", + "@rolldown/binding-android-arm64": "1.2.15", + "@rolldown/binding-darwin-arm64": "1.2.15", + "@rolldown/binding-darwin-x64": "1.2.15", + "@rolldown/binding-freebsd-x64": "1.2.15", + "@rolldown/binding-linux-arm-gnueabihf": "1.2.15", + "@rolldown/binding-linux-arm64-gnu": "1.2.15", + "@rolldown/binding-linux-arm64-musl": "1.2.15", + "@rolldown/binding-linux-ppc64-gnu": "1.2.15", + "@rolldown/binding-linux-s390x-gnu": "1.2.15", + "@rolldown/binding-linux-x64-gnu": "1.2.15", + "@rolldown/binding-linux-x64-musl": "1.2.15", + "@rolldown/binding-openharmony-arm64": "1.2.15", + "@rolldown/binding-win32-arm64-msvc": "1.2.15", + "@rolldown/binding-win32-x64-msvc": "1.2.15" + } + }, "node_modules/vitest": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-5.0.0.tgz", - "integrity": "sha512-gpsMNoRhMjMktVxPtstOH4/PJuPyovVaMDr4oDilXaGH1EcqM2OE96SoHT2VIQ6fTGtTjqmHDrEu2X9RQiXf8Q==", + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-5.0.5.tgz", + "integrity": "sha512-cPODOMF8YnkiiYtDdHo6n4wWmBrOBBbOIYH2d33M4l3CdNn72h+qMmO6uXffUN6A5AZFXNND/d+krS9mgkXRfg==", "dev": true, "license": "MIT", "dependencies": { "@types/chai": "^5.2.2", - "@vitest/mocker": "5.0.0", - "chai": "^6.2.2", + "@vitest/mocker": "5.0.5", + "chai": "^6.3.0", "es-module-lexer": "^2.3.2", "expect-type": "^1.4.0", - "magic-string": "^1.2.3", - "obug": "^2.1.4", + "magic-string": "^1.4.3", + "obug": "^3.0.0", "picomatch": "^4.0.7", - "std-env": "^4.2.0", - "tinybench": "6.1.4", - "tinyexec": "1.3.0", + "std-env": "^4.3.0", + "tinybench": "^6.2.2", + "tinyexec": "^1.3.1", "tinyglobby": "^0.2.17", - "why-is-node-running": "^2.3.0" + "why-is-node-running": "3.2.1" }, "bin": { "vitest": "vitest.mjs" @@ -19990,12 +20215,12 @@ "@edge-runtime/vm": "*", "@opentelemetry/api": "^1.9.0", "@types/node": "^22.0.0 || >=24.0.0", - "@vitest/browser-playwright": "5.0.0", - "@vitest/browser-preview": "5.0.0", + "@vitest/browser-playwright": "5.0.5", + "@vitest/browser-preview": "5.0.5", "@vitest/browser-webdriverio": "^5.0.0-beta.5 || >=5.0.0", - "@vitest/coverage-istanbul": "5.0.0", - "@vitest/coverage-v8": "5.0.0", - "@vitest/ui": "5.0.0", + "@vitest/coverage-istanbul": "5.0.5", + "@vitest/coverage-v8": "5.0.5", + "@vitest/ui": "5.0.5", "happy-dom": "*", "jsdom": "*", "vite": "^6.4.0 || ^7.0.0 || ^8.0.0" @@ -20192,20 +20417,16 @@ } }, "node_modules/why-is-node-running": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", - "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-3.2.1.tgz", + "integrity": "sha512-Tb2FUhB4vUsGQlfSquQLYkApkuPAFQXGFzxWKHHumVz2dK+X1RUm/HnID4+TfIGYJ1kTcwOaCk/buYCEJr6YjQ==", "dev": true, "license": "MIT", - "dependencies": { - "siginfo": "^2.0.0", - "stackback": "0.0.2" - }, "bin": { "why-is-node-running": "cli.js" }, "engines": { - "node": ">=8" + "node": ">=20.11" } }, "node_modules/word-wrap": { diff --git a/package.json b/package.json index 553e2f5..549e3c8 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "@wallet-standard/app": "^1.1.1", "@wallet-standard/base": "^1.1.0", "decimal.js": "10.6.0", - "next": "16.3.4", + "next": "16.4.3", "react": "19.3.0", "react-dom": "19.3.0", "server-only": "0.0.1", @@ -37,9 +37,11 @@ "@types/react": "19.2.7", "@types/react-dom": "19.2.3", "eslint": "9.39.1", - "eslint-config-next": "16.3.4", + "eslint-config-next": "16.3.8", + "rolldown": "1.2.8", + "sharp": "0.35.5", "typescript": "5.9.3", - "vitest": "5.0.0" + "vitest": "5.0.5" }, "overrides": { "nanoid": "3.3.19", diff --git a/scripts/dapp-store/banner.html b/scripts/dapp-store/banner.html new file mode 100644 index 0000000..00e32db --- /dev/null +++ b/scripts/dapp-store/banner.html @@ -0,0 +1,139 @@ + + + + + +Buffer · dApp Store banner + + + + +
+
+ +
+ + Buffer +
+ +
+
A clearer view of your perps
+

Every position.Every price move.A clearer picture.

+

Read Solana perpetual positions and see what a shared price move would do, with the math in view.

+
+ +
Read-only wallet connection. No signatures or trading permissions.
+ +
bufferonsolana.vercel.appVelocity · Pacifica · Jupiter Perps
+ +
+
+
+
+ Scenario explorer + Long + short preset +
+
+
Perp price P&L change
+
+3,500.00USDC
+

If both reference prices move −10% together.

+
+
+
Shared price move−10%
+
+
−20%0%+20%
+
+
+
SOL-PERPLong · 100.00 at 150.00 USDC−1,500.00
+
BTC-PERPShort · 0.50 at 100,000.00 USDC+5,000.00
+
+

Fixed reference prices. Price effect only; excludes funding, fees, collateral changes and liquidations.

+
+
+ + diff --git a/scripts/generate-dapp-store-assets.mjs b/scripts/generate-dapp-store-assets.mjs new file mode 100644 index 0000000..db8ec3d --- /dev/null +++ b/scripts/generate-dapp-store-assets.mjs @@ -0,0 +1,293 @@ +/** + * Rebuild the Solana dApp Store listing kit in docs/dapp-store/. + * + * node scripts/generate-dapp-store-assets.mjs [banner|screenshots|verify|all] + * --base-url=https://bufferonsolana.vercel.app site to capture (default: production) + * --velocity= Velocity mainnet account with open positions + * --pacifica= Pacifica account with open positions + * + * banner Renders scripts/dapp-store/banner.html at 1200x600, deviceScaleFactor 1. The + * scenario card is the app's own 'long-short' preset run through src/lib/scenario.ts. + * screenshots Reads the live site as a 360x640 phone at deviceScaleFactor 3, so every capture is + * 1080x1920. It opens public pages and public example accounts only: it never signs in + * or sends a form. The report shot saves to the throwaway browser profile's storage. + * verify Checks real PNG dimensions and file sizes against the store limits. + * + * Live reads count against the site's per-IP limit (about 30 a minute); one run makes four. + */ +import { mkdir, readFile, readdir, rm, stat, writeFile } from 'node:fs/promises'; +import { fileURLToPath } from 'node:url'; +import path from 'node:path'; +import { chromium } from '@playwright/test'; +import sharp from 'sharp'; + +const root = fileURLToPath(new URL('../', import.meta.url)); +const output = path.join(root, 'docs/dapp-store'); +const screenshotDir = path.join(output, 'screenshots'); +const bannerFile = path.join(output, 'banner-1200x600.png'); + +const BANNER = { width: 1200, height: 600 }; +const PHONE = { width: 360, height: 640, scale: 3 }; +const SCREENSHOT = { width: PHONE.width * PHONE.scale, height: PHONE.height * PHONE.scale }; +const STORE = { minScreenshots: 4, maxScreenshots: 8, maxBytes: 3_000_000 }; +// Portal text limits; listing.md states each count, and verify keeps those statements true. +const TEXT = { name: { label: 'App name', max: 25 }, subtitle: { label: 'Subtitle', max: 30 }, description: { label: 'Description', max: 10_000 } }; +const SHOCK_PERCENT = -10; +// Live calculations expire after 120 seconds; finish each account's captures well inside that. +const FRESH_MS = 100_000; +const DEFAULTS = { + baseUrl: 'https://bufferonsolana.vercel.app', + // The app's own public examples (src/lib/live-link.ts). Balances can change or close. + velocity: 'DxoRJ4f5XRMvXU9SGuM4ZziBFUxbhB3ubur5sVZEvue2', + pacifica: 'Ep1d8JdFw4FnB85XDgXGVabYutro4JzK285HQqW6TZE2', +}; + +function options(argv) { + const values = { ...DEFAULTS, command: 'all' }; + for (const arg of argv) { + const match = /^--(base-url|velocity|pacifica)=(.+)$/.exec(arg); + if (match) values[match[1] === 'base-url' ? 'baseUrl' : match[1]] = match[2]; + else if (['banner', 'screenshots', 'verify', 'all'].includes(arg)) values.command = arg; + else throw new Error(`Unknown argument: ${arg}`); + } + const base = new URL(values.baseUrl); + if (base.protocol !== 'https:' && base.hostname !== '127.0.0.1' && base.hostname !== 'localhost') throw new Error('Capture an https deployment or a local server.'); + values.baseUrl = base.origin; + for (const key of ['velocity', 'pacifica']) { + if (!/^[1-9A-HJ-NP-Za-km-z]{32,44}$/.test(values[key])) throw new Error(`--${key} must be a public Solana address.`); + } + return values; +} + +/** The banner's numbers come from the app's own modules, so they cannot drift from the product. */ +async function presetScenario() { + const { build } = await import('rolldown'); + const id = 'virtual:dapp-store-banner'; + const source = (file) => JSON.stringify(path.join(root, file)); + const entry = `export { getSampleSnapshot, SAMPLE_ACCOUNTS } from ${source('src/lib/samples.ts')}; +export { calculateScenario } from ${source('src/lib/scenario.ts')}; +export { formatDecimal } from ${source('src/lib/format.ts')};`; + const bundle = await build({ + cwd: root, input: id, write: false, platform: 'node', logLevel: 'silent', + resolve: { alias: { '@': path.join(root, 'src') } }, + plugins: [{ name: 'dapp-store-entry', resolveId: (spec) => (spec === id ? id : null), load: (spec) => (spec === id ? entry : null) }], + output: { format: 'esm' }, + }); + const app = await import(`data:text/javascript;base64,${Buffer.from(bundle.output[0].code).toString('base64')}`); + const snapshot = app.getSampleSnapshot('long-short'); + const scenario = app.calculateScenario(snapshot, SHOCK_PERCENT, Date.parse(snapshot.retrievedAt)); + if (scenario.disabledReason || scenario.totals.length !== 1 || scenario.included.length !== snapshot.positions.length) { + throw new Error('The long-short preset no longer produces a single-currency scenario; update the banner card.'); + } + const signedPercent = `${SHOCK_PERCENT > 0 ? '+' : SHOCK_PERCENT < 0 ? '−' : ''}${Math.abs(SHOCK_PERCENT)}%`; + return { + preset: `${app.SAMPLE_ACCOUNTS.find((item) => item.id === 'long-short').name} preset`, + total: app.formatDecimal(scenario.totals[0].delta, 2, true), + quote: scenario.totals[0].quote, + shock: signedPercent, + move: `If supported perp prices move ${signedPercent} together.`, + position: ((SHOCK_PERCENT + 20) / 40) * 100, + positions: scenario.included.map((item) => { + const asset = snapshot.positions.find((position) => position.id === item.id).asset; + const short = item.size.startsWith('-'); + return { + market: item.market, + icon: `../../public/tokens/${asset.toLowerCase()}.png`, + detail: `${short ? 'Short' : 'Long'} · ${app.formatDecimal(item.size.replace('-', ''), 2)} at ${app.formatDecimal(item.baselinePrice, 2)} ${item.quote}`, + delta: app.formatDecimal(item.delta, 2, true), + direction: item.delta.startsWith('-') ? 'down' : 'up', + }; + }), + }; +} + +const BANNER_ORIGIN = 'https://dapp-store-banner.invalid'; +const SERVED = ['scripts/dapp-store/', 'design/brand-kit/masters/', 'public/tokens/', 'src/app/fonts/']; +const TYPES = { '.html': 'text/html; charset=utf-8', '.png': 'image/png', '.woff2': 'font/woff2', '.svg': 'image/svg+xml' }; + +async function renderBanner(browser) { + const data = await presetScenario(); + const context = await browser.newContext({ viewport: { width: BANNER.width, height: BANNER.height }, deviceScaleFactor: 1, colorScheme: 'light' }); + // Serve the composition and its brand sources from disk under a private origin; nothing is fetched. + await context.route(`${BANNER_ORIGIN}/**`, async (route) => { + const relative = decodeURIComponent(new URL(route.request().url()).pathname).replace(/^\/+/, ''); + const file = path.join(root, relative); + if (!SERVED.some((dir) => relative.startsWith(dir)) || !file.startsWith(root) || !TYPES[path.extname(file)]) return route.fulfill({ status: 404, body: '' }); + return route.fulfill({ status: 200, contentType: TYPES[path.extname(file)], body: await readFile(file) }); + }); + await context.route((url) => !url.href.startsWith(BANNER_ORIGIN), (route) => route.abort()); + const page = await context.newPage(); + await page.goto(`${BANNER_ORIGIN}/scripts/dapp-store/banner.html`, { waitUntil: 'load' }); + await page.evaluate((card) => { + const slot = (name) => document.querySelector(`[data-slot="${name}"]`); + for (const key of ['preset', 'total', 'quote', 'shock', 'move']) slot(key).textContent = card[key]; + slot('fill').style.width = `${card.position}%`; + slot('thumb').style.left = `${card.position}%`; + const list = slot('positions'); + list.replaceChildren(...card.positions.map((item) => { + const row = document.createElement('div'); row.className = 'position'; + const icon = document.createElement('img'); icon.src = item.icon; icon.alt = ''; + const label = document.createElement('span'); + const market = document.createElement('strong'); market.textContent = item.market; + const detail = document.createElement('small'); detail.textContent = item.detail; + label.append(market, detail); + const delta = document.createElement('strong'); delta.className = item.direction; delta.textContent = item.delta; + row.append(icon, label, delta); + return row; + })); + }, data); + await page.evaluate(async () => { + await document.fonts.ready; + await Promise.all([...document.images].map((image) => image.decode())); + if (!document.fonts.check('600 16px Inter')) throw new Error('Inter did not load for the banner.'); + }); + const png = await page.screenshot({ type: 'png' }); + await context.close(); + await mkdir(output, { recursive: true }); + await writeFile(bannerFile, await sharp(png).png({ compressionLevel: 9, adaptiveFiltering: true }).toBuffer()); + console.log(`banner: ${path.relative(root, bannerFile)} · ${data.preset} at ${data.shock}: ${data.total} ${data.quote}`); +} + +async function settle(page) { + await page.evaluate(async () => { + await document.fonts.ready; + await Promise.all([...document.images].filter((image) => image.loading !== 'lazy' || image.complete).map((image) => image.decode().catch(() => undefined))); + }); + // Toasts confirm actions for 4.5 seconds; never capture one mid-fade. + await page.waitForFunction(() => !document.querySelector('.toast span'), null, { timeout: 15_000 }); + await page.waitForTimeout(350); +} + +/** Put a target just under the sticky app header, leaving `gap` pixels of air above it. */ +async function scrollUnderHeader(page, selector, gap = 12) { + await page.evaluate(([target, space]) => { + const element = document.querySelector(target); + if (!element) throw new Error(`Missing ${target}`); + const header = document.querySelector('.header')?.getBoundingClientRect().height ?? 0; + window.scrollTo({ top: element.getBoundingClientRect().top + window.scrollY - header - space, behavior: 'instant' }); + }, [selector, gap]); +} + +async function capture(page, name, startedAt) { + if (startedAt && Date.now() - startedAt > FRESH_MS) throw new Error(`${name}: the live snapshot is too old to show a current calculation. Run again.`); + await settle(page); + const png = await page.screenshot({ type: 'png' }); + const file = path.join(screenshotDir, name); + await writeFile(file, await sharp(png).png({ compressionLevel: 9, adaptiveFiltering: true }).toBuffer()); + console.log(`screenshot: ${path.relative(root, file)}`); +} + +async function captureScreenshots(browser, settings) { + const context = await browser.newContext({ + viewport: { width: PHONE.width, height: PHONE.height }, deviceScaleFactor: PHONE.scale, + isMobile: true, hasTouch: true, serviceWorkers: 'block', reducedMotion: 'reduce', + colorScheme: 'light', locale: 'en-US', timezoneId: 'UTC', + }); + const page = await context.newPage(); + await rm(screenshotDir, { recursive: true, force: true }); + await mkdir(screenshotDir, { recursive: true }); + const live = (protocol, authority) => `${settings.baseUrl}/app?${new URLSearchParams({ protocol, authority })}`; + + // 1. The landing hero, as a first-time visitor sees it. + await page.goto(`${settings.baseUrl}/`, { waitUntil: 'networkidle' }); + await capture(page, '01-landing-hero.png'); + + // 2, 3, 5 and 6. One fresh read of the public Velocity mainnet example serves four views. + await page.goto(live('velocity', settings.velocity), { waitUntil: 'networkidle' }); + const estimate = page.locator('[data-testid="liquidation-estimate"]'); + await estimate.waitFor({ timeout: 60_000 }); + const velocityReadAt = Date.now(); + if (await estimate.getAttribute('data-liquidation-state') !== 'estimated') throw new Error('The Velocity account has no current liquidation estimate. Pass --velocity=
.'); + // Keep the observation time above the estimate in frame: it dates the numbers. + await scrollUnderHeader(page, '[data-testid="liquidation-estimate"]', 96); + await capture(page, '02-velocity-liquidation-estimate.png', velocityReadAt); + + const scenario = page.locator('#app-scenario'); + await scenario.getByRole('button', { name: `${SHOCK_PERCENT}%`, exact: true }).click(); + await page.waitForFunction(() => !/^0\.00/.test(document.querySelector('[data-testid="scenario-total"]')?.textContent ?? '0.00')); + await scrollUnderHeader(page, '#app-scenario', 12); + await capture(page, '03-velocity-price-scenario.png', velocityReadAt); + + // The device library: save this scenario and open its dated explanation. + await page.evaluate(() => window.scrollTo({ top: 0, behavior: 'instant' })); + await page.getByRole('button', { name: 'My reports', exact: true }).click(); + const library = page.getByRole('dialog', { name: 'Saved perspectives.' }); + await library.getByRole('button', { name: 'Save current scenario' }).click(); + await library.getByText('Saved on this device').waitFor(); + await library.getByText('View saved explanation').click(); + // Start the frame on the saved item, with a little air above its divider and no clipped line. + await page.evaluate(() => { + const dialog = document.querySelector('dialog[open]'); + const item = dialog.querySelector('li'); + dialog.scrollTo({ top: item.offsetTop - 18, behavior: 'instant' }); + }); + await capture(page, '05-saved-report.png', velocityReadAt); + await library.getByRole('button', { name: 'Close saved reports' }).click(); + + await scrollUnderHeader(page, '#monitoring', 8); + await capture(page, '06-alerts-panel.png', velocityReadAt); + + // 4. The public Pacifica example: equity, commodity and FX perps beside crypto. + await page.goto(live('pacifica', settings.pacifica), { waitUntil: 'networkidle' }); + await page.locator('#positions-heading').waitFor({ timeout: 60_000 }); + const pacificaReadAt = Date.now(); + await scrollUnderHeader(page, '#app-positions', 12); + await capture(page, '04-pacifica-positions.png', pacificaReadAt); + await context.close(); +} + +/** Real dimensions from each PNG's IHDR chunk, never from file names. */ +async function pngInfo(file) { + const bytes = await readFile(file); + const signature = [0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]; + if (bytes.length < 24 || signature.some((byte, index) => bytes[index] !== byte) || bytes.toString('ascii', 12, 16) !== 'IHDR') throw new Error(`${file} is not a PNG.`); + return { file: path.relative(root, file), width: bytes.readUInt32BE(16), height: bytes.readUInt32BE(20), bytes: (await stat(file)).size }; +} + +/** Each Portal field is a ```text block in listing.md; count characters, not bytes. */ +async function listingText(problems) { + const markdown = await readFile(path.join(output, 'listing.md'), 'utf8'); + const fields = Object.fromEntries([...markdown.matchAll(/^```text ([a-z-]+)\n([\s\S]*?)\n```$/gm)].map((match) => [match[1], match[2]])); + const counts = {}; + for (const [field, { label, max }] of Object.entries(TEXT)) { + if (!fields[field]?.trim()) { problems.push(`listing.md has no ${label} block.`); continue; } + const characters = [...fields[field]].length; + counts[field] = { characters, max }; + if (characters > max) problems.push(`${label} has ${characters} characters; the limit is ${max}.`); + const stated = new RegExp(`\\*\\*${label}\\*\\* \\(([\\d,]+) of ${max.toLocaleString('en-US')} characters\\)`).exec(markdown); + if (!stated || Number(stated[1].replaceAll(',', '')) !== characters) problems.push(`listing.md must state "${label} (${characters.toLocaleString('en-US')} of ${max.toLocaleString('en-US')} characters)".`); + } + return counts; +} + +async function verify() { + const problems = []; + const banner = await pngInfo(bannerFile); + if (banner.width !== BANNER.width || banner.height !== BANNER.height) problems.push(`Banner is ${banner.width}x${banner.height}, not ${BANNER.width}x${BANNER.height}.`); + const names = (await readdir(screenshotDir)).filter((name) => name.endsWith('.png')).sort(); + const screenshots = await Promise.all(names.map((name) => pngInfo(path.join(screenshotDir, name)))); + if (screenshots.length < STORE.minScreenshots || screenshots.length > STORE.maxScreenshots) problems.push(`${screenshots.length} screenshots; the store accepts ${STORE.minScreenshots}-${STORE.maxScreenshots}.`); + for (const shot of screenshots) { + if (shot.width !== SCREENSHOT.width || shot.height !== SCREENSHOT.height) problems.push(`${shot.file} is ${shot.width}x${shot.height}, not ${SCREENSHOT.width}x${SCREENSHOT.height}.`); + if (shot.bytes >= STORE.maxBytes) problems.push(`${shot.file} is ${shot.bytes} bytes; keep each screenshot under ${STORE.maxBytes}.`); + } + if (new Set(screenshots.map((shot) => `${shot.width}x${shot.height}`)).size > 1) problems.push('Screenshots differ in size.'); + // Every capture listing.md describes must exist, and nothing unlisted may ship. + const listed = [...new Set([...(await readFile(path.join(output, 'listing.md'), 'utf8')).matchAll(/`screenshots\/([\w-]+\.png)`/g)].map((match) => match[1]))].sort(); + for (const name of listed.filter((name) => !names.includes(name))) problems.push(`listing.md lists screenshots/${name}, which is missing.`); + for (const name of names.filter((name) => !listed.includes(name))) problems.push(`screenshots/${name} is not described in listing.md.`); + const listing = await listingText(problems); + const summary = { result: problems.length ? 'FAIL' : 'PASS', banner, screenshots, listing, limits: { banner: `${BANNER.width}x${BANNER.height}`, screenshot: `${SCREENSHOT.width}x${SCREENSHOT.height} portrait`, count: `${STORE.minScreenshots}-${STORE.maxScreenshots}`, maxBytes: STORE.maxBytes }, problems }; + console.log(JSON.stringify(summary, null, 2)); + if (problems.length) process.exitCode = 1; +} + +const settings = options(process.argv.slice(2)); +if (settings.command !== 'verify') { + const browser = await chromium.launch(); + try { + if (settings.command === 'banner' || settings.command === 'all') await renderBanner(browser); + if (settings.command === 'screenshots' || settings.command === 'all') await captureScreenshots(browser, settings); + } finally { await browser.close(); } +} +if (settings.command === 'verify' || settings.command === 'all') await verify(); diff --git a/scripts/lib/pglite.mjs b/scripts/lib/pglite.mjs new file mode 100644 index 0000000..ee5faae --- /dev/null +++ b/scripts/lib/pglite.mjs @@ -0,0 +1,12 @@ +/** + * Disposable local PostgreSQL (PGlite) with pgcrypto loaded, because hosted + * Supabase installs pgcrypto in the `extensions` schema and migrations use it. + * BUFFER_PGLITE_MODULE may point at PGlite's dist/index.js, as CI does. + */ +const MODULE = process.env.BUFFER_PGLITE_MODULE || '@electric-sql/pglite'; +const PGCRYPTO = MODULE.endsWith('/index.js') ? MODULE.replace(/index\.js$/, 'contrib/pgcrypto.js') : `${MODULE}/contrib/pgcrypto`; +const [{ PGlite }, { pgcrypto }] = await Promise.all([import(MODULE), import(PGCRYPTO)]); + +export function createDatabase() { + return new PGlite({ extensions: { pgcrypto } }); +} diff --git a/scripts/verify-account-deletion.mjs b/scripts/verify-account-deletion.mjs new file mode 100644 index 0000000..7414cd5 --- /dev/null +++ b/scripts/verify-account-deletion.mjs @@ -0,0 +1,167 @@ +/** + * Local PostgreSQL/WASM checks for self-service account deletion. No hosted + * connection. Hosted Supabase owns auth.users as supabase_auth_admin and runs + * migrations as a non-superuser postgres role, so this fixture creates the + * deletion function as a non-superuser that holds only the auth.users + * privileges that role has. + */ +import { readdir, readFile } from 'node:fs/promises'; +import assert from 'node:assert/strict'; +import { createDatabase } from './lib/pglite.mjs'; + +const DELETION_MIGRATION = '20261008081817_delete_own_account.sql'; +const migrations = new URL('../supabase/migrations/', import.meta.url); +const db = createDatabase(); +let checks = 0; +const ownerA = '00000000-0000-4000-8000-00000000000a'; +const ownerB = '00000000-0000-4000-8000-00000000000b'; +const sql = (query, params = []) => db.query(query, params); +const rows = async (query, params = []) => (await sql(query, params)).rows; +async function check(query, expected, params = []) { assert.deepEqual(await rows(query, params), expected); checks++; } +async function rejects(query, code) { await assert.rejects(sql(query), error => error.code === code); checks++; } +async function as(role, owner = '') { + await db.exec(`reset role; set role ${role}; select set_config('request.jwt.claim.sub','${owner}',false);`); +} +async function asAdmin() { await db.exec("reset role; select set_config('request.jwt.claim.sub','',false);"); } + +await db.exec(` + create role anon; create role authenticated; create role service_role bypassrls; + create role supabase_auth_admin; create role buffer_migrator; create role no_grants; + create schema auth authorization supabase_auth_admin; + create table auth.users(id uuid primary key, email text not null); + create table auth.sessions(id uuid primary key default gen_random_uuid(), user_id uuid not null references auth.users(id) on delete cascade); + create table auth.identities(id uuid primary key default gen_random_uuid(), user_id uuid not null references auth.users(id) on delete cascade); + alter table auth.users owner to supabase_auth_admin; + alter table auth.sessions owner to supabase_auth_admin; + alter table auth.identities owner to supabase_auth_admin; + create function auth.uid() returns uuid language sql stable as $$ select nullif(current_setting('request.jwt.claim.sub',true),'')::uuid $$; + grant usage on schema auth, public to anon, authenticated, service_role, buffer_migrator, no_grants; + grant execute on function auth.uid() to anon, authenticated, service_role, buffer_migrator; + -- The privileges hosted postgres holds on Auth's table; nothing on its other tables. + grant select, delete on auth.users to buffer_migrator; + -- Supabase grants browser roles EXECUTE on new public functions directly. + -- Revoking PUBLIC alone would leave those grants in place. + alter default privileges in schema public grant execute on functions to anon, authenticated, service_role; + alter default privileges for role buffer_migrator in schema public grant execute on functions to anon, authenticated, service_role; + create schema private; + -- Hosted Supabase installs pgcrypto here; the rate-limit migration uses it. + create schema extensions; +`); +/** + * Applied in production only, as the hosted ledger recorded them. They install + * pg_cron, read Supabase Vault and call the http extension to reach the + * scheduler, none of which PGlite has, and they create no table, column, + * policy or grant that deletion depends on. scripts/verify-monitoring-scheduler.mjs + * exercises the helper they define against a synthetic transport instead. + */ +const SCHEDULER_ONLY = ['20260919183534_prepare_monitoring_scheduler.sql', '20260919185033_use_synchronous_monitoring_trigger.sql', '20260930095233_acknowledge_webhook_delivery_in_scheduler.sql']; +const checkedIn = (await readdir(migrations)).filter(name => name.endsWith('.sql')).sort(); +for (const name of SCHEDULER_ONLY) assert.ok(checkedIn.includes(name), `${name} is expected in supabase/migrations; update SCHEDULER_ONLY if it was renamed.`); +checks++; +const files = checkedIn.filter(name => !SCHEDULER_ONLY.includes(name)); +// It must run after every migration that created an owner-keyed table. +assert.ok(files.indexOf(DELETION_MIGRATION) > files.indexOf('20260928154216_liquidation_sentinels.sql'), `${DELETION_MIGRATION} must sort after the alert migrations.`); +checks++; +for (const name of files) { + const body = await readFile(new URL(name, migrations), 'utf8'); + if (name !== DELETION_MIGRATION) { await db.exec(body); continue; } + await db.exec('grant create on schema public to buffer_migrator; set role buffer_migrator;'); + await db.exec(body); + await db.exec('reset role; revoke create on schema public from buffer_migrator;'); +} + +// Every owner-keyed table must disappear with its account. A new table that +// references auth.users fails here until it cascades and the privacy page lists it. +await check(`select conrelid::regclass::text as owned, confdeltype as on_delete from pg_constraint + where contype='f' and confrelid='auth.users'::regclass and connamespace <> 'auth'::regnamespace order by 1`, [ + { owned: 'alert_destinations', on_delete: 'c' }, { owned: 'alert_events', on_delete: 'c' }, + { owned: 'alert_outbox', on_delete: 'c' }, { owned: 'alert_rules', on_delete: 'c' }, + { owned: 'private.buffer_monitor_runs', on_delete: 'c' }, { owned: 'saved_reports', on_delete: 'c' }, +]); +await check(`select p.prosecdef as definer, p.pronargs as arguments, p.prorettype::regtype::text as returns, + coalesce(p.proconfig @> array['search_path=""'], false) as pinned_search_path, pg_get_userbyid(p.proowner) as owner + from pg_proc p where p.oid='public.delete_own_account()'::regprocedure`, + [{ definer: true, arguments: 0, returns: 'uuid', pinned_search_path: true, owner: 'buffer_migrator' }]); +for (const [role, permitted] of [['anon', false], ['service_role', false], ['no_grants', false], ['authenticated', true]]) { + await check(`select has_function_privilege('${role}','public.delete_own_account()','EXECUTE') as permitted`, [{ permitted }]); +} + +const report = JSON.stringify({ report: 'Buffer perpetual price scenario', version: 1, sourceMode: 'live', scenario: {} }); +const fingerprint = letter => letter.repeat(64); +await db.exec(` + insert into auth.users values ('${ownerA}','a@example.test'),('${ownerB}','b@example.test'); + insert into auth.sessions(user_id) values ('${ownerA}'),('${ownerA}'),('${ownerB}'); + insert into auth.identities(user_id) values ('${ownerA}'),('${ownerB}'); + insert into public.saved_reports(user_id,title,report) values + ('${ownerA}','A first',$json$${report}$json$),('${ownerA}','A second',$json$${report}$json$),('${ownerB}','B only',$json$${report}$json$); + insert into public.alert_destinations(id,owner_id,provider,config_ref,fingerprint,label,masked_destination) values + ('00000000-0000-4000-8000-0000000000a1','${ownerA}','discord','00000000-0000-4000-8000-0000000000f1','${fingerprint('a')}','A channel','Discord …00a1'), + ('00000000-0000-4000-8000-0000000000a2','${ownerA}','webhook','00000000-0000-4000-8000-0000000000f2','${fingerprint('b')}','A hook','Webhook hooks.example.com'), + ('00000000-0000-4000-8000-0000000000b1','${ownerB}','discord','00000000-0000-4000-8000-0000000000f1','${fingerprint('c')}','B channel','Discord …00b1'); + insert into public.alert_rules(id,owner_id,authority,subaccount_id,metric,unit,market,direction,threshold,cadence_minutes,timezone,destination_id,destination) values + ('00000000-0000-4000-8000-0000000000a3','${ownerA}','DxoRJ4f5XRMvXU9SGuM4ZziBFUxbhB3ubur5sVZEvue2',0,'maintenance_headroom','USD',null,'below',300,15,'UTC','00000000-0000-4000-8000-0000000000a1','discord'), + ('00000000-0000-4000-8000-0000000000a4','${ownerA}','DxoRJ4f5XRMvXU9SGuM4ZziBFUxbhB3ubur5sVZEvue2',0,'liquidation_distance','%','SOL-PERP','below',5,15,'UTC','00000000-0000-4000-8000-0000000000a2','webhook'), + ('00000000-0000-4000-8000-0000000000b3','${ownerB}','DxoRJ4f5XRMvXU9SGuM4ZziBFUxbhB3ubur5sVZEvue2',0,'maintenance_headroom','USD',null,'below',300,15,'UTC','00000000-0000-4000-8000-0000000000b1','discord'); + insert into public.alert_events(id,rule_id,rule_version,owner_id,event_key,state,observed_at,value,threshold,reason,destination_id,destination_fingerprint) values + ('00000000-0000-4000-8000-0000000000a5','00000000-0000-4000-8000-0000000000a3',1,'${ownerA}','a-queued','queued',now(),250,300,'Queued fixture','00000000-0000-4000-8000-0000000000a1','${fingerprint('a')}'), + ('00000000-0000-4000-8000-0000000000a6','00000000-0000-4000-8000-0000000000a4',1,'${ownerA}','a-delivered','delivered',now(),4,5,'Delivered fixture','00000000-0000-4000-8000-0000000000a2','${fingerprint('b')}'), + ('00000000-0000-4000-8000-0000000000a7',null,1,'${ownerA}','a-history','suppressed',now()-interval '2 days',250,300,'Event kept after its rule was deleted',null,null), + ('00000000-0000-4000-8000-0000000000b5','00000000-0000-4000-8000-0000000000b3',1,'${ownerB}','b-queued','queued',now(),250,300,'Queued fixture','00000000-0000-4000-8000-0000000000b1','${fingerprint('c')}'); + insert into public.alert_outbox(event_id,owner_id,state) values + ('00000000-0000-4000-8000-0000000000a5','${ownerA}','pending'),('00000000-0000-4000-8000-0000000000a6','${ownerA}','delivered'), + ('00000000-0000-4000-8000-0000000000b5','${ownerB}','pending'); + update public.alert_rules set unresolved_event_id='00000000-0000-4000-8000-0000000000a5' where id='00000000-0000-4000-8000-0000000000a3'; + update public.alert_rules set unresolved_event_id='00000000-0000-4000-8000-0000000000b5' where id='00000000-0000-4000-8000-0000000000b3'; + insert into private.buffer_monitor_runs(run_key,mode,owner_id) values + ('manual:00000000-0000-4000-8000-0000000000a8','dry_run','${ownerA}'),('manual:00000000-0000-4000-8000-0000000000b8','dry_run','${ownerB}'),('cron:1','dry_run',null); +`); + +const OWNED = [ + ['auth.users', 'id'], ['auth.sessions', 'user_id'], ['auth.identities', 'user_id'], ['public.saved_reports', 'user_id'], + ['public.alert_rules', 'owner_id'], ['public.alert_destinations', 'owner_id'], ['public.alert_events', 'owner_id'], + ['public.alert_outbox', 'owner_id'], ['private.buffer_monitor_runs', 'owner_id'], +]; +async function holdings(owner) { + await asAdmin(); + const counts = {}; + for (const [table, column] of OWNED) counts[table] = (await rows(`select count(*)::int as n from ${table} where ${column}=$1`, [owner]))[0].n; + return counts; +} +const before = { a: await holdings(ownerA), b: await holdings(ownerB) }; +assert.deepEqual(before.a, { 'auth.users': 1, 'auth.sessions': 2, 'auth.identities': 1, 'public.saved_reports': 2, 'public.alert_rules': 2, + 'public.alert_destinations': 2, 'public.alert_events': 3, 'public.alert_outbox': 2, 'private.buffer_monitor_runs': 1 }); checks++; +const bWork = `select e.state as event, o.state as outbox from public.alert_events e join public.alert_outbox o on o.event_id=e.id where e.owner_id='${ownerB}'`; + +// Browser roles without a signed-in subject cannot reach the function at all, +// even when a subject claim is forged onto an anonymous request. +await as('anon'); await rejects('select public.delete_own_account()', '42501'); +await as('anon', ownerA); await rejects('select public.delete_own_account()', '42501'); +await as('service_role', ownerA); await rejects('select public.delete_own_account()', '42501'); +await as('authenticated'); await rejects('select public.delete_own_account()', '42501'); +assert.deepEqual(await holdings(ownerA), before.a); checks++; + +// The caller deletes their own account and nothing else. +await as('authenticated', ownerA); +await check('select public.delete_own_account() as removed', [{ removed: ownerA }]); +assert.deepEqual(await holdings(ownerA), Object.fromEntries(OWNED.map(([table]) => [table, 0]))); checks++; +assert.deepEqual(await holdings(ownerB), before.b); checks++; +await check(bWork, [{ event: 'queued', outbox: 'pending' }]); +await check("select count(*)::int as n from private.buffer_monitor_runs where owner_id is null", [{ n: 1 }]); + +// A token that outlives its account deletes nothing more. +await as('authenticated', ownerA); +await check('select public.delete_own_account() as removed', [{ removed: null }]); +assert.deepEqual(await holdings(ownerB), before.b); checks++; + +// The other owner still reads their own rows through RLS, then can leave too. +await as('authenticated', ownerB); +await check('select title from public.saved_reports', [{ title: 'B only' }]); +await check('select jsonb_array_length(public.buffer_monitor_status()->\'rules\') as rules', [{ rules: 1 }]); +await check('select public.delete_own_account() as removed', [{ removed: ownerB }]); +assert.deepEqual(await holdings(ownerB), Object.fromEntries(OWNED.map(([table]) => [table, 0]))); checks++; +await asAdmin(); +await check('select count(*)::int as n from auth.users', [{ n: 0 }]); +await check("select run_key from private.buffer_monitor_runs", [{ run_key: 'cron:1' }]); + +await db.close(); +console.log(JSON.stringify({ result: 'PASS', assertions: checks, database: 'local PostgreSQL (PGlite)', externalWrites: false }, null, 2)); diff --git a/scripts/verify-alert-schema.mjs b/scripts/verify-alert-schema.mjs index ec412ca..2ac0324 100644 --- a/scripts/verify-alert-schema.mjs +++ b/scripts/verify-alert-schema.mjs @@ -31,8 +31,8 @@ await db.exec(` as $$ delete from private.rate_limits where window_start < now() - interval '1 hour' $$; insert into private.rate_limits values (now() - interval '2 hours'), (now()); `); -const permissionMigration = await readFile(new URL('../supabase/migrations/20260920010000_harden_function_permissions.sql', import.meta.url), 'utf8'); -for (const name of ['20260915120000_create_alert_pipeline.sql','20260919090000_harden_alert_pipeline.sql', '20260920010000_harden_function_permissions.sql']) { +const permissionMigration = await readFile(new URL('../supabase/migrations/20260919173121_harden_function_permissions.sql', import.meta.url), 'utf8'); +for (const name of ['20260915180735_create_alert_pipeline.sql','20260919172720_harden_alert_pipeline.sql', '20260919173121_harden_function_permissions.sql']) { await db.exec(await readFile(new URL(`../supabase/migrations/${name}`, import.meta.url), 'utf8')); } await check(`select coalesce(proconfig @> array['search_path=""'],false) as secured from pg_proc where oid='private.prune_rate_limits()'::regprocedure`, [{ secured: true }]); diff --git a/scripts/verify-hosted-monitoring.mjs b/scripts/verify-hosted-monitoring.mjs index 7fa24db..d51a342 100644 --- a/scripts/verify-hosted-monitoring.mjs +++ b/scripts/verify-hosted-monitoring.mjs @@ -21,7 +21,7 @@ await db.exec(`create role anon; create role authenticated; create role service_ grant usage on schema auth,public to anon,authenticated,service_role; alter default privileges in schema public grant execute on functions to anon,authenticated,service_role; insert into auth.users values('${ownerA}'),('${ownerB}');`); -for (const name of ['20260915120000_create_alert_pipeline.sql', '20260919090000_harden_alert_pipeline.sql', '20260920010000_harden_function_permissions.sql', '20260920020000_hosted_monitoring.sql', '20260928120000_liquidation_sentinels.sql']) await db.exec(await readFile(new URL(`../supabase/migrations/${name}`, import.meta.url), 'utf8')); +for (const name of ['20260915180735_create_alert_pipeline.sql', '20260919172720_harden_alert_pipeline.sql', '20260919173121_harden_function_permissions.sql', '20260919183521_hosted_monitoring.sql', '20260928154216_liquidation_sentinels.sql', '20261017103000_worker_fairness.sql', '20261019090000_worker_secret_lockout.sql']) await db.exec(await readFile(new URL(`../supabase/migrations/${name}`, import.meta.url), 'utf8')); await sql("insert into private.buffer_monitor_credentials(secret_hash) values(encode(sha256(convert_to($1,'UTF8')),'hex'))", [secret]); await assert.rejects(worker('start', { runKey: 'cron:1', mode: 'dry_run' }, 'invalid-secret-that-is-long-enough'), error => error.code === '42501'); checks++; await role('authenticated', ownerA); @@ -160,5 +160,122 @@ check([deliveredSentinel.state, deliveredSentinel.provider_message_id, delivered check(await worker('claim_receipt'), null); check((await status(ownerA)).rules.find(item => item.id === sentinelId).unresolved_event_id, null); await worker('end', { runKey: 'cron:3', outcome: 'ok' }); + +// --- Worker fairness (20261017103000_worker_fairness.sql). +// Owner B gets a verified destination and a due rule next to owner A's sentinel. +await worker('destination', { ownerId: ownerB, configRef: ref, fingerprint, label: 'Second owner channel', maskedDestination: 'Discord …0002' }); +const destinationB = (await status(ownerB)).destinations[0].id; +const ruleB = await mutate(ownerB, 'create', null, { ...config, destinationId: destinationB }); +const ruleA = sentinelId; +const resetClaims = async () => { await db.exec('reset role'); await sql('update public.alert_rules set last_attempt_at=null,next_check=null,check_token=null,check_lease_until=null,check_lease_kind=null'); }; +/** Sixty-one seconds pass: every timestamp the scheduler orders by moves back, keeping its order. */ +const minutePasses = async () => { await db.exec('reset role'); await sql("update public.alert_rules set last_attempt_at=last_attempt_at-interval '61 seconds',next_check=next_check-interval '61 seconds'"); }; +async function completeClaim(claimed) { + const at = new Date(); + const claimedMonitor = { ...monitor, ruleId: claimed.id, ruleVersion: claimed.version, ownerId: claimed.owner_id, lastFreshCheck: at.toISOString(), inputExpiresAt: new Date(at.getTime() + 120000).toISOString(), nextCheckAt: new Date(at.getTime() + 60000).toISOString(), lastTriggeredAt: at.toISOString() }; + const claimedObservation = { ...observation, ruleId: claimed.id, ruleVersion: claimed.version, metric: claimed.metric, unit: claimed.unit, ...(claimed.market ? { market: claimed.market } : {}) }; + check((await worker('complete_check', { ruleId: claimed.id, version: claimed.version, token: claimed.check_token, monitor: claimedMonitor, observation: claimedObservation, event: null })).available, true); +} +let tick = 10; +async function scheduledTick() { + const runKey = `cron:${tick++}`; + await worker('start', { runKey, mode: 'dry_run' }); + const claimed = await worker('claim_check'); + if (claimed) await completeClaim(claimed); + await worker('end', { runKey, outcome: 'ok' }); + return claimed?.id ?? null; +} +// Owner A edits their rule every minute. Each edit resets next_check to null, which used to put the +// rule first in a queue the worker drains one rule per minute, so owner B's rule was never checked. +await resetClaims(); +const served = []; +for (let cycle = 1; cycle <= 4; cycle++) { + await mutate(ownerA, 'update', ruleA, { threshold: `${cycle}` }); + served.push(await scheduledTick()); + await minutePasses(); +} +check(served, [ruleA, ruleB, ruleA, ruleB]); +// One claimed check per owner per minute: right after A's rule was claimed, nothing else of A's is due. +await resetClaims(); +check((await worker('claim_check')).id, ruleA); +check((await worker('claim_check', { ownerId: ownerA, ruleId: ruleA })), null); +await db.exec('reset role'); await sql('update public.alert_rules set check_token=null,check_lease_until=null,check_lease_kind=null'); +// A manual check holds its own, owner-scoped lease: the scheduled tick still claims owner B's rule +// while owner A's manual check is in flight, a second scheduled lease is refused, and the owner's +// own second manual check waits for the first. +await resetClaims(); +const manualRun = 'manual:00000000-0000-4000-8000-0000000000a0'; +check(await worker('start', { runKey: manualRun, mode: 'dry_run', ownerId: ownerA }), { duplicate: false }); +const manualClaim = await worker('claim_check', { ownerId: ownerA, ruleId: ruleA }); +check([manualClaim.id, manualClaim.check_lease_kind], [ruleA, 'manual']); +check(await worker('claim_check', { ownerId: ownerA, ruleId: ruleA }), null); +const scheduledDuringManual = await worker('claim_check'); +check([scheduledDuringManual.id, scheduledDuringManual.check_lease_kind], [ruleB, 'scheduled']); +check(await worker('claim_check'), null); +await completeClaim(manualClaim); await completeClaim(scheduledDuringManual); +await worker('end', { runKey: manualRun, outcome: 'ok' }); +check((await status(ownerA)).rules.find(item => item.id === ruleA).check_lease_kind, null); +// Manual leases are per owner: owner B's manual check proceeds while owner A's is in flight. +await minutePasses(); +const manualA = await worker('claim_check', { ownerId: ownerA, ruleId: ruleA }); +const manualB = await worker('claim_check', { ownerId: ownerB, ruleId: ruleB }); +check([manualA.check_lease_kind, manualB.check_lease_kind], ['manual', 'manual']); +check(await worker('claim_check', { ownerId: ownerA, ruleId: ruleA }), null); +await completeClaim(manualA); await completeClaim(manualB); +// A claim that names only the rule is a manual claim scoped to that rule's owner. +await minutePasses(); +const byRuleOnly = await worker('claim_check', { ruleId: ruleA }); +check([byRuleOnly.id, byRuleOnly.check_lease_kind], [ruleA, 'manual']); +check(await worker('claim_check', { ownerId: ownerA, ruleId: ruleA }), null); +check(await worker('claim_check', { ruleId: '00000000-0000-4000-8000-00000000ffff' }), null); +await completeClaim(byRuleOnly); +// Manual checks are capped at 60 per owner per hour, beyond the existing 30 per minute. +await db.exec('reset role'); +await sql(`insert into private.buffer_monitor_runs(run_key,mode,owner_id,started_at) select 'manual:'||gen_random_uuid(),'dry_run',$1,now()-interval '30 minutes' from generate_series(1,60)`, [ownerA]); +check(await worker('start', { runKey: 'manual:00000000-0000-4000-8000-0000000000a1', mode: 'dry_run', ownerId: ownerA }), { duplicate: true, throttled: true }); +check(await worker('start', { runKey: 'manual:00000000-0000-4000-8000-0000000000b1', mode: 'dry_run', ownerId: ownerB }), { duplicate: false }); +await worker('end', { runKey: 'manual:00000000-0000-4000-8000-0000000000b1', outcome: 'ok' }); + +// --- Worker secret lockout (20261019090000_worker_secret_lockout.sql). +const wrongSecret = 'wrong-secret-that-is-long-enough-to-pass-the-length-check'; +const notices = []; +async function attempt(credential) { + await role('anon'); + return db.query('select public.buffer_monitor_worker($1,$2,$3) as result', [credential, 'prune', {}], { onNotice: notice => notices.push(notice) }); +} +const minuteNow = async () => Number((await sql("select floor(extract(epoch from now())/60)::bigint as m")).rows[0].m); +const failureCounter = async () => { await db.exec('reset role'); return Number((await sql('select last_value as v from private.buffer_monitor_auth_failures')).rows[0].v); }; +const authError = message => error => error.code === '42501' && error.message === message; +// The window is a calendar minute. Start the proof only with ten seconds or more of the minute left. +const secondOfMinute = Number((await sql('select extract(second from now())::int as s')).rows[0].s); +if (secondOfMinute >= 50) await new Promise(resolve => setTimeout(resolve, (61 - secondOfMinute) * 1000)); +await db.exec('reset role'); +const minute = await minuteNow(); +await sql(`select setval('private.buffer_monitor_auth_failures', ${minute}::bigint * 1000 + 8, true)`); +// Each failure is counted although the call ends in the exception the server relies on. +await assert.rejects(attempt(wrongSecret), authError('Worker authentication required')); checks++; +check(await failureCounter(), minute * 1000 + 9); +check((await attempt(secret)).rows[0].result, {}); +await assert.rejects(attempt(wrongSecret), authError('Worker authentication required')); checks++; +check(await failureCounter(), minute * 1000 + 10); +// Ten failures: every call is refused for the rest of the minute, the right secret included, and refusals do not count. +await assert.rejects(attempt(secret), authError('Worker authentication paused')); checks++; +await assert.rejects(attempt(wrongSecret), authError('Worker authentication paused')); checks++; +check(await failureCounter(), minute * 1000 + 10); +check(await minuteNow(), minute); +// The minute ends: the next failure starts a new count and a valid call works again. +await sql(`select setval('private.buffer_monitor_auth_failures', ${minute - 1}::bigint * 1000 + 10, true)`); +check((await attempt(secret)).rows[0].result, {}); +await assert.rejects(attempt(wrongSecret), authError('Worker authentication required')); checks++; +check(await failureCounter(), minute * 1000 + 1); +// Failures and refusals are logged as warnings that carry a count, never a secret. +const warnings = notices.filter(notice => notice.severity === 'WARNING').map(notice => notice.message); +check(warnings.filter(message => /^buffer_monitor_worker: authentication failed \((9|10|1) this minute\)$/.test(message)).length, 3); +check(warnings.filter(message => message === 'buffer_monitor_worker: refusing every call until the minute ends after 10 failed authentication attempts').length, 2); +check(notices.some(notice => JSON.stringify(notice).includes(wrongSecret) || JSON.stringify(notice).includes(secret)), false); +for (const name of ['anon', 'authenticated', 'service_role']) { + const row = (await sql(`select has_sequence_privilege($1,'private.buffer_monitor_auth_failures','SELECT') as readable, has_sequence_privilege($1,'private.buffer_monitor_auth_failures','UPDATE') as writable`, [name])).rows[0]; + check(row, { readable: false, writable: false }); +} await db.close(); console.log(JSON.stringify({ result: 'PASS', assertions: checks, database: 'local PostgreSQL (PGlite)', externalWrites: false, outboundMessages: 0 }, null, 2)); diff --git a/scripts/verify-rate-limit.mjs b/scripts/verify-rate-limit.mjs new file mode 100644 index 0000000..ee8dc5f --- /dev/null +++ b/scripts/verify-rate-limit.mjs @@ -0,0 +1,250 @@ +/** + * Local PostgreSQL/WASM checks for the rate-limit retention and keyed-hash + * migration. No hosted connection and no external writes. + * + * `hosted` reproduces the production limiter as it was before this migration + * (definitions and grants read, read-only, from the Buffer project), holding + * counters stored under the old unkeyed SHA-256, with pg_cron present. + * `fresh` starts empty, as a new project does, without pg_cron. + * As on hosted Supabase, the migration runs as a non-superuser role that owns + * the limiter objects (there it is `postgres`; PGlite's superuser has that name). + */ +import { createHash, createHmac } from 'node:crypto'; +import { readFile } from 'node:fs/promises'; +import assert from 'node:assert/strict'; +import { createDatabase } from './lib/pglite.mjs'; + +const MIGRATION = '20261008120000_rate_limit_retention_and_keyed_hash.sql'; +const migration = await readFile(new URL(`../supabase/migrations/${MIGRATION}`, import.meta.url), 'utf8'); +const SECRET = 'f'.repeat(64); +const WINDOW = 60; +let checks = 0; + +const sha256 = value => createHash('sha256').update(value).digest('hex'); +/** The key the deployed server sends (src/server/rate-limit.ts clientKey). */ +const deployedKey = (scope, ip) => `${scope}:${sha256(ip).slice(0, 32)}`; +const rows = async (db, query, params = []) => (await db.query(query, params)).rows; +async function check(db, query, expected, params = []) { assert.deepEqual(await rows(db, query, params), expected); checks++; } +async function rejects(db, role, query, code) { + await db.exec(`reset role; set role ${role}`); + try { await assert.rejects(db.query(query), error => error.code === code, `${role}: ${query}`); checks++; } + finally { await db.exec('reset role'); } +} +async function consume(db, key, { role = 'anon', secret = SECRET, limit = 3, window = WINDOW } = {}) { + await db.exec(`reset role; set role ${role}`); + try { return (await db.query('select * from public.consume_rate_limit($1, $2, $3, $4)', [secret, key, limit, window])).rows[0]; } + finally { await db.exec('reset role'); } +} +const hashKey = async db => Buffer.from((await rows(db, "select encode(key, 'hex') as k from private.rate_limit_hash_key"))[0].k, 'hex'); +/** allowed and remaining are exact; retry_after is the ceiling of the time left, so it may tick down. */ +function expectResult(result, allowed, remaining) { + assert.equal(result.allowed, allowed); assert.equal(result.remaining, remaining); + assert.ok(Number.isInteger(result.retry_after) && result.retry_after >= 1 && result.retry_after <= WINDOW, `retry_after ${result.retry_after}`); + checks++; +} +const storedKeys = async db => (await rows(db, 'select key from private.rate_limits order by key')).map(row => row.key); + +async function supabaseRoles(db) { + await db.exec(` + create role anon; create role authenticated; create role service_role bypassrls; + grant usage on schema public to anon, authenticated, service_role; + -- Supabase grants browser roles EXECUTE on new public functions directly, + -- so revoking PUBLIC alone would leave them able to call a new function. + create role buffer_owner; + alter default privileges in schema public grant execute on functions to anon, authenticated, service_role; + alter default privileges for role buffer_owner in schema public grant execute on functions to anon, authenticated, service_role; + create schema extensions; create extension pgcrypto with schema extensions; + grant usage on schema extensions to buffer_owner; + -- Hosted postgres owns the database; CREATE SCHEMA IF NOT EXISTS checks this first. + do $$ begin execute format('grant create on database %I to buffer_owner', current_database()); end $$; + grant usage, create on schema public to buffer_owner; + create schema private authorization buffer_owner; + `); +} +const asOwner = sql => `set role buffer_owner; ${sql}; reset role;`; + +// ---------------------------------------------------------------- hosted +const hosted = createDatabase(); +await supabaseRoles(hosted); +await hosted.exec(` + set role buffer_owner; + create table private.rate_limit_config(id boolean primary key default true check (id), secret text not null default encode(extensions.gen_random_bytes(32), 'hex')); + create table private.rate_limits(key text primary key, count integer not null, window_start timestamptz not null); + create function private.prune_rate_limits() returns void language sql security definer set search_path = '' + as $$ delete from private.rate_limits where window_start < now() - interval '1 hour'; $$; + create function public.consume_rate_limit(p_secret text, p_key text, p_limit integer, p_window_seconds integer) + returns table(allowed boolean, remaining integer, retry_after integer) + language plpgsql security definer set search_path to 'private', 'pg_temp' + as $function$ + declare + v_now timestamptz := now(); + v_count integer; + v_start timestamptz; + begin + if p_secret is null or p_secret <> (select secret from private.rate_limit_config where id) then + return query select false, 0, p_window_seconds; + return; + end if; + if p_key is null or length(p_key) > 200 or p_limit < 1 or p_window_seconds < 1 then + return query select false, 0, p_window_seconds; + return; + end if; + insert into private.rate_limits (key, count, window_start) + values (p_key, 1, v_now) + on conflict (key) do update + set count = case when private.rate_limits.window_start + make_interval(secs => p_window_seconds) <= v_now then 1 else private.rate_limits.count + 1 end, + window_start = case when private.rate_limits.window_start + make_interval(secs => p_window_seconds) <= v_now then v_now else private.rate_limits.window_start end + returning count, window_start into v_count, v_start; + return query select + v_count <= p_limit, + greatest(p_limit - v_count, 0), + greatest(ceil(extract(epoch from (v_start + make_interval(secs => p_window_seconds) - v_now)))::integer, 1); + end; + $function$; + insert into private.rate_limit_config(secret) values ('${SECRET}'); + reset role; + -- pg_cron as hosted: extension metadata plus a cron.schedule stub that records jobs by name. + insert into pg_catalog.pg_extension(oid, extname, extowner, extnamespace, extrelocatable, extversion) + values (777778, 'pg_cron', current_user::regrole, 'pg_catalog'::regnamespace, false, '1.6.4'); + create schema cron; + create table cron.job(jobid bigserial primary key, jobname text unique, schedule text not null, command text not null, username text not null default current_user); + create function cron.schedule(job_name text, schedule text, command text) returns bigint language sql as $$ + insert into cron.job(jobname, schedule, command) values (job_name, schedule, command) + on conflict (jobname) do update set schedule = excluded.schedule, command = excluded.command returning jobid $$; + grant usage on schema cron to buffer_owner; + grant select, insert, update on cron.job to buffer_owner; + grant usage on sequence cron.job_jobid_seq to buffer_owner; +`); + +// Before: the deployed key is stored as sent, an unkeyed SHA-256 that anyone can recompute from an IP. +const IPS = ['203.0.113.7', '198.51.100.23', '2001:db8::1']; +await hosted.exec(`insert into private.rate_limits values + ('${deployedKey('live-read', IPS[0])}', 4, '2026-09-17 17:42:03+00'), + ('${deployedKey('monitoring', IPS[1])}', 1, '2026-10-07 09:33:43+00')`); +await consume(hosted, deployedKey('live-read', IPS[2])); +const before = await storedKeys(hosted); +assert.ok(before.includes(deployedKey('live-read', IPS[2])), 'fixture reproduces the unkeyed finding'); checks++; +await check(hosted, "select count(*)::int as n from private.rate_limits where window_start < '2026-09-18 00:00+00'", [{ n: 1 }]); + +await hosted.exec(asOwner(migration)); + +// Retention: every row stored under the unkeyed hash is gone, including the 17 September one. +await check(hosted, 'select count(*)::int as n from private.rate_limits', [{ n: 0 }]); +// The configured secret survives, so the deployed RATE_LIMIT_SECRET keeps working. +await check(hosted, 'select secret from private.rate_limit_config', [{ secret: SECRET }]); + +// Keyed hash: the deployed request is stored as HMAC-SHA-256(database key, p_key). +const key = await hashKey(hosted); +assert.equal(key.length, 32); checks++; +const sent = deployedKey('live-read', IPS[0]); +expectResult(await consume(hosted, sent), true, 2); +const [stored] = await storedKeys(hosted); +assert.equal(stored, createHmac('sha256', key).update(sent).digest('hex')); checks++; +for (const unkeyed of [sent, sha256(sent), sha256(IPS[0]), sha256(IPS[0]).slice(0, 32)]) { assert.notEqual(stored, unkeyed); checks++; } +assert.ok(!stored.includes(sha256(IPS[0]).slice(0, 32)) && !stored.includes('live-read'), 'no unkeyed fragment or scope is stored'); checks++; + +// Limits are still enforced per key, and scopes stay separate. +expectResult(await consume(hosted, sent), true, 1); +expectResult(await consume(hosted, sent), true, 0); +expectResult(await consume(hosted, sent), false, 0); +assert.equal((await consume(hosted, deployedKey('monitoring', IPS[0]))).allowed, true); checks++; +await check(hosted, 'select count::int as n from private.rate_limits order by count desc limit 1', [{ n: 4 }]); +await check(hosted, `select count(*)::int as n from private.rate_limits where expires_at = window_start + interval '${WINDOW} seconds'`, [{ n: 2 }]); +// Rollover: a counter whose window has passed, before any prune removes it, starts a new window and a new expiry. +await hosted.query("update private.rate_limits set window_start = now() - interval '2 minutes' where key = $1", [stored]); +expectResult(await consume(hosted, sent), true, 2); +await check(hosted, `select count::int as n, expires_at = window_start + interval '${WINDOW} seconds' and window_start > now() - interval '1 minute' as renewed from private.rate_limits where key = $1`, [{ n: 1, renewed: true }], [stored]); + +// Rejected calls write nothing: wrong, missing or browser-guessed secrets, bad keys and bad limits. +for (const [label, options, call] of [ + ['wrong secret', { secret: 'guess' }, sent], ['null secret', { secret: null }, sent], + ['oversized key', {}, 'k'.repeat(201)], ['zero limit', { limit: 0 }, sent], ['zero window', { window: 0 }, sent], + ['null limit', { limit: null }, sent], ['null window', { window: null }, sent], + // The privacy policy's retention period assumes one-minute windows. + ['window over a minute', { window: WINDOW + 1 }, sent], +]) { + const before = await rows(hosted, 'select key, count from private.rate_limits order by key'); + const result = await consume(hosted, call, options); + assert.equal(result.allowed, false, label); assert.equal(result.remaining, 0, label); + assert.deepEqual(await rows(hosted, 'select key, count from private.rate_limits order by key'), before, label); checks++; +} + +// The check prunes expired counters, its own included, before counting. +await hosted.exec("update private.rate_limits set window_start = now() - interval '2 minutes', expires_at = now() - interval '1 minute'"); +expectResult(await consume(hosted, sent), true, 2); +await check(hosted, 'select count(*)::int as n, min(count)::int as c from private.rate_limits', [{ n: 1, c: 1 }]); +// The scheduled pruner deletes only expired counters. +await hosted.exec(`insert into private.rate_limits values ('expired', 1, now() - interval '3 minutes', now() - interval '2 minutes')`); +await hosted.query('select private.prune_rate_limits()'); +await check(hosted, "select count(*)::int as n from private.rate_limits where key = 'expired'", [{ n: 0 }]); +await check(hosted, 'select count(*)::int as n from private.rate_limits', [{ n: 1 }]); +const jobs = await rows(hosted, 'select jobname, schedule, command, username from cron.job order by jobid'); +assert.deepEqual(jobs, [{ jobname: 'buffer-prune-rate-limits', schedule: '*/3 * * * *', command: 'select private.prune_rate_limits()', username: 'buffer_owner' }]); checks++; +// pg_cron runs the command as the job's user, the owner, despite the revokes. +await hosted.exec(`insert into private.rate_limits values ('idle', 1, now() - interval '4 minutes', now() - interval '3 minutes')`); +await hosted.exec(`set role ${jobs[0].username}; ${jobs[0].command}; reset role;`); +await check(hosted, "select count(*)::int as n from private.rate_limits where key = 'idle'", [{ n: 0 }]); + +// A missing key fails loudly: the RPC errors, so the server falls back to its per-process limit. +await hosted.exec('create table private.saved_key as select * from private.rate_limit_hash_key; delete from private.rate_limit_hash_key;'); +await rejects(hosted, 'anon', `select * from public.consume_rate_limit('${SECRET}', '${sent}', 3, ${WINDOW})`, '55000'); +await hosted.exec('insert into private.rate_limit_hash_key select * from private.saved_key; drop table private.saved_key;'); + +// Privileges. Only anon (the server's publishable key) may call the limiter, and only with the secret. +const limiter = 'public.consume_rate_limit(text,text,integer,integer)'; +for (const [role, permitted] of [['anon', true], ['authenticated', false], ['service_role', false]]) { + await check(hosted, `select has_function_privilege('${role}', '${limiter}', 'EXECUTE') as p`, [{ p: permitted }]); + await check(hosted, `select has_function_privilege('${role}', 'private.prune_rate_limits()', 'EXECUTE') as p`, [{ p: false }]); + for (const table of ['rate_limit_hash_key', 'rate_limits', 'rate_limit_config']) { + await check(hosted, `select has_table_privilege('${role}', 'private.${table}', 'SELECT, INSERT, UPDATE, DELETE') as p`, [{ p: false }]); + await rejects(hosted, role, `select * from private.${table}`, '42501'); + } + await rejects(hosted, role, 'select private.prune_rate_limits()', '42501'); +} +await rejects(hosted, 'authenticated', `select * from public.consume_rate_limit('${SECRET}', 'x', 3, 60)`, '42501'); +await check(hosted, `select relname, relrowsecurity as rls from pg_class where relnamespace = 'private'::regnamespace and relkind = 'r' and relname like 'rate_limit%' order by 1`, + [{ relname: 'rate_limit_config', rls: true }, { relname: 'rate_limit_hash_key', rls: true }, { relname: 'rate_limits', rls: true }]); +await check(hosted, `select proname, prosecdef as definer, proconfig as config, pg_get_userbyid(proowner) as owner from pg_proc where oid in ('${limiter}'::regprocedure, 'private.prune_rate_limits()'::regprocedure) order by 1`, + [{ proname: 'consume_rate_limit', definer: true, config: ['search_path=""'], owner: 'buffer_owner' }, { proname: 'prune_rate_limits', definer: true, config: ['search_path=""'], owner: 'buffer_owner' }]); +await check(hosted, "select pg_get_userbyid(relowner) as owner from pg_class where oid = 'private.rate_limit_hash_key'::regclass", [{ owner: 'buffer_owner' }]); +// Row-level security is a second barrier: even a mistaken grant reveals no key. +await hosted.exec('grant usage on schema private to anon; grant select on private.rate_limit_hash_key to anon; set role anon;'); +await check(hosted, 'select count(*)::int as n from private.rate_limit_hash_key', [{ n: 0 }]); +await hosted.exec('reset role; revoke select on private.rate_limit_hash_key from anon; revoke usage on schema private from anon;'); + +// Re-running the migration is harmless: same key, one job, counters cleared. +await hosted.exec(asOwner(migration)); +assert.deepEqual(await hashKey(hosted), key); checks++; +await check(hosted, 'select count(*)::int as n from cron.job', [{ n: 1 }]); +await check(hosted, 'select count(*)::int as n from private.rate_limits', [{ n: 0 }]); + +// ----------------------------------------------------------------- fresh +const fresh = createDatabase(); +await supabaseRoles(fresh); +await fresh.exec(asOwner(migration)); +const freshSecret = (await rows(fresh, 'select secret from private.rate_limit_config'))[0].secret; +assert.match(freshSecret, /^[0-9a-f]{64}$/); checks++; +assert.equal((await consume(fresh, sent, { secret: SECRET })).allowed, false, 'an unknown secret is refused'); checks++; +assert.equal((await consume(fresh, sent, { secret: freshSecret })).allowed, true); checks++; +const [freshStored] = await storedKeys(fresh); +assert.equal(freshStored, createHmac('sha256', await hashKey(fresh)).update(sent).digest('hex')); checks++; +assert.notEqual(freshStored, stored, 'each database has its own key'); checks++; +for (const [role, permitted] of [['anon', true], ['authenticated', false], ['service_role', false]]) { + await check(fresh, `select has_function_privilege('${role}', '${limiter}', 'EXECUTE') as p`, [{ p: permitted }]); +} +// The empty search_path and qualified names mean a caller's temp tables or a public function cannot stand in. +await fresh.exec(`create function public.hmac(bytea, bytea, text) returns bytea language sql as $$ select '\\x00'::bytea $$; + set role anon; + create temp table rate_limit_hash_key(id boolean, key bytea); insert into rate_limit_hash_key values (true, '\\x${'00'.repeat(32)}'); + create temp table rate_limits(key text, count integer, window_start timestamptz, expires_at timestamptz); + reset role;`); +assert.equal((await consume(fresh, 'shadow-test', { secret: freshSecret })).allowed, true); checks++; +await check(fresh, 'select count(*)::int as n from private.rate_limits where key = $1', [{ n: 1 }], [createHmac('sha256', await hashKey(fresh)).update('shadow-test').digest('hex')]); +await check(fresh, 'select count(*)::int as n from pg_temp.rate_limits', [{ n: 0 }]); +// With no configured secret at all, nothing passes (the hosted version accepted any secret then). +await fresh.exec('delete from private.rate_limit_config'); +assert.equal((await consume(fresh, sent, { secret: 'anything' })).allowed, false); checks++; + +await hosted.close(); +await fresh.close(); +console.log(JSON.stringify({ result: 'PASS', assertions: checks, migration: MIGRATION, database: 'local PostgreSQL (PGlite)', externalWrites: false }, null, 2)); diff --git a/scripts/verify-saved-report-quota.mjs b/scripts/verify-saved-report-quota.mjs new file mode 100644 index 0000000..d7ec38b --- /dev/null +++ b/scripts/verify-saved-report-quota.mjs @@ -0,0 +1,94 @@ +/** + * Local PostgreSQL/WASM checks for the saved-report quota. No hosted connection. + * The Auth API accepts sign-ups even while the form is gated, so the database + * must bound what one account can store; this proves the trigger does, as the + * real `authenticated` role under row-level security. + */ +import { readFile } from 'node:fs/promises'; +import assert from 'node:assert/strict'; +import { createDatabase } from './lib/pglite.mjs'; + +const MIGRATIONS = ['20260911170941_create_saved_reports.sql', '20260911171816_enforce_saved_report_title_length.sql', '20261019091500_saved_report_quota.sql']; +const QUOTA_CODE = '54000'; +const MAX_ROWS = 50; +const MAX_BYTES = 8 * 1024 * 1024; +const db = createDatabase(); +let checks = 0; +const ownerA = '00000000-0000-4000-8000-00000000000a'; +const ownerB = '00000000-0000-4000-8000-00000000000b'; +const ownerC = '00000000-0000-4000-8000-00000000000c'; +const sql = (query, params = []) => db.query(query, params); +const rows = async (query, params = []) => (await sql(query, params)).rows; +async function check(query, expected, params = []) { assert.deepEqual(await rows(query, params), expected); checks++; } +async function refused(promise, code, test = () => true) { await assert.rejects(promise, error => error.code === code && test(error)); checks++; } +async function as(owner) { await db.exec(`reset role; set role authenticated; select set_config('request.jwt.claim.sub','${owner}',false);`); } +const report = (padding = 0) => ({ report: 'Buffer perpetual price scenario', version: 1, sourceMode: 'sample', scenario: {}, ...(padding ? { padding: 'x'.repeat(padding) } : {}) }); +const insert = (owner, title, body) => sql('insert into public.saved_reports(user_id,title,report) values ($1,$2,$3)', [owner, title, body]); +const quotaError = error => error.hint === 'Delete a saved report to make room.' && !error.message.includes(ownerA); + +await db.exec(` + create role anon; create role authenticated; create role service_role bypassrls; + create schema auth; create table auth.users(id uuid primary key); + create function auth.uid() returns uuid language sql stable as $$ select nullif(current_setting('request.jwt.claim.sub',true),'')::uuid $$; + grant usage on schema auth, public to anon, authenticated, service_role; + grant execute on function auth.uid() to anon, authenticated, service_role; + -- Supabase grants browser roles EXECUTE on new functions directly; the revoke must undo that too. + alter default privileges in schema public grant execute on functions to anon, authenticated, service_role; + insert into auth.users values ('${ownerA}'),('${ownerB}'),('${ownerC}'); +`); +for (const name of MIGRATIONS) await db.exec(await readFile(new URL(`../supabase/migrations/${name}`, import.meta.url), 'utf8')); + +// The trigger is installed, and nothing but the trigger may run its function. +await check("select tgname from pg_trigger where tgrelid='public.saved_reports'::regclass and not tgisinternal order by 1", [{ tgname: 'saved_reports_quota' }]); +for (const role of ['anon', 'authenticated', 'service_role']) { + await check(`select has_function_privilege('${role}','private.enforce_saved_report_quota()','EXECUTE') as permitted`, [{ permitted: false }]); +} + +// Row cap: the 50th report saves, the 51st is refused with a fixed code and hint, nothing is written. +await as(ownerA); +for (let index = 1; index <= MAX_ROWS; index++) await insert(ownerA, `Report ${index}`, report()); +await check('select count(*)::int as n from public.saved_reports', [{ n: MAX_ROWS }]); +await refused(insert(ownerA, 'One too many', report()), QUOTA_CODE, error => quotaError(error) && error.message.startsWith('Saved report limit reached')); +await check('select count(*)::int as n from public.saved_reports', [{ n: MAX_ROWS }]); +// Another account is not affected by a full one. +await as(ownerB); +await insert(ownerB, 'B first', report()); +await check('select count(*)::int as n from public.saved_reports', [{ n: 1 }]); +// Deleting makes room for exactly as many as were deleted. +await as(ownerA); +await sql("delete from public.saved_reports where title in ('Report 1','Report 2')"); +await insert(ownerA, 'Replacement 1', report()); +await insert(ownerA, 'Replacement 2', report()); +await refused(insert(ownerA, 'Still one too many', report()), QUOTA_CODE, quotaError); +await check('select count(*)::int as n from public.saved_reports', [{ n: MAX_ROWS }]); + +// Byte cap: 32 reports of 260,000 bytes fit (8,320,000 bytes), a small one still fits, the next large one does not. +const large = report(259_900); +const largeBytes = (await rows('select octet_length($1::jsonb::text) as n', [large]))[0].n; +assert.ok(largeBytes <= 262144 && largeBytes >= 259_900, `large report is ${largeBytes} bytes`); checks++; +await as(ownerC); +for (let index = 1; index <= 32; index++) await insert(ownerC, `Large ${index}`, large); +const held = () => rows('select count(*)::int as n, sum(octet_length(report::text))::bigint as bytes from public.saved_reports'); +const afterLarge = (await held())[0]; +assert.equal(afterLarge.n, 32); assert.ok(Number(afterLarge.bytes) > 8_000_000 && Number(afterLarge.bytes) < MAX_BYTES, `held ${afterLarge.bytes}`); checks++; +await insert(ownerC, 'Small still fits', report()); +await refused(insert(ownerC, 'Past eight MiB', large), QUOTA_CODE, error => quotaError(error) && error.message.startsWith('Saved report storage limit reached')); +await check('select count(*)::int as n from public.saved_reports', [{ n: 33 }]); +// The existing per-report cap (256 KiB) is still the table's own CHECK, with its own code. BEFORE INSERT +// triggers run before constraints, so it is proved on an account with room. +await as(ownerB); +await refused(insert(ownerB, 'Oversized single report', report(262_144)), '23514'); +await as(ownerC); +// Deleting a large report frees its bytes. +await sql("delete from public.saved_reports where title='Large 1'"); +await insert(ownerC, 'Large again', large); +await check('select count(*)::int as n from public.saved_reports', [{ n: 33 }]); + +// Browser roles without a session still cannot insert at all. +await db.exec('reset role; set role anon'); +await refused(insert(ownerA, 'Anonymous', report()), '42501'); +await db.exec('reset role'); +await check('select user_id, count(*)::int as n from public.saved_reports group by user_id order by user_id', [{ user_id: ownerA, n: MAX_ROWS }, { user_id: ownerB, n: 1 }, { user_id: ownerC, n: 33 }]); + +await db.close(); +console.log(JSON.stringify({ result: 'PASS', assertions: checks, migration: MIGRATIONS[2], database: 'local PostgreSQL (PGlite)', externalWrites: false }, null, 2)); diff --git a/src/app/globals.css b/src/app/globals.css index a4565f6..93bff59 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -342,7 +342,7 @@ svg { gap: 16px; } .address-bottom p { - font-size: 11px; + font-size:12px; color: var(--muted); } .sample-picker { @@ -370,7 +370,7 @@ svg { display: flex; gap: 9px; align-items: center; - font-size: 11px; + font-size:12px; color: var(--muted); padding: 16px 0 8px; } @@ -464,7 +464,7 @@ svg { } .freshness small { display: block; - font-size: 9px; + font-size:11px; color: var(--muted); margin-top: 5px; } @@ -489,7 +489,7 @@ svg { .section-kicker span { font-weight: 400; letter-spacing: 0; - font-size: 10px; + font-size:11px; } .metrics { display: grid; @@ -526,7 +526,7 @@ svg { letter-spacing: 0; } .metric p { - font-size: 10px; + font-size:12px; color: var(--muted); margin-top: 5px; line-height: 1.6; @@ -715,7 +715,7 @@ td > small { .market-directory input { width: 100%; min-height: 44px; border: 1px solid #dbe3f1; border-radius: 9px; padding: 10px 12px; background: #f8faff; color: var(--text); font: inherit; font-size: 16px; } .market-symbols { display: flex; flex-wrap: wrap; gap: 7px; max-height: 205px; overflow-y: auto; margin: 13px 0; padding: 1px; } .market-symbols > span { padding: 7px 9px; border: 1px solid #e3e9f4; border-radius: 6px; background: #f8faff; font-size: 11px; font-weight: 600; } -.market-directory-content p { color: var(--muted); font-size: 11px; line-height: 1.6; margin: 0; } +.market-directory-content p { color: var(--muted); font-size:12px; line-height: 1.6; margin: 0; } .live-example { display: flex; flex-wrap: wrap; @@ -770,7 +770,7 @@ td > small { .table-note { padding: 13px 21px; color: var(--muted); - font-size: 9px; + font-size:12px; } .inventory .panel-heading { padding-bottom: 16px; @@ -1066,18 +1066,18 @@ input[type="range"]::-moz-range-thumb { color: #658096; } .coverage strong { - font-size: 10px; + font-size:12px; font-weight: 550; } .coverage p { - font-size: 9px; + font-size:12px; color: var(--muted); margin-top: 3px; line-height: 1.7; } .assumption-line { margin: 0 24px 18px; - font-size: 9px; + font-size:12px; color: var(--muted); line-height: 1.8; } @@ -1205,7 +1205,7 @@ footer { } .source-warnings { margin-top: 15px; - font-size: 10px; + font-size:12px; color: var(--muted); } .source-warnings p { @@ -1572,7 +1572,7 @@ footer { } .address-bottom p { max-width: none; - font-size: 10px; + font-size:12px; line-height: 1.7; } .sample-picker { @@ -1587,7 +1587,7 @@ footer { } .sample-note { align-items: start; - font-size: 10px; + font-size:12px; line-height: 1.7; padding-top: 15px; } @@ -1628,7 +1628,7 @@ footer { padding-left: 46px; } .freshness small { - font-size: 8px; + font-size:11px; } .freshness span { font-size: 9px; @@ -1640,7 +1640,7 @@ footer { gap: 15px; } .section-kicker span { - font-size: 9px; + font-size:11px; text-align: right; max-width: 170px; } @@ -1672,7 +1672,7 @@ footer { } .metric p { grid-column: 1 / -1; - font-size: 9px; + font-size:12px; margin: 3px 0 0; } .metric-value.unavailable { @@ -1743,7 +1743,7 @@ footer { font-size: 12px; } .table-note { - font-size: 8px; + font-size:12px; padding: 12px 17px; } .inventory-group { diff --git a/src/app/landing.css b/src/app/landing.css index 2d16a75..ac3f520 100644 --- a/src/app/landing.css +++ b/src/app/landing.css @@ -163,6 +163,7 @@ .buffer-privacy h2 { font-size: 34px; letter-spacing: -1.4px; margin-top: 6px; } .buffer-privacy p { font-size: 12px; line-height: 1.85; color: var(--quiet); max-width: 392px; } .buffer-privacy .buffer-text-link { margin-top: 19px; } +.buffer-privacy-links { display: flex; flex-wrap: wrap; gap: 0 28px; } .buffer-faq { display: grid; grid-template-columns: 1fr 1.25fr; gap: 70px; } .buffer-faq h2 { margin: 25px 0; } .buffer-faq-list { border-top: 1px solid var(--line); } @@ -178,7 +179,7 @@ .buffer-last-call .buffer-cta { background: #fff; color: var(--cobalt) !important; } .buffer-last-call .buffer-cta > span { background: #e9edff; } .buffer-footer { margin: 0; padding: 56px max(48px, calc((100vw - 1296px) / 2)) 25px; border: 0; display: block; color: var(--ink); background: #f0f1e9; } -.buffer-footer-top { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 35px; } +.buffer-footer-top { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 35px; } .buffer-footer-top > p { font-size: 22px; line-height: 1.3; letter-spacing: -.6px; } .buffer-footer nav { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; font-size: 11px; } .buffer-footer nav a:hover { color: var(--cobalt); } @@ -587,3 +588,8 @@ html[data-buffer-scroll="smooth"] { scroll-behavior: smooth; } html[data-buffer-scroll="smooth"] { scroll-behavior: auto; } .buffer-site [data-scroll-depth] { transform: none !important; } } +/* The footer gained a legal column; give it a row of its own before phones stack it. */ +@media (min-width: 521px) and (max-width: 800px) { .buffer-footer-top { grid-template-columns: repeat(3, minmax(0, 1fr)); } .buffer-footer-top > p { grid-column: 1 / -1; } } +/* The read-only note wraps on phones; keep its check mark on the first line instead of stranded beside a centred block. */ +.buffer-site .buffer-hero-note { display: block; text-align: center; text-wrap: balance; } +.buffer-site .buffer-hero-note svg { display: inline-block; margin-right: 6px; vertical-align: -3px; } diff --git a/src/app/privacy/page.tsx b/src/app/privacy/page.tsx new file mode 100644 index 0000000..47af0ef --- /dev/null +++ b/src/app/privacy/page.tsx @@ -0,0 +1,137 @@ +import type { Metadata } from 'next'; +import Link from 'next/link'; +import LegalDocument, { LegalList, SupportLink, type LegalSection } from '@/components/legal/LegalDocument'; +import { LEGAL_OPERATOR, supportContact } from '@/lib/legal'; + +export const metadata: Metadata = { + title: 'Privacy policy — Buffer', + description: 'What Buffer stores, why, for how long, and how to delete your account and its data.', + alternates: { canonical: '/privacy' }, +}; + +/** The configured support email is the only private channel; without one, only the in-app control exists. */ +const contact = supportContact(); + +const summary = [ + 'Presets, live account reads and reports saved on your device work without an account.', + 'Buffer never asks for your seed phrase or private key, never requests a signature and never moves funds.', + 'With an account, we store your email address, saved reports and the alert rules you create.', + 'You can delete your account and its data from inside the app at any time.', + 'We do not sell your information, and Buffer has no advertising or analytics trackers.', +]; + +const sections: LegalSection[] = [ + { id: 'who-we-are', title: 'Who we are', body: <> +

Buffer is operated by {LEGAL_OPERATOR} (“we”, “us”). This policy covers the Buffer website and web app at bufferonsolana.vercel.app, the installed web app, and the Buffer Android app, which opens the same web app.

+

Our Terms of use set out the rules for using Buffer. Questions about this policy go to .

+ }, + { id: 'without-an-account', title: 'Using Buffer without an account', body: <> + Presets and the portfolio builder run in your browser with fixed reference prices. Nothing about them is sent to us., + <>Live reads. When you read an account, your browser sends the public wallet address, protocol, network and subaccount to Buffer’s server. The server reads that account’s public data from the provider and returns it. Buffer does not store the addresses you look up., + <>Reports on this device stay in your browser’s storage. We never receive them and they are never uploaded. Clearing your browser data removes them., + <>Settings on this device. Your browser also keeps your animation preference, example alert settings and, when you sign in, your session. They stay on the device., + ]} /> +

Buffer sets no tracking cookies and includes no advertising or analytics scripts.

+ }, + { id: 'wallet', title: 'Wallet connection', body: <> +

“Use my wallet” asks a wallet in your browser, or on Android and Seeker a wallet through Mobile Wallet Adapter, to share its public address. Buffer uses that address only to read the public account, exactly as if you had pasted it.

+

Buffer never requests a signature or a transaction, and it cannot move funds. On Android, Mobile Wallet Adapter keeps its connection approval in this app’s storage on your device so your wallet can reconnect. You can revoke it in your wallet.

+ }, + { id: 'accounts', title: 'Accounts and saved reports', body: <> +

Accounts are optional. If you create one, Supabase, our database and sign-in provider, stores:

+ +

Database rules let only your signed-in account read or change these records. Supabase Auth sends confirmation and password recovery emails to your address.

+ }, + { id: 'alerts', title: 'Alerts and monitored wallets', body: <> +

Alerts are optional and need an account. When you set an alert rule, we store:

+ Alert rules: the monitored public wallet address and subaccount, the metric (maintenance headroom or liquidation distance), the market, your threshold, check interval, timezone, cooldown and recovery distance., + <>Monitoring state: when each rule was last checked, its latest observation and any error., + <>Alert events: each threshold crossing, with the observed value, the observation it came from and a preview of the message., + <>Delivery records: attempts, outcomes and the receipt returned by Discord or the webhook., + <>Alert destinations: the label and masked name of each destination set up for your account., + <>Manual checks: a record of each check you start, kept for 7 days., + ]} /> +

Destinations are Discord channels or signed webhooks that the operator configures on the server for specific accounts. You cannot add one yourself, and their URLs and secrets are never stored in the database. When an alert fires, Buffer sends the alert message, which includes the monitored wallet address, subaccount, metric and values, to that destination.

+ }, + { id: 'rate-limiting', title: 'Rate limiting and service logs', body: <> +

To keep live reads available, Buffer limits how often one connection can read. IPs are hashed for rate limiting and no address is stored. The counter keeps a keyed hash derived from your IP address (HMAC-SHA-256 under a random key that never leaves our database), never the address itself, with a request count for the current minute. Without that key, the hash cannot be matched to an address by trying every possible one. It holds no account or wallet data.

+

Each counter is deleted when its one-minute window ends: by the next rate-limit check, or by a cleanup that runs every three minutes. No counter is kept more than five minutes after your last request.

+

Our hosting provider, Vercel, processes every request to serve Buffer and keeps standard request logs under its own policies. These can include your IP address, browser details and the address of the page or API called. For a live read, that includes the public wallet address you looked up.

+ }, + { id: 'processors', title: 'Service providers', body: <> +

We use these providers to run Buffer. Each receives only what it needs for its part:

+ Vercel hosts the website, the app and its server functions., + <>Supabase stores accounts, saved reports, alerts and rate-limit counters, handles sign-in and sends account emails. Your account data is stored in the United States., + <>A Solana RPC provider chosen by the operator receives the public addresses Buffer reads on Velocity, Jupiter and legacy Drift, and returns on-chain data. Velocity devnet reads go to the devnet endpoint set in the server setting SOLANA_DEVNET_RPC_URL when the operator configures one, and otherwise to Solana’s public devnet RPC., + <>Velocity, Jupiter and Drift data is read from their public on-chain accounts through that RPC provider., + <>Pacifica data is read from Pacifica’s public API, which receives the public address you look up., + <>Discord or webhook recipients receive alert messages for the accounts the operator set them up for., + <>Your wallet shares your public address when you choose “Use my wallet”. Its own privacy policy applies., + <>GitHub hosts our public issue tracker. Its privacy policy applies to anything you post there., + ]} /> +

Vercel and Supabase can process information in the United States and other countries.

+ }, + { id: 'retention', title: 'How long we keep information', body: }, + { id: 'delete-account', title: 'Deleting your account', body: <> +

Signed in, open My reports in the app and choose Delete account. After you confirm, Buffer deletes your account in the database and signs you out on that device. This permanently removes:

+ +

It does not remove:

+ +

Alert destinations themselves are operator configuration, not your data. The operator lists which accounts may use each destination in the server settings BUFFER_DISCORD_DESTINATIONS_JSON and BUFFER_WEBHOOK_DESTINATIONS_JSON (their ownerIds). Deleting your account removes the destination records linked to it, so nothing more is sent. Your former account ID can stay in that configuration until we next update it. It no longer matches any account, and we remove it at that update.

+ {contact.kind === 'email' + ?

If you can no longer sign in, email us at from the address on the account and we will delete it for you. That address is the private channel for anything that involves your personal details.

+ :

Deletion happens through the Delete account control inside the app, which needs your sign-in; if you have lost access, use the password recovery email first. Buffer has no private support address at the moment, and our public issue tracker must never carry your email address, wallet address or other personal details.

} + }, + { id: 'security', title: 'Security', body: }, + { id: 'children', title: 'Age requirement', body:

Buffer is for people aged 18 or older. We do not knowingly collect information from anyone under 18. If you believe a person under 18 created an account, contact us and we will delete it.

}, + { id: 'rights', title: 'Your choices and rights', body: <> +

You can use Buffer without an account, download any saved report as JSON, delete reports and delete your account in the app.

+

Depending on where you live, you may have rights to access, correct, export or delete your information, or to object to how we use it. {contact.kind === 'email' + ? 'Email us to make a request and we will respond within the time the law requires.' + : 'Deleting your account and downloading your reports as JSON are available in the app at any time; for any other request, open an issue that describes it without personal details, and we will respond within the time the law requires.'} We do not sell your information or share it for advertising.

+ }, + { id: 'changes', title: 'Changes to this policy', body:

We post changes on this page and update the date at the top. If you keep using Buffer after a change, the updated policy applies.

}, + { id: 'contact', title: 'Contact', body: <> +

{LEGAL_OPERATOR}: .

+

GitHub issues are public: never post your email address, wallet address or other personal details there. {contact.kind === 'email' + ? 'Anything that involves them goes to the address above.' + : 'Account requests, including deletion, are completed with the Delete account control inside the app; Buffer has no private support address at the moment.'}

+ }, +]; + +export default function PrivacyPage() { + return ; +} diff --git a/src/app/sitemap.ts b/src/app/sitemap.ts index 90a05e9..7007be3 100644 --- a/src/app/sitemap.ts +++ b/src/app/sitemap.ts @@ -8,5 +8,7 @@ export default function sitemap(): MetadataRoute.Sitemap { { url: `${SITE_URL}/app`, changeFrequency: 'weekly', priority: 0.9 }, { url: `${SITE_URL}/demo`, changeFrequency: 'monthly', priority: 0.7 }, { url: `${SITE_URL}/brand-kit`, changeFrequency: 'monthly', priority: 0.6 }, + { url: `${SITE_URL}/privacy`, changeFrequency: 'yearly', priority: 0.3 }, + { url: `${SITE_URL}/terms`, changeFrequency: 'yearly', priority: 0.3 }, ]; } diff --git a/src/app/terms/page.tsx b/src/app/terms/page.tsx new file mode 100644 index 0000000..9a4259d --- /dev/null +++ b/src/app/terms/page.tsx @@ -0,0 +1,73 @@ +import type { Metadata } from 'next'; +import Link from 'next/link'; +import LegalDocument, { LegalClause, LegalList, SupportLink, type LegalSection } from '@/components/legal/LegalDocument'; +import { LEGAL_OPERATOR } from '@/lib/legal'; +import { LIQUIDATION_MODEL_VERSION } from '@/lib/risk/liquidation'; + +export const metadata: Metadata = { + title: 'Terms of use — Buffer', + description: 'The terms for using Buffer, a read-only tool for exploring Solana perpetual positions.', + alternates: { canonical: '/terms' }, +}; + +const summary = [ + 'Buffer is a read-only tool. It is not trading advice.', + 'Price scenarios and liquidation estimates are versioned estimates, not guarantees.', + 'Buffer never asks for your keys and never signs.', + 'Alerts can be delayed or fail. Do not rely on them alone.', + 'Buffer is provided as is, without warranties.', +]; + +const sections: LegalSection[] = [ + { id: 'agreement', title: 'These terms', body: <> +

These terms are an agreement between you and {LEGAL_OPERATOR}, which operates Buffer (“we”, “us”). They cover the Buffer website and web app, the installed web app and the Buffer Android app. By using Buffer you agree to them. If you do not agree, do not use Buffer.

+

Our Privacy policy explains what Buffer stores and how to delete it.

+ }, + { id: 'eligibility', title: 'Who can use Buffer', body:

You must be at least 18 years old and able to enter a binding agreement. Do not use Buffer where doing so breaks the law, or if you are the target of sanctions or are in a sanctioned country or region.

}, + { id: 'service', title: 'What Buffer does', body: <> +

Buffer reads public data about Solana perpetual positions on Velocity, Pacifica, Jupiter Perps and legacy Drift. It shows a price scenario, the provider’s risk context and related details. Buffer is read-only. It does not hold funds, place trades, custody assets or give access to any exchange.

+

Protocols, RPC providers and APIs are run by third parties. Their data can be late, incomplete or wrong, and their own terms apply to them.

+ }, + { id: 'not-advice', title: 'Not trading advice', body:

Buffer is not trading advice, and it is not investment, financial, legal or tax advice. Nothing in Buffer recommends buying, selling or holding anything. You are responsible for your own decisions and trades.

}, + { id: 'estimates', title: 'Estimates are not guarantees', body: <> +

A price scenario applies one percentage move to eligible positions, with sizes and baseline prices held fixed. It leaves out funding, fees, collateral changes, future fills and liquidation effects.

+

The liquidation estimate is a versioned estimate, currently model {LIQUIDATION_MODEL_VERSION}. It solves for the price at which one position alone would reach the maintenance boundary while everything else stays fixed. It is not the protocol’s liquidation engine and it is not a guarantee: a position can be liquidated at a different price or time. Live calculations expire after at most two minutes.

+ }, + { id: 'keys', title: 'Your keys and wallet', body: <> +

Buffer never asks for your seed phrase or private key, never requests a signature and never sends a transaction. “Use my wallet” asks your wallet for its public address and nothing else.

+

If anyone claiming to be Buffer asks for your keys or a signature, do not provide them. You are responsible for your wallets, devices and trades.

+ }, + { id: 'alerts', title: 'Alerts', body: <> +

Alerts are optional and need an account. Delivery depends on the protocols, RPC providers and scheduler Buffer uses, on Discord or your webhook receiver, and on the destinations the operator configures.

+

Alerts can be delayed or fail. They can also arrive twice or not at all, and checks pause when data is unavailable. Do not rely on alerts alone. Watch your positions directly and use your protocol’s own tools.

+ }, + { id: 'accounts', title: 'Your account', body:

Keep your sign-in details secure, and tell us if you think someone else used your account. You can delete your account and its data at any time from My reports in the app. We may suspend or close an account that breaks these terms or puts the service at risk.

}, + { id: 'acceptable-use', title: 'Acceptable use', body: <> +

Do not misuse Buffer. In particular, do not:

+ +

Buffer’s source code is available under the MIT License at github.com/operatoruplift/buffer. That license covers the code. These terms cover your use of the hosted service and apps.

+ }, + { id: 'availability', title: 'Changes to Buffer', body:

Buffer is free to use. We can change, pause or stop any part of it at any time, including supported protocols, live reads and alerts. Buffer depends on third-party services, and we are not responsible for their outages.

}, + { id: 'no-warranty', title: 'No warranty', body:

Buffer is provided “as is” and “as available”. To the fullest extent the law allows, we disclaim all warranties, express or implied, including accuracy, merchantability, fitness for a particular purpose, non-infringement and uninterrupted or error-free operation.

}, + { id: 'liability', title: 'Limitation of liability', body: <> +

To the fullest extent the law allows, {LEGAL_OPERATOR} is not liable for any indirect, incidental, special, consequential or punitive damages, or for any loss of funds, trading losses, liquidations, lost profits or lost data, arising from your use of Buffer or your reliance on its information or alerts.

+

Our total liability for any claim relating to Buffer is limited to 100 US dollars. Some places do not allow these limits, so they may not apply to you.

+ }, + { id: 'dapp-store', title: 'Solana dApp Store', body: +

If you obtained Buffer through the Solana dApp Store, these terms are between you and {LEGAL_OPERATOR} only. Solana Mobile and its parents, subsidiaries, affiliates, officers, employees, agents, partners, suppliers and licensors (the Solana Mobile Parties) are not a party to these terms and have no responsibility or liability to you in connection with Buffer, its content, its support or maintenance, or any Solana Mobile program. The No warranty and Limitation of liability sections of these terms protect the Solana Mobile Parties to the same extent as they protect {LEGAL_OPERATOR}. {LEGAL_OPERATOR} alone is responsible for Buffer and for answering any claim about it.

+
}, + { id: 'law', title: 'Governing law', body:

These terms are governed by the laws of the place where {LEGAL_OPERATOR} is established, without regard to conflict-of-law rules. The mandatory consumer protections of the place where you live still apply.

}, + { id: 'changes', title: 'Changes to these terms', body:

We may update these terms. We post the new version on this page and update the date at the top. If you keep using Buffer after a change, the updated terms apply.

}, + { id: 'contact', title: 'Contact', body:

Questions about these terms go to {LEGAL_OPERATOR} at .

}, +]; + +export default function TermsPage() { + return ; +} diff --git a/src/components/AccountDeletion.module.css b/src/components/AccountDeletion.module.css new file mode 100644 index 0000000..976f9aa --- /dev/null +++ b/src/components/AccountDeletion.module.css @@ -0,0 +1,11 @@ +.section{margin-top:28px;padding-top:22px;border-top:1px solid #e7eaf0}.section h3{font-size:14px;margin-bottom:6px}.section p{font-size:13px!important;margin-bottom:12px!important;color:#4d586b} +.start{color:var(--red);padding-left:0}.start:hover:not(:disabled){background:transparent;text-decoration:underline;text-underline-offset:4px} +.confirm{margin-top:14px;border:1px solid #efd4d5;border-radius:14px;padding:18px 20px;background:#fdf7f7}.confirm h4{margin:0 0 8px;font-size:15px;font-weight:600;letter-spacing:-.2px;color:#182236;overflow-wrap:anywhere}.confirm h4:focus-visible{outline:2px solid #315fe8;outline-offset:4px;border-radius:4px}.confirm ul{margin:0 0 14px;padding-left:18px;font-size:13px;line-height:1.85;color:#182236} +.kept a{color:#315fe8;text-decoration:underline;text-underline-offset:3px} +.actions{display:flex;flex-wrap:wrap;gap:10px}.destroy{background:var(--red);border-color:var(--red);color:#fff}.destroy:hover:not(:disabled){background:#9c3a3e;border-color:#9c3a3e}.destroy:focus-visible{outline:3px solid #e2a3a5} +.done{display:flex;align-items:center;gap:8px;color:#182236!important}.done svg{color:var(--teal);flex-shrink:0} +.status:empty{display:none} +.notice{position:fixed;left:50%;bottom:max(20px,env(safe-area-inset-bottom));transform:translateX(-50%);z-index:46;width:min(460px,calc(100% - 32px));display:grid;grid-template-columns:auto 1fr auto;gap:12px;align-items:start;padding:16px 14px 16px 16px;border:1px solid #d6e3df;border-radius:16px;background:#fff;color:#182236;box-shadow:0 18px 50px #1724402e}.notice:focus-visible{outline:3px solid #7b9af4;outline-offset:3px}.notice strong{font-size:14px}.notice p{margin:4px 0 0;font-size:13px;line-height:1.6;color:#4d586b}.notice button{min-height:36px;padding:6px 8px} +.noticeIcon{display:flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:50%;background:#e3f2ef;color:var(--teal)} +@media(max-width:1179px){.notice{bottom:calc(88px + env(safe-area-inset-bottom))}} +@media(max-width:600px){.confirm{padding:16px}.actions button{width:100%;min-height:44px}.notice{grid-template-columns:auto 1fr}.notice button{grid-column:1 / -1;justify-self:end}} diff --git a/src/components/AccountDeletion.tsx b/src/components/AccountDeletion.tsx new file mode 100644 index 0000000..4dbbd39 --- /dev/null +++ b/src/components/AccountDeletion.tsx @@ -0,0 +1,68 @@ +'use client'; + +import { useEffect, useRef } from 'react'; +import { Icon } from './Icons'; +import styles from './AccountDeletion.module.css'; + +export type DeletionStage = 'idle' | 'confirming' | 'deleting' | 'deleted'; + +type SectionProps = { + email: string | undefined; + stage: DeletionStage; + message: string; + disabled: boolean; + onStart: () => void; + onCancel: () => void; + onConfirm: () => void; +}; + +/** In-page confirmation. Nothing is sent until the person confirms a second time. */ +export function DeleteAccountSection({ email, stage, message, disabled, onStart, onCancel, onConfirm }: SectionProps) { + const start = useRef(null); + const prompt = useRef(null); + const previous = useRef(stage); + useEffect(() => { + if (previous.current === 'idle' && stage === 'confirming') prompt.current?.focus(); + if (previous.current === 'confirming' && stage === 'idle') start.current?.focus(); + previous.current = stage; + }, [stage]); + const working = stage === 'deleting'; + return
+

Delete account

+ {stage === 'idle' && <> +

Remove this account and everything stored with it. This cannot be undone.

+ + } + {(stage === 'confirming' || working) &&
+

Delete {email || 'this account'} permanently?

+

This removes, for good:

+
    +
  • Your sign-in and email address
  • +
  • Saved reports
  • +
  • Monitored wallet addresses and alert rules
  • +
  • Alert destinations, events and delivery records
  • +
+

Reports saved on this device stay until you delete them. Alerts already sent to Discord or a webhook stay with their recipients. How deletion works

+
+ + +
+
} + {stage === 'deleted' &&

Your account and its data are deleted. Sign out to finish on this device.

} +

{message}

+
; +} + +/** Shown after sign-out, when the account panel no longer has a signed-in user. */ +export function AccountDeletedNotice({ onDismiss }: { onDismiss: () => void }) { + const notice = useRef(null); + useEffect(() => { notice.current?.focus(); }, []); + return
+ +
+ Account deleted. +

Your sign-in, saved reports, alert rules and alert history are gone. You are signed out on this device.

+
+ +
; +} diff --git a/src/components/AccountPanel.tsx b/src/components/AccountPanel.tsx index d23567e..fa57c0a 100644 --- a/src/components/AccountPanel.tsx +++ b/src/components/AccountPanel.tsx @@ -4,12 +4,14 @@ import { useCallback, useEffect, useRef, useState } from 'react'; import type { Session, User } from '@supabase/supabase-js'; import { getSupabase } from '@/lib/supabase'; import { runAuthOperation } from '@/lib/auth-flow'; +import { AccountDeletionError, accountDeletionMessage, clearAccountDeviceData, deleteOwnAccount, runAccountDeletion } from '@/lib/account-deletion'; import { persistedAuthSession, sessionIdentity, sameAuthSession, withIdentityBoundSignOut, type AuthSessionIdentity } from '@/lib/auth-storage'; -import { decodeCloudReports, isCloudReportPayload, type SavedReport } from '@/lib/cloud-reports'; +import { decodeCloudReports, isCloudReportPayload, isSavedReportQuotaError, MAX_CLOUD_LIBRARY_BYTES, MAX_CLOUD_REPORTS, type SavedReport } from '@/lib/cloud-reports'; import { formatUtc } from '@/lib/format'; import type { createReport } from '@/lib/report'; import styles from './AccountPanel.module.css'; import DeviceReportsPanel from './DeviceReportsPanel'; +import { AccountDeletedNotice, DeleteAccountSection, type DeletionStage } from './AccountDeletion'; type Report = ReturnType; type Operation = { identity: string; controller: AbortController }; @@ -40,6 +42,10 @@ export default function AccountPanel({ report }: { report: Report | null }) { const [loadState, setLoadState] = useState<'idle' | 'loaded' | 'error'>('idle'); const [writeUncertain, setWriteUncertain] = useState(false); const [message, setMessage] = useState(''); + const [deletion, setDeletion] = useState('idle'); + const [deletionMessage, setDeletionMessage] = useState(''); + const [accountDeleted, setAccountDeleted] = useState(false); + const deleting = useRef(false); const dialog = useRef(null); const trigger = useRef(null); const identity = useRef(null); @@ -59,6 +65,9 @@ export default function AccountPanel({ report }: { report: Report | null }) { setBusy(false); setLoadState('idle'); setWriteUncertain(false); + setDeletion('idle'); + setDeletionMessage(''); + if (nextIdentity) setAccountDeleted(false); if (!nextIdentity) dialog.current?.close(); } acceptedSession.current = nextSession; @@ -181,11 +190,12 @@ export default function AccountPanel({ report }: { report: Report | null }) { if (!current(ticket)) return; setReports(items); setLoadState('loaded'); setWriteUncertain(false); setMessage('Scenario saved to your private library.'); - } catch { - if (current(ticket)) { - setLoadState('error'); setWriteUncertain(true); - setMessage(saved ? 'Scenario saved, but the library could not be refreshed. Reload reports to see it.' : 'Saving could not be confirmed. Reload reports before trying again.'); - } + } catch (error) { + if (!current(ticket)) return; + // The database refused a full library before writing anything; the library itself is still in step. + if (!saved && isSavedReportQuotaError(error)) { setMessage(`Your library is full: it holds up to ${MAX_CLOUD_REPORTS} reports or ${MAX_CLOUD_LIBRARY_BYTES / 1048576} MiB. Delete a report to save another.`); return; } + setLoadState('error'); setWriteUncertain(true); + setMessage(saved ? 'Scenario saved, but the library could not be refreshed. Reload reports to see it.' : 'Saving could not be confirmed. Reload reports before trying again.'); } finally { finish(ticket); } } async function remove(id: string) { @@ -218,6 +228,33 @@ export default function AccountPanel({ report }: { report: Report | null }) { if (current(ticket)) setMessage('Could not sign out. Please retry.'); } finally { finish(ticket); } } + /** The database confirms the deletion before this device clears its data or session. */ + async function deleteAccount() { + const db = getSupabase(); + if (!db || busy || deleting.current) return; + const expected = acceptedSession.current; + if (!expected || expected.userId !== user?.id) { setDeletionMessage(accountDeletionMessage(new AccountDeletionError('session'))); return; } + const ticket = begin(); + if (!ticket) return; + deleting.current = true; + setDeletion('deleting'); + setDeletionMessage(''); + try { + await runAccountDeletion({ + remove: () => deleteOwnAccount(expected, ticket.controller.signal), + afterDelete: () => { clearAccountDeviceData(expected.userId); setAccountDeleted(true); }, + // The deleted account's session is already revoked; this clears it from this browser. + signOut: () => runAuthOperation('signout', signal => withIdentityBoundSignOut(AUTH_URL, expected, + () => db.auth.signOut({ scope: 'local' }), signal), undefined, REQUEST_TIMEOUT_MS, expected), + }); + if (current(ticket) && sameAuthSession(persistedAuthSession(AUTH_URL), expected)) setDeletion('deleted'); + } catch (error) { + if (current(ticket)) { setDeletion('confirming'); setDeletionMessage(accountDeletionMessage(error)); } + } finally { + deleting.current = false; + finish(ticket); + } + } function download(item: SavedReport) { const url = URL.createObjectURL(new Blob([JSON.stringify(item.report, null, 2)], { type: 'application/json' })); const link = document.createElement('a'); @@ -225,16 +262,20 @@ export default function AccountPanel({ report }: { report: Report | null }) { setTimeout(() => URL.revokeObjectURL(url), 1000); } function close() { - operation.current?.controller.abort(); - operation.current = null; - setBusy(false); + // Closing never abandons a deletion in flight; its result still signs this device out. + if (!deleting.current) { + operation.current?.controller.abort(); + operation.current = null; + setBusy(false); + if (deletion === 'confirming') { setDeletion('idle'); setDeletionMessage(''); } + } trigger.current?.focus(); } - if (!user) return <>{authReady ? Sign in : authError ? : Checking account…}; + if (!user) return <>{authReady ? Sign in : authError ? : Checking account…}{accountDeleted && setAccountDeleted(false)} />}; return <> - -

YOUR WORKSPACE

Saved perspectives.

+ { if (deleting.current) event.preventDefault(); }}> +

YOUR WORKSPACE

Saved perspectives.

{user.email}

Keep a dated copy of a scenario. Saved reports are historical records; they do not refresh with the market.

@@ -244,6 +285,10 @@ export default function AccountPanel({ report }: { report: Report | null }) {
    {reports.map(item =>
  • {item.title}{formatUtc(item.created_at)}
  • )}

Your most recent 50 reports. Only your signed-in account can access them.

+ { setDeletion('confirming'); setDeletionMessage(''); }} + onCancel={() => { setDeletion('idle'); setDeletionMessage(''); }} + onConfirm={() => void deleteAccount()} />
; } diff --git a/src/components/AlertsPanel.module.css b/src/components/AlertsPanel.module.css index 234699e..4d11cd7 100644 --- a/src/components/AlertsPanel.module.css +++ b/src/components/AlertsPanel.module.css @@ -1,4 +1,4 @@ -.panel{margin-top:18px;padding:20px 22px;background:#fff;border-color:#d9e4f1}.heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.heading h2{margin:5px 0 4px;font-size:20px;letter-spacing:-.4px}.heading p{margin:0;color:var(--muted);font-size:11px;line-height:1.5}.eyebrow{color:var(--blue);font-size:10px;font-weight:700;letter-spacing:.12em}.state{flex-shrink:0;padding:5px 9px;border-radius:999px;background:#edf3ff;color:var(--blue);font-size:10px;font-weight:600}.state.delivered{background:#e7f5f1;color:var(--teal)}.state.pending{background:#fff1d9;color:var(--amber)}.form{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;align-items:end;margin-top:17px}.field{min-width:0;display:flex;flex-direction:column;gap:5px}.field label{color:var(--muted);font-size:10px}.field input,.field select{width:100%;min-height:38px;border:1px solid #d7e0e5;border-radius:8px;background:#fbfcfe;color:var(--text);padding:8px 10px;font:inherit;font-size:12px}.field input:focus-visible,.field select:focus-visible{outline:2px solid var(--blue);outline-offset:2px}.rule{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:15px;border-top:1px solid #e8eef3;padding-top:12px;font-size:11px}.rule strong{font-size:12px}.rule small{display:block;color:var(--muted);margin-top:4px}.rule-actions{display:flex;gap:8px;flex-shrink:0}.metrics{display:grid;grid-template-columns:repeat(3,1fr);gap:9px;margin-top:15px}.metric{min-width:0;padding:10px 11px;border:1px solid #e3eaf0;border-radius:9px;background:#f8fbff}.metric span{display:block;color:var(--muted);font-size:10px}.metric strong{display:block;margin-top:4px;color:var(--text);font-size:13px;overflow-wrap:anywhere}.note{margin:13px 0 0;color:var(--muted);font-size:10px;line-height:1.55}.note a{text-decoration:underline;text-underline-offset:2px}.delivery{margin-top:10px;padding:9px 11px;border-left:2px solid var(--teal);background:#f5fbf9;color:var(--muted);font-size:10px;line-height:1.5}.delivery strong{color:var(--text)}@media(max-width:800px){.form{grid-template-columns:repeat(2,1fr)}.form button{grid-column:span 2}.metrics{grid-template-columns:1fr}.heading{gap:10px}}@media(max-width:520px){.panel{padding:16px}.heading{display:block}.state{display:inline-block;margin-top:10px}.form{grid-template-columns:1fr}.form button{grid-column:auto}.rule{align-items:flex-start;flex-direction:column}.rule-actions{width:100%}.rule-actions button{flex:1}} +.panel{margin-top:18px;padding:20px 22px;background:#fff;border-color:#d9e4f1}.heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.heading h2{margin:5px 0 4px;font-size:20px;letter-spacing:-.4px}.heading p{margin:0;color:var(--muted);font-size:12px;line-height:1.5}.eyebrow{color:var(--blue);font-size:10px;font-weight:700;letter-spacing:.12em}.state{flex-shrink:0;padding:5px 9px;border-radius:999px;background:#edf3ff;color:var(--blue);font-size:10px;font-weight:600}.state.delivered{background:#e7f5f1;color:var(--teal)}.state.pending{background:#fff1d9;color:var(--amber)}.form{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;align-items:end;margin-top:17px}.field{min-width:0;display:flex;flex-direction:column;gap:5px}.field label{color:var(--muted);font-size:10px}.field input,.field select{width:100%;min-height:38px;border:1px solid #d7e0e5;border-radius:8px;background:#fbfcfe;color:var(--text);padding:8px 10px;font:inherit;font-size:12px}.field input:focus-visible,.field select:focus-visible{outline:2px solid var(--blue);outline-offset:2px}.rule{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:15px;border-top:1px solid #e8eef3;padding-top:12px;font-size:11px}.rule strong{font-size:12px}.rule small{display:block;color:var(--muted);margin-top:4px}.rule-actions{display:flex;gap:8px;flex-shrink:0}.metrics{display:grid;grid-template-columns:repeat(3,1fr);gap:9px;margin-top:15px}.metric{min-width:0;padding:10px 11px;border:1px solid #e3eaf0;border-radius:9px;background:#f8fbff}.metric span{display:block;color:var(--muted);font-size:10px}.metric strong{display:block;margin-top:4px;color:var(--text);font-size:13px;overflow-wrap:anywhere}.note{margin:13px 0 0;color:var(--muted);font-size:12px;line-height:1.55}.note a{text-decoration:underline;text-underline-offset:2px}.delivery{margin-top:10px;padding:9px 11px;border-left:2px solid var(--teal);background:#f5fbf9;color:var(--muted);font-size:10px;line-height:1.5}.delivery strong{color:var(--text)}@media(max-width:800px){.form{grid-template-columns:repeat(2,1fr)}.form button{grid-column:span 2}.metrics{grid-template-columns:1fr}.heading{gap:10px}}@media(max-width:520px){.panel{padding:16px}.heading{display:block}.state{display:inline-block;margin-top:10px}.form{grid-template-columns:1fr}.form button{grid-column:auto}.rule{align-items:flex-start;flex-direction:column}.rule-actions{width:100%}.rule-actions button{flex:1}} -.metric small{display:block;margin-top:6px;color:var(--muted);font-size:10px;line-height:1.6}.history{margin:14px 0;color:var(--muted);font-size:12px}.history summary{cursor:pointer;padding:7px 0}.history pre{white-space:pre-wrap;overflow-wrap:anywhere;font-size:11px}.panel>.rule-actions{margin-top:14px;flex-wrap:wrap}.delivery p{margin:5px 0} +.metric small{display:block;margin-top:6px;color:var(--muted);font-size:11px;line-height:1.6}.history{margin:14px 0;color:var(--muted);font-size:12px}.history summary{cursor:pointer;padding:7px 0}.history pre{white-space:pre-wrap;overflow-wrap:anywhere;font-size:11px}.panel>.rule-actions{margin-top:14px;flex-wrap:wrap}.delivery p{margin:5px 0} .modeActions{display:flex;flex-wrap:wrap;gap:8px;margin-top:20px}.modeActions button[aria-pressed=true]{background:var(--blue);color:#fff}.savedRules{max-width:440px;margin-top:16px} diff --git a/src/components/AlertsPanel.tsx b/src/components/AlertsPanel.tsx index 7700f21..c29b55c 100644 --- a/src/components/AlertsPanel.tsx +++ b/src/components/AlertsPanel.tsx @@ -7,7 +7,7 @@ import { getSupabase } from '@/lib/supabase'; import { persistedAuthSession } from '@/lib/auth-storage'; import { formatUtc } from '@/lib/format'; import { - alertStorageKey, createAlertRule, parseAlertStore, deleteAlertRule, + alertRehearsalKey, alertStorageKey, createAlertRule, parseAlertStore, deleteAlertRule, emptyAlertStore, encodeAlertStore, evaluateFixtureAlerts, pauseAlertRule, runAlertWorker, updateAlertRule, type AlertStore, } from '@/lib/alerts'; @@ -76,7 +76,7 @@ function RehearsalAlerts({ ownerId, sessionId }: Props & { ownerId: string; sess const [busy, setBusy] = useState(false); const active = useRef(true); const inFlight = useRef(false); - const key = `buffer.alerts.rehearsal.v2:${ownerId}`; + const key = alertRehearsalKey(ownerId); const [legacyAvailable, setLegacyAvailable] = useState(false); useEffect(() => { diff --git a/src/components/AppNavigation.module.css b/src/components/AppNavigation.module.css index e85617f..5adc0c0 100644 --- a/src/components/AppNavigation.module.css +++ b/src/components/AppNavigation.module.css @@ -51,6 +51,8 @@ .utilities a { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 7px 6px; color: #65715f; font-size: 11px; border-radius: 8px; } .utilities a:hover { color: #315fe8; background: #eef2e9; text-decoration: none; } .utilities a > span { width: 17px; text-align: center; font-size: 16px; } +.utilities .legal { display: flex; align-items: center; gap: 4px; margin: 6px 0 0; padding: 0 6px; color: #a0a89a; font-size: 11px; } +.utilities .legal a { min-height: 32px; padding: 6px 4px; } @media (max-width: 1179px) { .shell { --app-nav-fill: #fafbf8; diff --git a/src/components/AppNavigation.tsx b/src/components/AppNavigation.tsx index fc40068..2551a27 100644 --- a/src/components/AppNavigation.tsx +++ b/src/components/AppNavigation.tsx @@ -127,6 +127,7 @@ export default function AppNavigation({ positionsAvailable, scenarioAvailable, a
Watch walkthrough Back to website +

PrivacyTerms

; } diff --git a/src/components/AppWorkspace.css b/src/components/AppWorkspace.css index 07df2c6..a21689e 100644 --- a/src/components/AppWorkspace.css +++ b/src/components/AppWorkspace.css @@ -3,7 +3,7 @@ --bg: #f3f5f1; --surface: #fff; --text: #21302e; - --muted: #65736e; + --muted: #5a6863; --border: #dfe5dd; min-height: 100dvh; background: var(--bg); @@ -44,24 +44,24 @@ .buffer-app .button { border-radius: 11px; min-height: 44px; transition: background-color .16s ease, border-color .16s ease; } .buffer-app .button.primary { box-shadow: 0 3px 7px #315fe81a; } .buffer-app .button.subtle { box-shadow: none; } -.buffer-app .live-risk-entry span { max-width: 200px; line-height: 1.6; font-size: 10px; } +.buffer-app .live-risk-entry span { max-width: 200px; line-height: 1.6; font-size:11px; } .buffer-app .surface { border-color: var(--border); background: #fff; border-radius: 18px; box-shadow: 0 4px 18px #263d3005; } .buffer-app .sample-guide { border: 1px solid #d9e3d1; border-radius: 16px; background: #eaf0e4; padding: 16px 20px 10px; margin-bottom: 12px; } .buffer-app .guide-heading strong { font-size: 13px; } .buffer-app .guide-steps { margin-top: 5px; } .buffer-app .guide-steps button { min-height: 40px; font-size: 12px; } -.buffer-app .sample-note { margin: 0 0 4px; padding: 8px 2px; font-size: 11px; color: var(--muted); } +.buffer-app .sample-note { margin: 0 0 4px; padding: 8px 2px; font-size:12px; color: var(--muted); } .buffer-app .sample-tag { border-color: #cdd9c7; background: #f8fbf4; color: #617355; } .buffer-app .account-strip { margin-bottom: 22px; border-color: var(--border); gap: 16px; padding: 20px 0; } .buffer-app .account-icon { background: #e6ebe3; color: #53684c; border-radius: 12px; } .buffer-app .account-name { font-size: 14px; } -.buffer-app .freshness small { font-size: 10px; } +.buffer-app .freshness small { font-size:11px; } .buffer-app .freshness span { font-size: 11px; } .buffer-app .section-kicker { font-size: 10px; } .buffer-app .metric { border-color: var(--border); border-radius: 15px; padding: 19px 22px; background: #fff; } .buffer-app .metric-label { font-size: 12px; } .buffer-app .metric-value { font-size: 29px; letter-spacing: -.9px; } -.buffer-app .metric p { font-size: 11px; line-height: 1.65; } +.buffer-app .metric p { font-size:12px; line-height: 1.65; } .buffer-app .workspace-grid { gap: 22px; } .buffer-app .panel-heading { padding: 22px; border-color: var(--border); } .buffer-app .panel-heading h2 { font-size: 17px; letter-spacing: -.45px; } @@ -76,14 +76,14 @@ .buffer-app .scenario-result p { font-size: 11px; line-height: 1.7; } .buffer-app .shock-control { padding: 24px; } .buffer-app .presets button { min-height: 38px; border-radius: 8px; } -.buffer-app .coverage strong, .buffer-app .coverage p, .buffer-app .assumption-line { font-size: 11px; line-height: 1.7; } +.buffer-app .coverage strong, .buffer-app .coverage p, .buffer-app .assumption-line { font-size:12px; line-height: 1.7; } .buffer-app .scenario-actions { background: #fbfcfa; } .buffer-app .download { font-size: 11px; } .buffer-app .position-table td { font-size: 12px; } .buffer-app .market strong { font-size: 13px; } .buffer-app .market small { font-size: 11px; } .buffer-app .inventory-group h3, .buffer-app .inventory-row { font-size: 12px; } -.buffer-app .table-note { font-size: 11px; line-height: 1.7; } +.buffer-app .table-note { font-size:12px; line-height: 1.7; } .buffer-app .risk-context-heading > div > p, .buffer-app .risk-context-note { font-size: 12px; line-height: 1.65; } .buffer-app .risk-status { font-size: 11px; } .buffer-app .liquidation-list li { background: #fafbf8; border-color: var(--border); } @@ -97,7 +97,10 @@ .buffer-app .network-picker button[aria-pressed="true"] { background: #243b31; border-color: #243b31; } .buffer-app .address-bottom p { font-size: 12px; line-height: 1.6; } .buffer-app .model-tag { font-size: 9px; } -.buffer-app footer { margin-top: 32px; padding-bottom: 0; font-size: 11px; } +.buffer-app footer { margin-top: 32px; padding-bottom: 0; font-size: 11px; gap: 16px; } +.buffer-app .footer-legal { display: flex; gap: 18px; } +.buffer-app .footer-legal a { display: inline-flex; align-items: center; min-height: 32px; color: var(--muted); } +.buffer-app .footer-legal a:hover { color: var(--blue); } .buffer-app .toast { z-index: 45; } body:has(.buffer-app) { background: #f3f5f1; } body:has(.buffer-app) #app-installation { max-width: none; padding-top: 0; background: #f3f5f1; } @@ -144,20 +147,20 @@ body:has(.buffer-app) #app-installation { max-width: none; padding-top: 0; backg .buffer-app .workspace-actions .account-launch { min-width: 0; padding: 10px 13px; } .buffer-app .workspace-actions .live-risk-entry { flex: 1; min-width: 144px; } .buffer-app .live-risk-entry .button.primary { min-width: 0; width: 100%; padding: 10px 13px; gap: 8px; } - .buffer-app .live-risk-entry span { font-size: 10px; max-width: 175px; } + .buffer-app .live-risk-entry span { font-size:11px; max-width: 175px; } .buffer-app .workspace-actions .readonly { font-size: 11px; } .buffer-app .sample-guide { padding: 14px 14px 8px; } .buffer-app .guide-heading strong { font-size: 12px; } .buffer-app .guide-steps { gap: 2px; } .buffer-app .guide-steps button { font-size: 11px; } - .buffer-app .sample-note { font-size: 11px; line-height: 1.6; } + .buffer-app .sample-note { font-size:12px; line-height: 1.6; } .buffer-app .account-strip { padding: 20px 2px; gap: 15px; align-items: flex-start; } .buffer-app .account-identity { flex-basis: 100%; } .buffer-app .account-name { font-size: 13px; } .buffer-app .account-identity .eyebrow { font-size: 9px; } .buffer-app .subaccount { max-width: 100%; flex: 1; min-width: 0; } .buffer-app .freshness { padding-left: 0; flex: 1; } - .buffer-app .freshness small { font-size: 10px; overflow-wrap: anywhere; } + .buffer-app .freshness small { font-size:11px; overflow-wrap: anywhere; } .buffer-app .freshness span { font-size: 10px; } .buffer-app .account-strip > .button { align-self: center; } .buffer-app .surface { border-radius: 16px; } @@ -172,7 +175,7 @@ body:has(.buffer-app) #app-installation { max-width: none; padding-top: 0; backg .buffer-app .metric { padding: 16px 18px; } .buffer-app .metric-value { font-size: 25px; } .buffer-app .address-panel { padding: 20px 16px; } - .buffer-app .address-bottom p { font-size: 11px; } + .buffer-app .address-bottom p { font-size:12px; } .buffer-app footer { line-height: 1.7; } } @media (prefers-reduced-motion: reduce) { diff --git a/src/components/AuthForm.module.css b/src/components/AuthForm.module.css index 11b956c..0ed96ed 100644 --- a/src/components/AuthForm.module.css +++ b/src/components/AuthForm.module.css @@ -50,6 +50,8 @@ .unavailable p + p { margin-top: 16px; } .footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 14px; width: 100%; max-width: 1280px; margin: 0 auto; font-size: 10px; color: #f7f9ff; text-shadow: 0 1px 5px rgb(15 31 59 / 90%); } .footer a { color: inherit; } +.legal { display: flex; gap: 18px; } +.fine a { color: #203c70; text-decoration: underline; text-underline-offset: 2px; } .content > .intro, .form > .field, .form > .recovery, .form > .submit, .form > .switch, .content > .guest, .content > .unavailable { animation: auth-enter 700ms cubic-bezier(.22, 1, .36, 1) both; } .form > :nth-child(1) { animation-delay: 100ms; } .form > :nth-child(2) { animation-delay: 200ms; } diff --git a/src/components/AuthForm.tsx b/src/components/AuthForm.tsx index 80872f5..14999e4 100644 --- a/src/components/AuthForm.tsx +++ b/src/components/AuthForm.tsx @@ -252,11 +252,11 @@ export default function AuthForm({ initialMode = 'signin' }: { initialMode?: 'si }
{ if (event.target === event.currentTarget) setEntered(true); }}> Continue without an account -

The public explorer and device reports are ready to use. Signing in never connects a wallet or grants permission to trade.

+

The public explorer and device reports are ready to use. Signing in never connects a wallet or grants permission to trade. By creating an account you agree to the Terms of use; the Privacy policy explains what is stored and how to delete it.

-
A little more room to think.Privacy by design
+
A little more room to think.
; } diff --git a/src/components/Dashboard.tsx b/src/components/Dashboard.tsx index 6d58e59..67ceb3c 100644 --- a/src/components/Dashboard.tsx +++ b/src/components/Dashboard.tsx @@ -1289,6 +1289,7 @@ export default function Dashboard({ Solana · {mode === "sample" ? "Examples" : protocol.label} /{" "} {mode === "sample" ? "Reference data" : snapshot?.network === "devnet" ? `${NETWORK_LABELS.devnet} public account data` : "Mainnet public account data"} +
diff --git a/src/components/Landing.tsx b/src/components/Landing.tsx index 5cf4700..27b523a 100644 --- a/src/components/Landing.tsx +++ b/src/components/Landing.tsx @@ -87,7 +87,7 @@ function ScenarioContextCard({ shock }: { shock: number }) { const questions = [ ["What does Buffer calculate?", "Buffer models the incremental price P&L of eligible linear perpetual positions. It multiplies each signed position size by its frozen baseline oracle price and your chosen percentage move, then totals contributions with the same quote currency."], - ["Do I need a wallet or an account?", "You can explore preset accounts immediately without signing in or connecting a wallet. For a live lookup, enter a public Solana authority address. Save scenarios on your device without an account. Optional cloud sign-in never grants Buffer trading permissions."], + ["Do I need a wallet or an account?", "You can explore preset accounts immediately without signing in or connecting a wallet. For a live lookup, paste a public Solana address or tap Use my wallet, which shares only your public address and never asks for a signature. Save scenarios on your device without an account. Optional cloud sign-in never grants Buffer trading permissions, and you can delete the account in the app."], ["Is this a liquidation or account-equity forecast?", "The price scenario is not. It covers the modeled perpetual price effect and does not recalculate account equity or margin health. A separate, versioned estimate on live Velocity reads solves the oracle price at which one position alone would reach the maintenance boundary, holding everything else; it is a narrow model, not the protocol’s liquidation engine."], ["Which positions are supported?", "Explore 76 configured perpetual markets on Pacifica, spanning crypto, equities, commodities, and FX, plus SOL, BTC, ETH, and HYPE on Velocity. Browse the market list in the app. Each live position must pass market and price checks. Jupiter Perps shows verified inventory without a price-effect estimate; legacy Drift reads are paused. Unsupported exposure is excluded with an explanation."], ["Are the example numbers live market prices?", "No. Examples are deterministic fixtures, clearly labeled in the app. Live lookups use Pacifica’s public API or a Solana RPC provider and show source and freshness information. Live calculations expire after at most two minutes and require a refresh."], @@ -194,7 +194,7 @@ export default function Landing() {

Explore the price effect on your Solana perpetual positions, with the source, assumptions and coverage in view.

Open Buffer
Explore live risk Public Velocity account -
No wallet connection. No trading permissions.
+
Read-only wallet connection. No signatures or trading permissions.
@@ -240,14 +240,14 @@ export default function Landing() {