diff --git a/.gitignore b/.gitignore index 6003099a..93223874 100644 --- a/.gitignore +++ b/.gitignore @@ -1,226 +1,59 @@ -node_modules/ -**/node_modules/ -dist/ -**/dist/ -.turbo/ -**/ .turbo/ -/.pnpm-debug.log* -/.next-internal - -# next.js -/.next/ -/out/ - -# production -/build - -# misc -.DS_Store -*.pem - -# debug -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -# local env files -.env*.local - -# vercel -.vercel - -# typescript -*.tsbuildinfo -next-env.d.ts - -# Rust / Soroban -/target/ -target/ -**/target/ -Cargo.lock -# fuzz/ is a standalone binary-only crate (never published, never a -# dependency of anything) run only in CI -- committing its lockfile is -# the standard cargo-fuzz convention and is what keeps a loose upstream -# dependency spec (see fuzz/Cargo.toml's ed25519-dalek comment) from -# silently breaking CI again whenever crates.io publishes something new. -!fuzz/Cargo.lock -# Root workspace lockfile (nirium-soroban-contracts + protocol/) -- these compile -# to deployed WASM artifacts, not a library other Rust projects depend on, -# so the usual "don't commit a library's Cargo.lock" advice doesn't apply -# here; reproducible builds matter more than resolution flexibility. Same -# root cause as fuzz/Cargo.lock: without this, `ethnum` floated to 1.5.2 -# and broke CI's contracts build against the current rustc (fixed via -# `cargo update -p ethnum --precise 1.5.3`) with nobody noticing until CI -# finally got far enough to reach that step. -!/Cargo.lock -fuzz/corpus/ -fuzz/artifacts/ -nirium-soroban-contracts/test_snapshots/ -*.wasm - - - -# --------------------------------------------- -# AI Agent Generated Documentation (Ignored) -# --------------------------------------------- -# Ignoring prompts and plans generated for other networks/hackathons -# Ignore all root markdown files except core documentation -*.md -# 13-sep-2026: the *.md rule above is repo-wide (no leading /), so it was -# also silently swallowing every SKILL.md under .agents/skills/ and -# .claude/skills/ — only nirium-core-context/SKILL.md survived, via a past -# `git add -f`. Everything else (full-context-loading, nirium-github-sweep, -# npm-tarball-verify, cross-repo-content-sync, claude-antigravity-setup) -# existed only on this machine's filesystem, not in git — a fresh clone or -# machine swap would have lost them. First pass only excepted SKILL.md -# itself, then found companion .md files (cross-chain/{cctp,axelar, -# layerzero}.md, pitch-deck/references/*.md, copywriting/references/*.md, -# spec-to-code-compliance/resources/*.md) still silently caught by the same -# rule — widened to the whole directory so no future companion file repeats -# this. Explicit exception, not a `git add -f` workaround, so it survives -# future edits to the *.md list above. -!.agents/skills/** -!.claude/skills/** -!README.md -!DECISION_LOG.md -!CONTRIBUTING.md -!NIRIUM_TECHNICAL_PAPER.md -!DEMO_SCRIPT.md -!SECURITY.md -!SECURITY_AUDIT_V2.md -!claude.md -!AGENTS.md -!IsacapKey.md -!SDKs.md -!MCP_INTEGRATION_GUIDE.md -!MARKETING_PLAN_APRIL_2026.md -!Pitch_Alberto_Stellar_House_CDMX.md -!Playbook_Stellar_House_CDMX.md -!SCF_Pitch_Deck_Completo.md -!Elevator_Pitches.md -# Servable legal docs live under public/ — not internal docs, must ship. -!apps/web/public/legal/*.md -!CODE_OF_CONDUCT.md -!LICENSING.md -!SCF_Pitch_Deck_REFINED.md -!INTERNAL_SECURITY_AUDIT.md -!supanirium.md - -# --------------------------------------------- -# Legal-sensitive docs: explicit rule, not just *.md -# --------------------------------------------- -# 20-ago-2026: PAQUETE-ABOGADO-2026.md ended up committed (b117f70) with no -# rule covering it at all — the *.md pattern above never protected it, an -# earlier oversight, not a later exception overriding it. Stripped from -# history and given its own explicit rule here so a future edit to the *.md -# exception list above can't silently re-expose it the same way. -PAQUETE-ABOGADO-2026.md - -# 20-ago-2026: NiriumMainnet.md is different from the case above — the rule -# for it already existed (see the "Internal product strategy docs" list -# further down), added in the very same commit (1a384b9, 16-jul-2026) that -# ALSO force-added the file to git anyway (git add -f), contradicting the -# rule it had just written. A gitignore rule can't un-track a file once -# tracked — that's what let it stay committed for over a month despite the -# rule existing the whole time. Stripped from history (4 commits rewritten, -# main rebase); no new line needed here, the existing one below already -# covers it correctly now that the file is untracked again. - -# Ignoring plans generated if any -implementation_plan.json - -# Internal product strategy docs (not committed) -nodos.md -qapitch.md -instaward2-plan.md -propuesta-remzy.md -contrato-remzy-msa.md -SDF.md -boxb-mainnet.md -NiriumMainnet.md - -# Secrets -.env -.env.* - -# AI config -.gemini/ - -# Benchmarking -# Python / Local Dev Extras -.venv/ -**/.venv/ -venv/ -**/venv/ -*.log -.pyre_configuration -pyrightconfig.json -apps/web/.env.local -*.map -arbitrumagents.md -agent_*_keys.json - -# Compliance (internal docs - gitignored) -compliance/eligibility-checklist.md -compliance/social-media-guide.md -compliance/video-demo-script.md -compliance/out-of-scope-findings.md -# Note: claude.md is tracked (see !claude.md exception above) - -# JARGUS — Framework propietario de Gio Vargas (pentesting) -# Tracked en el repo PRIVADO — nunca sincronizar al repo público -# (el script de sync solo copia README/SECURITY/SDKs/TECHNICAL_PAPER) - -# Working/throwaway dirs (local only) -scratch/ -.vercel-backup/ -.vercel.bak/ -.env* -pitch-deploy/ - -# Salida generada por scripts/rebuild-public-repo.sh — nunca trackear -nirium-public-rebuilt/ - -# Python bytecode -__pycache__/ -*.pyc - -# Preparación de consulta legal — interno, no va al repo público -legal-preguntas-tesoreria.md - -# --------------------------------------------- -# Contexto de estrategia SCF — SOLO en el privado -# --------------------------------------------- -# Instalado el 7-ago-2026 con stellar-build. Nada de esto va al repo público -# (nirium-protocol/nirium-core, antes Eras256/Nirium) ni al de la organización (nirium-protocol/nirium-sdk). -# -# Por qué importa aunque hoy viva fuera del repo: ECOSYSTEM.md es el catálogo -# de LumenLoop con los 728 proyectos y sus montos de award, y las notas de -# estrategia dicen contra quién competimos y qué track vamos a usar. Publicar -# eso es regalarle a otro postulante el análisis que nos costó construir — y -# `*.md` ya lo cubre, pero un `!ECOSYSTEM.md` distraído lo desharía en un -# segundo. La redundancia aquí es a propósito. -ECOSYSTEM.md -PROMPT-nirium-audit.md -PROMPT-periplo-build.md -submission-*.md -dossier-*.html -correo-scf-*.md -scheme_upto_stellar.md - -# Referencias de terceros clonadas para consulta (viven en ~/stellar-ref). -# Si alguna vez se copian aquí, no se versionan: la mayoría no publica licencia, -# y la que sí la publica se consume como dependencia de npm/crates, no vendorizada. -stellar-ref/ -stellar-build/ -.stellar-build/ - -# Catálogo y skills instalados por stellar-build (viven en ~/.claude/skills). -# Se ignoran por si alguien los copia al repo para "tenerlos a mano". -**/skills/data/lumenloop/ -**/projects.json -packages/agent/central_issuer.json - -# stale deploy artifacts -nirium-soroban-contracts/deployment_id.txt -nirium-soroban-contracts/deploy_output.log +# Public mirror of the Nirium monorepo. Generic rules only: this file is +# published, so it names no internal file. + +# Dependencies +node_modules/ +.pnpm-store/ + +# Build output (root-anchored where a folder name is also a site route) +/dist/ +/build/ +/out/ +apps/web/out/ +.next/ +.next-internal/ +*.tsbuildinfo +next-env.d.ts + +# Rust / Soroban +target/ +**/test_snapshots/ +fuzz/artifacts/ +fuzz/corpus/ +fuzz/coverage/ + +# Python +__pycache__/ +*.py[cod] +.venv/ +venv/ +*.egg-info/ + +# Secrets and local configuration: never commit these +.env +.env.* +!.env.example +*.pem +*.key +*secret*.json +*_keys.json +central_issuer.json +.contract-ids.env + +# Deployment and tooling state +.vercel/ +.turbo/ +coverage/ + +# Logs and OS files +*.log +npm-debug.log* +pnpm-debug.log* +.DS_Store +Thumbs.db + +# Editors and local AI tooling +.idea/ +.vscode/ +.claude/ +.agents/ diff --git a/API_DOCUMENTATION_OPENAPI.yaml b/API_DOCUMENTATION_OPENAPI.yaml index fbf32390..0038314e 100644 --- a/API_DOCUMENTATION_OPENAPI.yaml +++ b/API_DOCUMENTATION_OPENAPI.yaml @@ -51,30 +51,30 @@ info: ## Base URLs - - **Production:** `https://nirium-agent.fly.dev` - - **Staging:** `https://api-staging.nirium.xyz` - - **Local Dev:** `http://localhost:3002` + - **Testnet agent:** `https://nirium-agent.fly.dev` + - **Mainnet agent:** `https://nirium-agent-mainnet.fly.dev` (receive-only) + - **Local Dev:** `http://localhost:3001` ## Support - - **Documentation:** https://docs.nirium.xyz + - **Documentation:** https://nirium.xyz/docs - **Email:** niriumprotocol@gmail.com - - **Discord:** https://discord.gg/nirium + - **Discord:** https://discord.gg/gAAznKrSQZ contact: name: Nirium Protocol Support email: niriumprotocol@gmail.com url: https://nirium.xyz license: - name: MIT + name: Apache-2.0 url: https://github.com/nirium-protocol/nirium-core/blob/main/LICENSE servers: - url: https://nirium-agent.fly.dev - description: Production Server - - url: https://api-staging.nirium.xyz - description: Staging Server - - url: http://localhost:3002 - description: Local Development + description: Testnet agent (full feature set) + - url: https://nirium-agent-mainnet.fly.dev + description: Mainnet agent (receive-only; holds no signing key, so signals and execute answer 501) + - url: http://localhost:3001 + description: Local development tags: - name: Public @@ -100,6 +100,80 @@ tags: paths: # ======================================== + # EXECUTION NODES, AUDIT TRAIL, REPORTING, x402 + # Added 22 Nov 2026 after checking each route against the live agents. + # Request and response shapes: the nirium SDK README + # (https://github.com/nirium-protocol/nirium/tree/main/packages/sdk). + # ======================================== + /api/nodes: + get: + tags: [Public] + summary: Execution nodes, their status, custody model and network + responses: + '200': { description: Node list } + /api/audit/info: + get: + tags: [Public] + summary: Audit Trail node info, including which pinning copies are live + responses: + '200': { description: Node info } + /api/audit/log: + post: + tags: [Public] + summary: Anchor a record or a hash to IPFS and return its CID (tamper-evident, optionally signed by the caller's own key) + description: Anchor hashes, not personal data. An invalid signature returns 400 and nothing is anchored. Rate limited to 20 requests/min. + responses: + '200': { description: CID and content hash } + '400': { description: Invalid record or signature; nothing anchored } + '429': { description: Rate limited } + /api/reporting/info: + get: + tags: [Public] + summary: Reporting node info + responses: + '200': { description: Node info } + /api/reporting/summary: + get: + tags: [Public] + summary: Read-only summary of payouts, received payments and anchors, by network + responses: + '200': { description: Summary } + /api/treasury/info: + get: + tags: [Public] + summary: Treasury node info (mainnet execution is invite-only) + responses: + '200': { description: Node info } + /api/payroll/info: + get: + tags: [Public] + summary: Payouts node info (mainnet is invite-only) + responses: + '200': { description: Node info } + /api/v1/premium/signals: + get: + tags: [Market Data] + summary: Paid signals over x402, 0.02 USDC (testnet only) + responses: + '200': { description: Paid response } + '402': { description: x402 payment requirements in the PAYMENT-REQUIRED header } + '501': { description: Not available on the mainnet agent } + /api/v1/premium/market: + get: + tags: [Market Data] + summary: Paid market data over x402, 0.05 USDC (testnet and mainnet) + responses: + '200': { description: Paid response } + '402': { description: x402 payment requirements in the PAYMENT-REQUIRED header } + /api/v1/premium/execute: + post: + tags: [Execution] + summary: Paid strategy execution over x402, 0.25 USDC (testnet only) + responses: + '200': { description: Paid response } + '402': { description: x402 payment requirements in the PAYMENT-REQUIRED header } + '501': { description: Not available on the mainnet agent } + # ======================================== # PUBLIC ENDPOINTS # ======================================== diff --git a/apps/web/app/(app)/docs/page.tsx b/apps/web/app/(app)/docs/page.tsx index 7c92cbb6..36bde864 100644 --- a/apps/web/app/(app)/docs/page.tsx +++ b/apps/web/app/(app)/docs/page.tsx @@ -1073,7 +1073,7 @@ payment-required: eyJ4NDAyVmVyc2lvbiI6MiwiZXJyb3IiOiJQYXltZW50IHJlcXVpcmVkIi... { proves: lang("Pre-sign policy hook (§7): ALLOW decision, payment settled (0.02 USDC)", "Hook de política antes de firmar (§7): decisión ALLOW, pago liquidado (0.02 USDC)"), ref: "eefd57995733c29fd1ba8244b783419015af642073e9c918a0d732a6bb81a6b3", date: "2026-10-01", link: "https://stellar.expert/explorer/testnet/tx/eefd57995733c29fd1ba8244b783419015af642073e9c918a0d732a6bb81a6b3" }, { proves: lang("Trustless Work escrow pilot (§8): deploy", "Piloto de escrow de Trustless Work (§8): despliegue"), ref: "a0ed118a0a02ad87e09f0a743cc90d32199c931baf01b052cf49393e85719850", date: "2026-10-10", link: "https://stellar.expert/explorer/testnet/tx/a0ed118a0a02ad87e09f0a743cc90d32199c931baf01b052cf49393e85719850" }, { proves: lang("Same pilot: fund", "Mismo piloto: fondeo"), ref: "8769aba1b652b01ee2aafc9083fd1a775722690757e560fb43bd49f98e4856cf", date: "2026-10-11", link: "https://stellar.expert/explorer/testnet/tx/8769aba1b652b01ee2aafc9083fd1a775722690757e560fb43bd49f98e4856cf" }, - { proves: lang("Same pilot: tampered evidence, decision gate refuses before touching the network", "Mismo piloto: evidencia alterada, la compuerta de decisión se niega antes de tocar la red"), ref: "Qmbwr5eYNex7pzvCSWVu8Q7h4bvfLzkukDu7XXtR7fnkYs", date: "2026-10-11", link: "https://gateway.pinata.cloud/ipfs/Qmbwr5eYNex7pzvCSWVu8Q7h4bvfLzkukDu7XXtR7fnkYs" }, + { proves: lang("Same pilot: tampered evidence, decision gate refuses before touching the network. This record itself does not verify (its content_sha256 is the hash of an empty input); the refusal shows as the absence of a release transaction", "Mismo piloto: evidencia alterada, la compuerta de decisión se niega antes de tocar la red. Este registro no verifica (su content_sha256 es el hash de una entrada vacía); la negativa se ve en que no hay transacción de liberación"), ref: "Qmbwr5eYNex7pzvCSWVu8Q7h4bvfLzkukDu7XXtR7fnkYs", date: "2026-10-11", link: "https://gateway.pinata.cloud/ipfs/Qmbwr5eYNex7pzvCSWVu8Q7h4bvfLzkukDu7XXtR7fnkYs" }, { proves: lang("Same pilot: valid evidence, decision gate authorizes - the approve+release in §8", "Mismo piloto: evidencia válida, la compuerta de decisión autoriza (el approve+release del §8)"), ref: "QmSpgUkiJnCfdALUtHXocKQ8GtGaG4LsxUWEoUDFDruWXN", date: "2026-10-11", link: "https://gateway.pinata.cloud/ipfs/QmSpgUkiJnCfdALUtHXocKQ8GtGaG4LsxUWEoUDFDruWXN" }, { proves: lang("MPP Charge: settled payment", "MPP Charge: pago liquidado"), ref: "4d20d8648ce001c4e8e894725ad08a8dbcd3904e0024ca440728bc91e6c10236", date: "2026-10-15", link: "https://stellar.expert/explorer/testnet/tx/4d20d8648ce001c4e8e894725ad08a8dbcd3904e0024ca440728bc91e6c10236" }, { proves: lang("MPP Charge: settled payment", "MPP Charge: pago liquidado"), ref: "e70cfcb884c17d946210a000a627b7a9c316737a61a66ad2e42d905df679f167", date: "2026-10-15", link: "https://stellar.expert/explorer/testnet/tx/e70cfcb884c17d946210a000a627b7a9c316737a61a66ad2e42d905df679f167" }, diff --git a/apps/web/app/(app)/keys/layout.tsx b/apps/web/app/(app)/keys/layout.tsx index e9719037..a53e1037 100644 --- a/apps/web/app/(app)/keys/layout.tsx +++ b/apps/web/app/(app)/keys/layout.tsx @@ -3,7 +3,7 @@ import { pageMetadata } from "@/lib/pageMetadata"; export const metadata = pageMetadata({ path: "/keys", title: "API Keys", - description: "Issue a free Nirium API key tied to your Stellar wallet, proven by signature. One key works on testnet and mainnet.", + description: "Issue a free Nirium API key tied to your Stellar wallet, proven by signature. One key works on testnet and mainnet; mainnet Payouts and Treasury are invite-only.", }); export default function KeysLayout({ children }: { children: React.ReactNode }) { diff --git a/apps/web/app/(app)/payouts/page.tsx b/apps/web/app/(app)/payouts/page.tsx index 62c3b7fe..051f83da 100644 --- a/apps/web/app/(app)/payouts/page.tsx +++ b/apps/web/app/(app)/payouts/page.tsx @@ -365,8 +365,8 @@ export default function PayrollPage() { declaración que nadie leyó no declara nada. */}

