Skip to content

feat(trader): claim SuiNS subname usernames - #101

Merged
Gift-Stack merged 10 commits into
mainfrom
claude/dazzling-jemison-36a990
Jul 2, 2026
Merged

Gift-Stack merged 10 commits into
mainfrom
claude/dazzling-jemison-36a990

Conversation

@Gift-Stack

Copy link
Copy Markdown
Contributor

What

Lets a trader claim a username by minting a subname of the firm-owned SuiNS domain (<label>.ultraprop.sui) to their wallet as an NFT. They type a label, we check availability live against the SuiNS registry, and on claim the firm admin signs + pays to mint the subname and transfer it to the user. The minted name becomes their profile name across the app (header + leaderboard), replacing the generated handle (rabbit_mx). Users can re-claim a different label later; the prior NFT just stays in their wallet.

How it works

  • Availability — SuinsClient.getNameRecord("<label>.ultraprop.sui"); a notExists registry read means the name is free. Reads go through a JSON-RPC client (the gRPC client throws on missing dynamic fields).
  • Mint — SuinsTransaction.createSubName → setTargetAddress(user) → transfer the NFT to the user, signed by the firm admin key via the existing getGrpcClient().signAndExecuteTransaction path (so the firm pays gas; the user provides nothing on-chain). The NFT id is read back from the registry, never assumed.
  • Gated — UI/API only activate when NEXT_PUBLIC_SUINS_PARENT_NAME is set on a SuiNS-supported network (mainnet/testnet).

Changes

  • Deps: bump @mysten/sui → ^2.20.1 (suins peer floor); add @mysten/suins@^1.2.3.
  • DB: subname_nft_id column on accounts (migration 0002); setUsername / getUsername; leaderboard already serves display_name.
  • Server: lib/sui/suins.ts (validate / availability / mintUsernameSubname); POST /api/account/username (mint) + GET (read) + GET /availability.
  • Client: useUsername / useUsernameAvailability / useClaimUsername; reworked UsernameSetting (debounced availability, claimed-state card with NFT verify link, re-claim flow); profile overlay + gate.
  • Config: NEXT_PUBLIC_SUINS_PARENT_NAME + isUsernameClaimingEnabled().

Verification

  • pnpm typecheck, biome lint, and the 6 db tests pass.
  • Availability path verified end-to-end against real testnet (gifted.ultraprop.sui → available; short/invalid → validation). The UI states (idle, checking, available, claimed-with-NFT) were visually verified.

Deploy checklist

  • Run the DB migration with DATABASE_URL set: pnpm --filter @shared/db db:migrate
  • Set NEXT_PUBLIC_SUINS_PARENT_NAME=ultraprop.sui in the runtime env (Vercel + local .env.local)
  • Ensure the firm admin wallet (SUI_ADMIN_SECRET_KEY) owns ultraprop.sui and holds gas SUI

Notes

  • Minting requires the parent ultraprop.sui to be owned by the firm admin wallet (already registered on testnet). Until the env var is set the feature stays hidden and the API returns a clean "not available yet".

@vercel

vercel Bot commented Jun 30, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ultraprop Ready Ready Preview, Comment Jul 2, 2026 4:04pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
ultraprop-docs Skipped Skipped Jul 2, 2026 4:04pm
ultraprop-website Skipped Skipped Jul 2, 2026 4:04pm

@Gift-Stack
Gift-Stack force-pushed the claude/dazzling-jemison-36a990 branch from 6049427 to 1e39e2c Compare June 30, 2026 13:16
@vercel
vercel Bot temporarily deployed to Preview – ultraprop-docs June 30, 2026 13:16 Inactive
@vercel
vercel Bot temporarily deployed to Preview – ultraprop-website June 30, 2026 13:16 Inactive
@vercel
vercel Bot temporarily deployed to Preview – ultraprop-website July 1, 2026 13:44 Inactive
@vercel
vercel Bot temporarily deployed to Preview – ultraprop-docs July 1, 2026 13:44 Inactive
@vercel
vercel Bot temporarily deployed to Preview – ultraprop-docs July 2, 2026 14:30 Inactive
@vercel
vercel Bot temporarily deployed to Preview – ultraprop-website July 2, 2026 14:30 Inactive
@vercel
vercel Bot temporarily deployed to Preview – ultraprop-docs July 2, 2026 14:47 Inactive
@vercel
vercel Bot temporarily deployed to Preview – ultraprop-website July 2, 2026 14:47 Inactive
@vercel
vercel Bot temporarily deployed to Preview – ultraprop-website July 2, 2026 15:12 Inactive
@vercel
vercel Bot temporarily deployed to Preview – ultraprop-docs July 2, 2026 15:12 Inactive
@vercel
vercel Bot temporarily deployed to Preview – ultraprop-docs July 2, 2026 15:49 Inactive
@vercel
vercel Bot temporarily deployed to Preview – ultraprop-website July 2, 2026 15:49 Inactive
@vercel
vercel Bot temporarily deployed to Preview – ultraprop-website July 2, 2026 16:02 Inactive
@vercel
vercel Bot temporarily deployed to Preview – ultraprop-docs July 2, 2026 16:02 Inactive
@Gift-Stack
Gift-Stack merged commit 5fbc1cd into main Jul 2, 2026
6 checks passed
@Gift-Stack
Gift-Stack deleted the claude/dazzling-jemison-36a990 branch July 2, 2026 16:06

This branch was successfully deployed

1 active and 2 inactive deployments
Preview – ultraprop — 4e26f611 Deployed Jul 2, 2026 by vercel[bot]
Preview – ultraprop-docs — 4e26f611 Deployed Jul 2, 2026 by vercel[bot]
Preview – ultraprop-website — 4e26f611 Deployed Jul 2, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant