Repository navigation
feat(trader): claim SuiNS subname usernames - #101
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
Gift-Stack
force-pushed
the
claude/dazzling-jemison-36a990
branch
from
June 30, 2026 12:53
64e6381 to
6049427
Compare
Gift-Stack
force-pushed
the
claude/dazzling-jemison-36a990
branch
from
June 30, 2026 13:16
6049427 to
1e39e2c
Compare
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
SuinsClient.getNameRecord("<label>.ultraprop.sui"); anotExistsregistry read means the name is free. Reads go through a JSON-RPC client (the gRPC client throws on missing dynamic fields).SuinsTransaction.createSubName→setTargetAddress(user)→ transfer the NFT to the user, signed by the firm admin key via the existinggetGrpcClient().signAndExecuteTransactionpath (so the firm pays gas; the user provides nothing on-chain). The NFT id is read back from the registry, never assumed.NEXT_PUBLIC_SUINS_PARENT_NAMEis set on a SuiNS-supported network (mainnet/testnet).Changes
@mysten/sui→^2.20.1(suins peer floor); add@mysten/suins@^1.2.3.subname_nft_idcolumn onaccounts(migration0002);setUsername/getUsername; leaderboard already servesdisplay_name.lib/sui/suins.ts(validate / availability /mintUsernameSubname);POST /api/account/username(mint) +GET(read) +GET /availability.useUsername/useUsernameAvailability/useClaimUsername; reworkedUsernameSetting(debounced availability, claimed-state card with NFT verify link, re-claim flow); profile overlay + gate.NEXT_PUBLIC_SUINS_PARENT_NAME+isUsernameClaimingEnabled().Verification
pnpm typecheck, biome lint, and the 6 db tests pass.gifted.ultraprop.sui→ available; short/invalid → validation). The UI states (idle, checking, available, claimed-with-NFT) were visually verified.Deploy checklist
DATABASE_URLset:pnpm --filter @shared/db db:migrateNEXT_PUBLIC_SUINS_PARENT_NAME=ultraprop.suiin the runtime env (Vercel + local.env.local)SUI_ADMIN_SECRET_KEY) ownsultraprop.suiand holds gas SUINotes
ultraprop.suito 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".