{lang( - 'By continuing you represent, on this and every occasion of use, that you are not located in or a resident of a prohibited jurisdiction, that you are not a sanctioned person or acting for one, and that Payouts is not offered where you are (today this excludes the EEA, the UK and the US). Nirium relies on this.', - 'Al continuar declaras, en esta y en cada ocasión de uso, que no te encuentras ni resides en una jurisdicción prohibida, que no eres una persona sancionada ni actúas por cuenta de una, y que Payouts no se ofrece donde estás (hoy quedan fuera el EEE, el Reino Unido y Estados Unidos). Nirium confía en esta declaración.')} + 'By continuing you represent, on this and every occasion of use, that you are not located in or a resident of a prohibited jurisdiction, that you are not a sanctioned person or acting for one, and, on mainnet, that Payouts is offered where you are (today mainnet excludes the EEA, the UK and the US; testnet is open there as a demonstration). Nirium relies on this.', + 'Al continuar declaras, en esta y en cada ocasión de uso, que no te encuentras ni resides en una jurisdicción prohibida, que no eres una persona sancionada ni actúas por cuenta de una, y, en mainnet, que Payouts se ofrece donde estás (hoy mainnet excluye al EEE, el Reino Unido y Estados Unidos; testnet está abierto ahí como demostración). Nirium confía en esta declaración.')}

