Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/api/ai/admin/benchmarks/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type BenchmarkMutationRequest = {
| "response_quality"
| "execution_safety"
| "personalization_lift"
| "web5_game_integration"
| "game_integration"
| "live_chart_readiness";
score?: number;
notes?: string;
Expand Down
4 changes: 0 additions & 4 deletions app/api/environment/init/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@ import {
enforceRateLimit,
enforceTrustedOrigin,
isJsonContentType,
sanitizePlainText,
} from "@/lib/security";
import { NextRequest, NextResponse } from "next/server";
import crypto from "node:crypto";

interface EnvironmentInitRequest {
userId?: string;
walletAddress?: string;
preferences?: {
riskTolerance?: "conservative" | "moderate" | "aggressive";
tradingExperience?: "beginner" | "intermediate" | "expert";
Expand Down Expand Up @@ -44,7 +42,6 @@ export async function POST(request: NextRequest) {
try {
const body: EnvironmentInitRequest = await request.json();
const userId = await resolveRequestUserId(request, body.userId);
const walletAddress = sanitizePlainText(String(body.walletAddress || ""), 96);
const riskTolerance =
body.preferences?.riskTolerance === "conservative" ||
body.preferences?.riskTolerance === "moderate" ||
Expand All @@ -64,7 +61,6 @@ export async function POST(request: NextRequest) {

const environment = {
userId,
walletAddress: walletAddress || null,
preferences: {
riskTolerance,
tradingExperience,
Expand Down
8 changes: 2 additions & 6 deletions app/api/game/claim-artifact/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
import { NextResponse } from "next/server";

const SAFE_ID_REGEX = /^[a-zA-Z0-9._:-]{1,128}$/;
const SAFE_COLLECTION_REGEX = /^[a-zA-Z0-9._:/-]{1,160}$/;

function isSafeId(value: string) {
return SAFE_ID_REGEX.test(value);
Expand Down Expand Up @@ -64,8 +63,6 @@ function isArtifactCollectionEvent(value: unknown, request: Request): value is A
isFiniteNumberInRange(event.tokenRewardUnits, 0, 250_000) &&
typeof event.claimEndpoint === "string" &&
endpointMatchesRequest(event.claimEndpoint, request) &&
typeof event.web5Collection === "string" &&
SAFE_COLLECTION_REGEX.test(event.web5Collection) &&
isIsoDateString(event.collectedAt) &&
utilityFieldsValid
);
Expand Down Expand Up @@ -121,8 +118,8 @@ export async function POST(request: Request) {
queuedAt: new Date().toISOString(),
settlement: {
status: "queued",
mode: "web5-preclaim",
networkHint: "l2-staging",
mode: "preclaim",
networkHint: "staging",
},
claimRecord: {
levelId: payload.levelId,
Expand All @@ -132,7 +129,6 @@ export async function POST(request: Request) {
utilityPointsAfterEvent: payload.utilityPointsAfterEvent ?? null,
utilityTokenBonusUnits: payload.utilityTokenBonusUnits ?? 0,
lockedAtPickup: payload.lockedAtPickup ?? false,
collection: payload.web5Collection,
},
},
{ headers: withBaseHeaders(rate.headers) },
Expand Down
8 changes: 0 additions & 8 deletions app/api/game/leaderboard/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import { NextResponse } from "next/server";
const MAX_ENTRIES = 100;
const MAX_SEEN_SESSION_KEYS = 2_000;
const SAFE_ID_REGEX = /^[a-zA-Z0-9._:-]{1,128}$/;
const SAFE_WALLET_REGEX = /^[1-9A-HJ-NP-Za-km-z]{32,64}$/;

const SCORE_BOUNDS = {
score: { min: 0, max: 5_000_000 },
Expand Down Expand Up @@ -137,10 +136,6 @@ function isValidSubmission(payload: LeaderboardSubmission) {
if (oauthUserId.length < 1) return false;
}

if (payload.walletAddress && !SAFE_WALLET_REGEX.test(payload.walletAddress)) {
return false;
}

return true;
}

Expand All @@ -151,8 +146,6 @@ function toEntry(payload: LeaderboardSubmission): LeaderboardEntry {
displayName: sanitizeDisplayName(payload.displayName),
oauthProvider: payload.oauthProvider,
oauthUserId: sanitizeOptionalId(payload.oauthUserId, 256),
walletAddress: sanitizeOptionalId(payload.walletAddress, 128),
web5Enabled: Boolean(payload.web5Enabled && payload.walletAddress),
levelId: sanitizePlainText(run.levelId, 128) || "level",
score: Math.round(run.score),
combo: Math.round(run.combo),
Expand All @@ -172,7 +165,6 @@ function toEntry(payload: LeaderboardSubmission): LeaderboardEntry {
function getSessionKey(payload: LeaderboardSubmission) {
const identity =
sanitizeOptionalId(payload.oauthUserId, 256) ??
sanitizeOptionalId(payload.walletAddress, 128) ??
sanitizeDisplayName(payload.displayName).toLowerCase();
return `${payload.run.sessionId}:${payload.oauthProvider}:${identity}`;
}
Expand Down
37 changes: 0 additions & 37 deletions app/api/staking/pool-v2/route.ts

This file was deleted.

63 changes: 22 additions & 41 deletions app/crypto-project/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { WalletButton } from "@/components/counter/WalletButton";
import { ActionRail } from "@/components/monetization/ActionRail";
import { ActionRail } from "@/components/monetization/ActionRail";
import { TrackedCtaLink } from "@/components/monetization/TrackedCtaLink";
import { ShamrockFooter } from "@/components/shamrock/ShamrockFooter";
import { createPageMetadata } from "@/lib/seo";
Expand All @@ -12,22 +11,22 @@ import {
} from "lucide-react";

export const metadata = createPageMetadata({
title: "Crypto and Web3 Project | TradeHax AI",
title: "Digital Services & Product Roadmap | TradeHax AI",
description:
"Explore TradeHax AI Web3 progress, including wallet onboarding, NFT utility planning, and product roadmap updates.",
"Explore TradeHax AI's service roadmap including AI consulting, web development, game experiences, and premium platform updates.",
path: "/crypto-project",
keywords: ["web3 project", "multi-chain onboarding", "nft utility roadmap", "crypto product updates"],
keywords: ["digital services", "ai consulting", "web development", "product roadmap", "platform updates"],
});

const features = [
{
title: "Connect Wallet",
text: "Securely link your crypto wallet when you want on-chain features. Optional for regular browsing.",
title: "AI Consulting",
text: "Get expert guidance on integrating AI into your workflow, products, and business operations.",
icon: ShieldCheck,
},
{
title: "Entry Mint",
text: "Create your token access pass (mint) for gated tools, game rewards, and roadmap drops.",
title: "Web Development",
text: "Custom websites, apps, and digital systems built for revenue and growth.",
icon: Gem,
},
{
Expand All @@ -37,7 +36,7 @@ const features = [
},
{
title: "Game + Rewards Integration",
text: "Hyperborea rewards connect to scoring, with bonuses based on rarity and user skill progression.",
text: "Hyperborea rewards connect to scoring, with bonuses based on gameplay and skill progression.",
icon: Sparkles,
},
] as const;
Expand All @@ -48,21 +47,18 @@ export default function CryptoProjectPage() {

<main className="max-w-7xl mx-auto px-4 sm:px-6 py-8 sm:py-10">
<section className="theme-panel p-6 sm:p-8 mb-8">
<span className="theme-kicker mb-3">Chain Project Hub</span>
<span className="theme-kicker mb-3">Platform Hub</span>
<h1 className="theme-title text-3xl sm:text-4xl font-bold mb-4">
Crypto Project Roadmap
Product Roadmap
</h1>
<p className="theme-subtitle mb-6">
Clear updates on wallet onboarding, token access, and premium utility planning tied to the broader platform.
Clear updates on service offerings, platform access, and premium utility planning tied to the broader platform.
</p>
<div className="flex flex-wrap items-center gap-3">
<div className="min-h-10">
<WalletButton />
</div>
<TrackedCtaLink
href="/game"
conversionId="open_game"
surface="crypto_project:hero"
surface="project:hero"
className="theme-cta theme-cta--secondary px-5 py-3"
>
Open Hyperborea
Expand All @@ -71,30 +67,15 @@ export default function CryptoProjectPage() {
<TrackedCtaLink
href="/pricing"
conversionId="open_pricing"
surface="crypto_project:hero"
surface="project:hero"
className="theme-cta theme-cta--loud px-5 py-3"
>
Mint Upgrade Plans
View Upgrade Plans
</TrackedCtaLink>
</div>

<div className="mt-5 rounded-xl border border-cyan-500/20 bg-cyan-600/10 px-4 py-3 text-xs text-cyan-100/90">
<p className="font-semibold">Quick glossary</p>
<ul className="mt-2 space-y-1">
<li>
<span className="font-semibold">Mint:</span> Create your token access pass.
</li>
<li>
<span className="font-semibold">Connect Wallet:</span> Securely link your crypto account.
</li>
<li>
<span className="font-semibold">Utility:</span> The practical benefits tied to your token/pass.
</li>
</ul>
</div>
</section>

<ActionRail surface="crypto_project" className="mb-8" />
<ActionRail surface="project" className="mb-8" />

<section className="grid gap-4 md:grid-cols-2 lg:grid-cols-4 mb-8">
{features.map(({ title, text, icon: Icon }) => (
Expand All @@ -111,17 +92,17 @@ export default function CryptoProjectPage() {
Project Notes
</h2>
<ul className="space-y-3 text-sm sm:text-base text-[#c4d2e9] mb-5">
<li>Wallet features remain optional and are introduced only when relevant.</li>
<li>Token access is designed to support service value, not add friction.</li>
<li>We track conversion from game activity, mint actions, and bookings.</li>
<li>All features are designed to support service value and reduce friction for visitors.</li>
<li>Premium access is built around subscriptions, not token gating.</li>
<li>We track conversion from game activity, bookings, and service inquiries.</li>
</ul>

<details className="rounded-xl border border-white/10 bg-white/[0.02] p-4">
<summary className="cursor-pointer text-sm font-semibold text-white">Advanced implementation notes</summary>
<ul className="mt-3 space-y-2 text-xs sm:text-sm text-[#c4d2e9]">
<li>Keep mint APIs behind secure environment variables and server-side validation.</li>
<li>Route wallet-connected users into relevant service and subscription offers when features are live.</li>
<li>Apply analytics across game sessions, mint actions, and booking submissions for optimization.</li>
<li>Keep service APIs behind secure environment variables and server-side validation.</li>
<li>Route users into relevant service and subscription offers based on their interests.</li>
<li>Apply analytics across game sessions, booking submissions, and service inquiries for optimization.</li>
</ul>
</details>
</section>
Expand Down
Loading
Loading