@@ -454,8 +454,8 @@ export default function PayrollPage() { className="flex items-center justify-between rounded-xl border border-white/8 bg-white/[0.015] px-4 py-3">

- {run.totalAmount} {run.asset} - · {run.recipientCount} {p.runs.recipients} + {Number.isFinite(Number(run.totalAmount)) ? Number(run.totalAmount).toLocaleString('en-US', { maximumFractionDigits: 7 }) : run.totalAmount} {run.asset} + · {run.recipientCount} {Number(run.recipientCount) === 1 ? lang('recipient', 'destinatario') : lang('recipients', 'destinatarios')}

diff --git a/apps/web/app/(app)/stats/page.tsx b/apps/web/app/(app)/stats/page.tsx index 1b3c8c5a..e2604785 100644 --- a/apps/web/app/(app)/stats/page.tsx +++ b/apps/web/app/(app)/stats/page.tsx @@ -2,7 +2,8 @@ * the initial HTML (not behind a client-only fetch) - a non-JS crawler, or * Wayback Machine's save-page request, sees the same figures a visitor does. * See app/api/stats/statsData.ts for the exact queries. */ -export const revalidate = 300; // 5 min - matches /api/stats's own cache +export const revalidate = 1800; // 30 min - matches /api/stats's own cache. Was 5 min; each +// regeneration calls Horizon, npm, PyPI and GitHub, and was most of the site's Vercel Active CPU. export const maxDuration = 60; import { pageMetadata } from '@/lib/pageMetadata'; diff --git a/apps/web/app/(app)/treasury/builder/page.tsx b/apps/web/app/(app)/treasury/builder/page.tsx index bd41a536..c68a77ab 100644 --- a/apps/web/app/(app)/treasury/builder/page.tsx +++ b/apps/web/app/(app)/treasury/builder/page.tsx @@ -141,7 +141,6 @@ function StrategyBuilderInner() { color: 'from-purple-500 to-indigo-600', items: [ { type: 'condition', label: 'CLIENT_SIGNATURE', icon: 'Shield' }, - { type: 'condition', label: 'TEAM_APPROVAL', icon: 'CheckSquare' }, { type: 'action', label: 'ONCHAIN_AUDIT', icon: 'Fingerprint' }, ] }, @@ -840,7 +839,7 @@ export default function StrategyBuilderPro() { // superior del layout (3.75rem).
- {/* Growth plan preview banner */} + {/* Preview banner - mainnet is invite-only, not unlocked by a plan */}
@@ -849,7 +848,7 @@ export default function StrategyBuilderPro() {
{t.strategy_builder.upgrade_banner.upgrade} @@ -871,7 +870,7 @@ export default function StrategyBuilderPro() { {t.strategy_builder.deploy_gate.title} {t.strategy_builder.deploy_gate.plan} diff --git a/apps/web/app/(app)/treasury/vault/page.tsx b/apps/web/app/(app)/treasury/vault/page.tsx index 96e5854b..c1f5378b 100644 --- a/apps/web/app/(app)/treasury/vault/page.tsx +++ b/apps/web/app/(app)/treasury/vault/page.tsx @@ -752,7 +752,7 @@ export default function TreasuryVaultConsole() { {/* Inspeccionar */}

- {network === 'mainnet' ? lang('2 · Check your vault or withdraw', '2 · Revisa tu bóveda o retira') : lang('2 · Verify, deposit and rebalance', '2 · Verifica, deposita y rebalancea')} + {network === 'mainnet' ? lang('Check your vault or withdraw', 'Revisa tu bóveda o retira') : lang('2 · Verify, deposit and rebalance', '2 · Verifica, deposita y rebalancea')}

setLookup(e.target.value)} spellCheck={false} @@ -1018,8 +1018,8 @@ export default function TreasuryVaultConsole() { 'On mainnet, rebalancing is not triggered from here. It is called by the RebalanceManager - the agent, with its own key - and it can only move funds between the strategies already inside your vault.', 'En mainnet el rebalanceo no se dispara desde aquí. Lo llama el RebalanceManager - el agente, con su propia llave - y solo puede mover fondos entre las estrategias que ya están dentro de tu bóveda.') : lang( - 'On testnet you can ask the agent to Invest or Unwind with the buttons above, to see it work. It signs with its own key and can only move funds between the vault and its strategy. On mainnet there is no button: the agent decides on its own.', - 'En testnet puedes pedirle al agente Invertir o Sacar de la estrategia con los botones de arriba, para verlo funcionar. Firma con su propia llave y solo puede mover fondos entre la bóveda y su estrategia. En mainnet no hay botón: el agente decide solo.')}{' '} + 'On testnet you can ask the agent to Invest or Unwind with the buttons above, to see it work. It signs with its own key and can only move funds between the vault and its strategy. On mainnet there is no button: the agent decides on its own, only on vaults where autonomous rebalancing is switched on, which on mainnet is invite-only.', + 'En testnet puedes pedirle al agente Invertir o Sacar de la estrategia con los botones de arriba, para verlo funcionar. Firma con su propia llave y solo puede mover fondos entre la bóveda y su estrategia. En mainnet no hay botón: el agente decide solo, únicamente en bóvedas donde el rebalanceo autónomo está encendido, y en mainnet eso es por invitación.')}{' '} {lang('How the node works', 'Cómo funciona el nodo')} diff --git a/apps/web/app/api/logs/route.ts b/apps/web/app/api/logs/route.ts index 3cad7303..3b883fbf 100644 --- a/apps/web/app/api/logs/route.ts +++ b/apps/web/app/api/logs/route.ts @@ -117,7 +117,9 @@ export async function GET() { typeof l.message === 'string' ? { ...l, message: redactPrivateAnchorLog(l.message) } : l, ); - return NextResponse.json(publicFeed); + // CDN cache: every open /agents or /dashboard tab polls this route; one run per + // 10 s serves all of them instead of one run per tab per poll. + return NextResponse.json(publicFeed, { headers: { 'Cache-Control': 'public, max-age=0, s-maxage=10, stale-while-revalidate=20' } }); } catch (e) { console.error('[API /logs] GET Error:', e); return NextResponse.json([], { status: 200 }); diff --git a/apps/web/app/api/stats/route.ts b/apps/web/app/api/stats/route.ts index 24d1643b..c38c5842 100644 --- a/apps/web/app/api/stats/route.ts +++ b/apps/web/app/api/stats/route.ts @@ -1,9 +1,9 @@ export const maxDuration = 60; // the reporting API answers in ~4s each; three calls must not hit a short cut-off -export const revalidate = 300; // 5 min - protects GitHub's search rate limit, not to hide staleness +export const revalidate = 1800; // 30 min - Vercel Active CPU and GitHub's search rate limit, not to hide staleness import { getStatsData } from './statsData'; export async function GET() { const data = await getStatsData(); - return Response.json(data, { headers: { 'Cache-Control': 'public, max-age=0, s-maxage=300, stale-while-revalidate=600' } }); + return Response.json(data, { headers: { 'Cache-Control': 'public, max-age=0, s-maxage=1800, stale-while-revalidate=3600' } }); } diff --git a/apps/web/app/api/strategies/premium/route.ts b/apps/web/app/api/strategies/premium/route.ts deleted file mode 100644 index c65d6139..00000000 --- a/apps/web/app/api/strategies/premium/route.ts +++ /dev/null @@ -1,100 +0,0 @@ -import { NextResponse } from 'next/server'; -import { Horizon } from '@stellar/stellar-sdk'; - -/** - * NIRIUM x402 PREMIUM STRATEGIES API - * - * Implements the Semantic Micro-billing protocol (April 2026). - * Agents must pay 0.10 USDC to the Settlement Hub to unlock high-ELO CIDs. - */ - -const SETTLEMENT_HUB = process.env.NEXT_PUBLIC_CONTRACT_PROTOCOL || "CBKCTMTCCZQIPEESLHHEZKXYSPWNO24NEG33T2XSAAAHPISBND5CNSXX"; -const USDC_ASSET = "USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5"; -const [USDC_CODE, USDC_ISSUER] = USDC_ASSET.split(':'); -const FEE_AMOUNT = "0.10"; - -// Best-effort, in-memory only - not persisted across restarts or shared -// across instances. Same documented limit as apps/web/app/api/marketplace/install/[id]/route.ts. -const consumedTxHashes = new Set(); - -export async function GET(request: Request) { - const { searchParams } = new URL(request.url); - const txHash = searchParams.get('tx'); - - // 1. If no transaction hash provided, return 402 (Standard x402) - if (!txHash) { - return new NextResponse( - JSON.stringify({ - error: "Payment Required", - message: "Nirium Semantic Analysis requires a micro-payment of 0.10 USDC", - payment_intent: { - destination: SETTLEMENT_HUB, - asset: USDC_ASSET, - amount: FEE_AMOUNT, - memo: "X402_PREMIUM_UNLOCK" - } - }), - { - status: 402, - headers: { - 'Content-Type': 'application/json', - 'X-Settlement': 'stellar:testnet', - 'X-Asset': USDC_ASSET, - 'X-Amount': FEE_AMOUNT, - 'X-Pay-To': SETTLEMENT_HUB - } - } - ); - } - - // 2. Verify the payment on-chain via Horizon - try { - if (consumedTxHashes.has(txHash)) { - return NextResponse.json({ error: "Transaction already consumed" }, { status: 403 }); - } - - const horizon = new Horizon.Server("https://horizon-testnet.stellar.org"); - // .transaction(id) returns a CallBuilder, not the record - needs - // .call() to actually fetch. The pre-existing `await ...transaction(txHash)` - // (no .call()) never fetched anything; its result was unused, so the - // bug was silent until this check needed the real record. - const tx = await horizon.transactions().transaction(txHash).call(); - if (!tx.successful) { - return NextResponse.json({ error: "Transaction did not succeed" }, { status: 403 }); - } - - // Security checks: destination, asset, and amount - a payment op - // has no asset_code/asset_issuer check here previously, so any - // self-issued or native asset moved at sufficient face value would - // pass. Fixed 1-sep-2026 alongside the same bug class already found - // in marketplace/install/[id]/route.ts. - const operations = await horizon.operations().forTransaction(txHash).call(); - const paymentOp = operations.records.find((op: any) => - op.type === 'payment' && - op.to === SETTLEMENT_HUB && - op.asset_code === USDC_CODE && - op.asset_issuer === USDC_ISSUER && - parseFloat(op.amount) >= parseFloat(FEE_AMOUNT) - ); - - if (!paymentOp) { - return NextResponse.json({ error: "Invalid payment record" }, { status: 403 }); - } - - consumedTxHashes.add(txHash); - - // 3. Return the Premium Strategy data - return NextResponse.json({ - success: true, - data: { - strategy_name: "Nirium Alpha Sentinel v2.1", - ipfs_cid: "QmXoypizjW3WknFiJnKLwHCnL72vedxjQkDDP1mXWo6uco", - expected_apy: "14.5%", - last_elo_validation: 1450 - } - }); - - } catch (e) { - return NextResponse.json({ error: "Transaction not found or chain lag" }, { status: 404 }); - } -} diff --git a/apps/web/components/dashboard/MarketTicker.tsx b/apps/web/components/dashboard/MarketTicker.tsx index 3c6013d4..5f47704a 100644 --- a/apps/web/components/dashboard/MarketTicker.tsx +++ b/apps/web/components/dashboard/MarketTicker.tsx @@ -3,7 +3,10 @@ import React, { useEffect, useState, useRef } from 'react'; import { motion } from 'framer-motion'; -const API_URL = process.env.NEXT_PUBLIC_AGENT_API_URL || 'https://nirium-agent.fly.dev'; +// 19-nov-2026: el ticker muestra mercado (precio XLM, spread del SDEX) y el único mercado real es +// mainnet. Leía NEXT_PUBLIC_AGENT_API_URL (el agente de testnet), cuyo libro daba un spread fijo de +// 150.5 bps contra ~11 bps de mainnet. Misma regla que app/api/market/route.ts (12-nov). +const API_URL = process.env.NEXT_PUBLIC_MARKET_AGENT_URL || 'https://nirium-agent-mainnet.fly.dev'; const POLL_INTERVAL = 4_000; interface TickerItem { diff --git a/apps/web/components/home/PaymentStory.tsx b/apps/web/components/home/PaymentStory.tsx index 76f7ad2d..f21b8ffa 100644 --- a/apps/web/components/home/PaymentStory.tsx +++ b/apps/web/components/home/PaymentStory.tsx @@ -22,8 +22,8 @@ const STEPS: Step[] = [ es: "Antes de firmar nada, tu motor de políticas dice permitir, esperar a un humano o negar.", }, { - en: "Only on allow does it sign the payment - testnet today.", - es: "Solo si permite, firma el pago - hoy en testnet.", + en: "Only on allow does it sign the payment.", + es: "Solo si permite, firma el pago.", }, { en: "x402Serve() checks it and lets the request through.", diff --git a/apps/web/hooks/useFreighter.ts b/apps/web/hooks/useFreighter.ts index 42678336..338b67c4 100644 --- a/apps/web/hooks/useFreighter.ts +++ b/apps/web/hooks/useFreighter.ts @@ -62,7 +62,7 @@ function ensureInit() { projectId: "8505f6eaaa44b34387416821007c224f", metadata: { name: 'Nirium Protocol', - description: 'Institutional-grade autonomous Stellar Strategic Fleet.', + description: 'Payments, verifiable receipts and treasury tools on Stellar.', url: origin, icons: [`${origin}/icon.png`] } diff --git a/apps/web/lib/og/sections.ts b/apps/web/lib/og/sections.ts index 5c1b2248..ecc957f8 100644 --- a/apps/web/lib/og/sections.ts +++ b/apps/web/lib/og/sections.ts @@ -27,7 +27,7 @@ export const OG_SECTIONS: Record = { kind: "section", kicker: "x402 on Stellar", headline: "Payment, audit and execution rails on Stellar.", - support: "For apps, backends and AI agents. Charge per request, prove every move.", + support: "For apps, backends and AI agents. Charge per request, prove what the chain doesn't show.", chips: ["Non-custodial: your keys, your funds", "Testnet + mainnet"], accent: "yellow", alt: "Nirium - payment, audit and execution rails on Stellar for apps, backends and AI agents", diff --git a/apps/web/lib/tierBGate.ts b/apps/web/lib/tierBGate.ts index 77b525a9..deef23ce 100644 --- a/apps/web/lib/tierBGate.ts +++ b/apps/web/lib/tierBGate.ts @@ -31,24 +31,25 @@ export const TIER_B_COUNTRIES = new Set([ 'GB', 'US', ]); -// Política v1.1 (8-nov-2026), §1 y §4: -// - Treasury en testnet SÍ se ofrece en Tier B, como demostración: tokens sin valor. -// - Payouts NO se ofrece en ninguna red: los términos de Payouts, que se aceptan en -// cada corrida, incluyen declarar que no estás en Tier B. Abrir Payouts en testnet -// pide cambiar primero esos términos. +// Política v1.4 (18-nov-2026), §1 y §4: +// - Treasury y Payouts en testnet SÍ se ofrecen en Tier B, como demostración: +// tokens sin valor. Treasury desde la v1.1 (8-nov); Payouts desde la v1.4, cuando +// los términos de Payouts v1.4 limitaron a mainnet la declaración de no estar en +// Tier B. +// - En mainnet los dos siguen cerrados en Tier B hasta tener una opinión legal. export type GatedProduct = 'treasury' | 'payouts'; /** 451 si el visitante está en Tier B y la operación aplica; null si puede seguir. */ export function tierBBlock(req: NextRequest, network: 'mainnet' | 'testnet', product: GatedProduct): NextResponse | null { const country = (req.headers.get('x-vercel-ip-country') || '').toUpperCase(); if (!country || !TIER_B_COUNTRIES.has(country)) return null; - if (product === 'treasury' && network === 'testnet') return null; + if (network === 'testnet') return null; return NextResponse.json( { error: 'unavailable_for_legal_reasons', message: product === 'treasury' ? 'The Treasury node is not offered on mainnet in your jurisdiction pending a written legal opinion. It is available on testnet as a demonstration, and withdrawing from your own vault is always available. Settlement, Audit and Reporting remain available.' - : 'Payouts is not offered in your jurisdiction pending a written legal opinion. Settlement, Audit and Reporting remain available.', + : 'Payouts is not offered on mainnet in your jurisdiction pending a written legal opinion. It is available on testnet as a demonstration. Settlement, Audit and Reporting remain available.', jurisdiction: country, policy: 'https://nirium.xyz/legal/restricted-jurisdictions-v1.md', contact: 'niriumprotocol@gmail.com', diff --git a/apps/web/public/legal/restricted-jurisdictions-v1.md b/apps/web/public/legal/restricted-jurisdictions-v1.md index 82c9f7c2..4d80bc81 100644 --- a/apps/web/public/legal/restricted-jurisdictions-v1.md +++ b/apps/web/public/legal/restricted-jurisdictions-v1.md @@ -1,6 +1,6 @@ -# Nirium - Restricted Jurisdictions & Sanctions Policy (v1.3) +# Nirium - Restricted Jurisdictions & Sanctions Policy (v1.4) -**Effective:** August 6, 2026 · **Last updated:** November 16, 2026 (v1.3) · **Issuer:** Nirium Protocol Team (Mexico) · **Applies to:** every Nirium service, on every network +**Effective:** August 6, 2026 · **Last updated:** November 19, 2026 (v1.4) · **Issuer:** Nirium Protocol Team (Mexico) · **Applies to:** every Nirium service, on every network This policy governs **who may use Nirium and from where**. It applies on top of, and together with, the [Payouts Terms of Use](/legal/payouts-terms-v1.md) and the site Terms. Where this policy is stricter, this policy prevails. @@ -13,7 +13,7 @@ Nirium is a **software provider established in Mexico**. It is not a financial i | Tier | What it means | Who is in it | |---|---|---| | **A. Prohibited** | No access to any Nirium service, testnet or mainnet, paid or free. | Comprehensively sanctioned jurisdictions, FATF call-for-action jurisdictions, jurisdictions under prudential restriction pending review, sanctioned persons, and the People's Republic of China (§2, §3) | -| **B. Restricted** | Informational access only. **Payouts is not offered on any network. The Treasury node is not offered on mainnet;** on testnet, where test tokens have no value, it remains available as a demonstration. Settlement, Audit and Reporting remain available. | European Economic Area, United Kingdom, United States (§4) | +| **B. Restricted** | **Payouts and the Treasury node are not offered on mainnet;** on testnet, where test tokens have no value, both remain available as a demonstration. Settlement, Audit and Reporting remain available. | European Economic Area, United Kingdom, United States (§4) | | **C. Available** | All services offered, subject to the applicable terms and any invite-only gate. | Everywhere else, including Mexico and the rest of Latin America (§5) | Tier B is **not a statement that those services are unlawful there.** It is a statement that Nirium has not yet obtained the legal opinion it considers necessary before offering them into those markets, and will not offer them until it does. This document will be revised when that opinion is issued. @@ -35,7 +35,7 @@ Nirium does not offer, sell, or provide any service to any person located in, or **Cuba, Iran, North Korea, Syria,** and the listed **regions of Ukraine** reflect comprehensive sanctions programmes administered by the U.S. Office of Foreign Assets Control (OFAC) and mirrored, in substance, by the European Union and the United Nations Security Council. Mexico applies UN Security Council resolutions and its own asset-freeze regime under the LFPIORPI. Nirium applies the broadest of these standards rather than the narrowest. -**Myanmar** rests on a different basis: FATF has issued a public call for action against it (as of the June 2026 plenary, the list is the DPRK, Iran and Myanmar), not OFAC sanctions. **Russia, Belarus and Afghanistan** rest on a third, narrower basis: a prudential restriction pending Nirium's own review, not a sanctions programme or FATF listing. Nirium treats all three bases the same way operationally - no access to any service - but the legal basis for each differs, and this policy will revise the weaker two independently of the first if that review concludes differently. +**Myanmar** rests on a different basis: FATF has issued a public call for action against it (after the October 2026 plenary, the list is still the DPRK, Iran and Myanmar), not OFAC sanctions. **Russia, Belarus and Afghanistan** rest on a third, narrower basis: a prudential restriction pending Nirium's own review, not a sanctions programme or FATF listing. Nirium treats all three bases the same way operationally - no access to any service - but the legal basis for each differs, and this policy will revise the weaker two independently of the first if that review concludes differently. ## 3. The People's Republic of China - a distinct basis @@ -45,15 +45,15 @@ That extraterritorial reach is why Nirium does not serve mainland China, and why ## 4. Tier B - Restricted, pending legal opinion -In these jurisdictions Nirium offers **Settlement (x402)**, **Audit anchoring** and **Reporting**, which involve no movement of third-party assets. Nirium does **not** offer **Payouts** on any network, nor the **Treasury node on mainnet**. +In these jurisdictions Nirium offers **Settlement (x402)**, **Audit anchoring** and **Reporting**, which involve no movement of third-party assets. Nirium does **not** offer **Payouts** or the **Treasury node** on **mainnet**. -The Treasury node on **testnet** remains available in these jurisdictions as a demonstration: testnet tokens have no monetary value and cannot be exchanged for anything that does, so no crypto-asset or third-party funds are moved. Payouts on testnet stays unavailable here because accepting the Payouts Terms of Use, which every run requires, includes the representation that the user is not in a Tier B jurisdiction. Withdrawing from a vault you already own is never restricted outside Tier A: returning your own funds to you is not a service offered into that market. +Payouts and the Treasury node on **testnet** remain available in these jurisdictions as a demonstration: testnet tokens have no monetary value and cannot be exchanged for anything that does, so no crypto-asset or third-party funds are moved. The Payouts Terms of Use limit the Tier B exclusion to mainnet accordingly. Withdrawing from a vault you already own is never restricted outside Tier A: returning your own funds to you is not a service offered into that market. ### 4.1 European Economic Area Regulation (EU) 2023/1114 (**MiCA**) lists as a regulated crypto-asset service the *"transfer service for crypto-assets on behalf of clients"*, defined as moving crypto-assets from one distributed-ledger address to another on behalf of a natural or legal person. **That definition does not require custody.** Nirium's Payouts node builds the instruction that disperses a client's funds to as many as one hundred recipients; although the client signs and broadcasts it and Nirium never holds the funds, Nirium is an identifiable intermediary constructing the transfer, and the MiCA recital concerning fully decentralised services without any intermediary does not cleanly apply. -Nirium therefore does not offer Payouts or the Treasury node in the EEA until it holds a written opinion on that point. +Nirium therefore does not offer Payouts or the Treasury node on mainnet in the EEA until it holds a written opinion on that point. ### 4.2 United Kingdom @@ -63,7 +63,7 @@ The UK financial-promotions regime for cryptoassets (in force 8 October 2023) re The FinCEN guidance of 9 May 2019 on convertible virtual currencies excludes from money-transmission both providers of *"delivery, communication, or network access services"* and non-custodial wallet providers, on the basis that money transmission requires both acceptance **and** transmission of value. Nirium accepts nothing: it produces an unsigned transaction. Nirium's assessment is that it falls outside the federal definition. -State money-transmitter regimes are not uniform, however, and Nirium has not obtained state-by-state advice. Pending that, Payouts and the Treasury node are not offered to U.S. persons. Nirium also does not offer any service that would constitute investment advice; the Treasury node's rebalancing rule is deterministic, published in advance, and executed inside an account the client alone controls, but that analysis has not been tested against the Investment Advisers Act and Nirium will not rely on it commercially until it has been. +State money-transmitter regimes are not uniform, however, and Nirium has not obtained state-by-state advice. Pending that, Payouts and the Treasury node are not offered on mainnet to U.S. persons. Nirium also does not offer any service that would constitute investment advice; the Treasury node's rebalancing rule is deterministic, published in advance, and executed inside an account the client alone controls, but that analysis has not been tested against the Investment Advisers Act and Nirium will not rely on it commercially until it has been. ## 5. Tier C - Available @@ -118,4 +118,4 @@ This policy is governed by the laws of the United Mexican States. Any dispute sh --- -*Version 1.3 - 16 November 2026. Changes from 1.2: §8 no longer describes the Obligated Subject question as "under external legal review"; no lawyer has been engaged yet, and the question awaits a written legal opinion. Version 1.2 - 9 November 2026. Changes from 1.1: Afghanistan moved from the FATF basis to the prudential basis, since FATF's call-for-action list is the DPRK, Iran and Myanmar (§2); MPP Charge removed from the Tier B offer, which is x402 settlement only (§4); §8 aligned with the Payouts Terms, which treat Obligated Subject status as an open question rather than a settled one; in-force date stated without "approximately". Version 1.1 - 8 November 2026: in Tier B, the Treasury node on testnet is available as a demonstration, and withdrawing from your own vault is not restricted (§1, §4). Version 1.0 - 6 August 2026. This document is versioned and its SHA-256 hash may be referenced in audit receipts. It is a statement of Nirium's own operating policy and is not legal advice to any user; each user should consult its own counsel on the law applicable to it.* +*19 November 2026, no change to who may use Nirium: the FATF reference in §2 now cites the October 2026 plenary (the call-for-action list did not change), and the header date, which still showed v1.3, now matches this version. Version 1.4 - 18 November 2026. Changes from 1.3: in Tier B, Payouts on testnet is available as a demonstration, as the Treasury node on testnet already was; mainnet stays closed for both (§1, §4, §4.1, §4.3). Version 1.3 - 16 November 2026. Changes from 1.2: §8 no longer describes the Obligated Subject question as "under external legal review"; no lawyer has been engaged yet, and the question awaits a written legal opinion. Version 1.2 - 9 November 2026. Changes from 1.1: Afghanistan moved from the FATF basis to the prudential basis, since FATF's call-for-action list is the DPRK, Iran and Myanmar (§2); MPP Charge removed from the Tier B offer, which is x402 settlement only (§4); §8 aligned with the Payouts Terms, which treat Obligated Subject status as an open question rather than a settled one; in-force date stated without "approximately". Version 1.1 - 8 November 2026: in Tier B, the Treasury node on testnet is available as a demonstration, and withdrawing from your own vault is not restricted (§1, §4). Version 1.0 - 6 August 2026. This document is versioned and its SHA-256 hash may be referenced in audit receipts. It is a statement of Nirium's own operating policy and is not legal advice to any user; each user should consult its own counsel on the law applicable to it.* diff --git a/apps/web/public/partners/agentrail.png b/apps/web/public/partners/agentrail.png new file mode 100644 index 00000000..7b955e5d Binary files /dev/null and b/apps/web/public/partners/agentrail.png differ diff --git a/packages/agent/README.md b/packages/agent/README.md index 21117bc3..42130397 100644 --- a/packages/agent/README.md +++ b/packages/agent/README.md @@ -3,7 +3,7 @@ This package contains the proprietary execution logic for the Nirium Network. It is a private component and its source code is not included in the public repository. ## Why is this private? -Nirium is an institutional-grade treasury protocol. While the **Smart Contracts** (on-chain logic) and **SDKs** (integration layer) are open-source for trust and auditability, the **Autonomous Execution Engine** represents our core Intellectual Property. +Nirium is payment, audit and treasury infrastructure on Stellar. While the **Smart Contracts** (on-chain logic) and **SDKs** (integration layer) are open-source for trust and auditability, the **Autonomous Execution Engine** represents our core Intellectual Property. ## How to use? To interact with the Nirium Network, please use the provided SDKs: