Skip to content

feat: NS transfer button + address detection#7

Open
arbuthnot-eth wants to merge 10 commits into
masterfrom
feat/ns-transfer
Open

feat: NS transfer button + address detection#7
arbuthnot-eth wants to merge 10 commits into
masterfrom
feat/ns-transfer

Conversation

@arbuthnot-eth

Copy link
Copy Markdown
Owner

Summary

  • Detect full 66-char Sui hex addresses in NS input, switch to SEND mode
  • Green transfer button (➤) on owned name target row — opens inline recipient input, transfers SuinsRegistration NFT
  • Close balance section when roster opens
  • Move NFT popover inline into roster with fixed-size placeholders
  • Hide registration price for taken names, show SEND without expanding balance
  • Only clear NS input from input focus or clear button, not roster toggle

Test plan

  • Type a full 66-char Sui address in NS input → .sui hides, SEND activates
  • Type an owned name → green ➤ button appears on target row
  • Click ➤ → recipient input opens, type name or address, Enter to transfer
  • Escape cancels transfer input
  • Taken names (e.g. "cash") show no price, SEND button visible
  • Opening roster collapses balance section
  • NFT card shows inline in roster, not as floating popover

When a user types a complete 0x + 64 hex char address into the NS name
input, the UI now switches to SEND mode: hides .sui suffix, hides price
chip, shows SEND button. Reverse-resolves via lookupSuiNS to replace hex
with the SuiNS name if one exists. Partial hex (< 66 chars) is ignored
to avoid false positives while typing.
…pient input

Adds nsTransferInputOpen/nsTransferRecipient state variables. When an
owned name is displayed in the target row, a green ➤ button appears at
the right end. Clicking it transforms the row into a recipient input
(name.sui or 0x…) with submit/cancel buttons. CSS matches the existing
green target row palette.
Adds event delegation in the route area for:
- Transfer button click → opens recipient input, auto-focuses
- Transfer cancel → closes input, resets state
- Transfer input → tracks nsTransferRecipient on input
- Enter → triggers submit, Escape → cancels
Adds buildTransferNftTx() to suins.ts — looks up the SuinsRegistration
NFT by domain name, validates it's not in a kiosk, builds a
transferObjects PTB to the recipient address.

Adds transfer-submit click handler in ui.ts — resolves recipient (SuiNS
name or hex address), calls buildTransferNftTx, executes transaction,
cleans up state and refreshes owned domains. Resets transfer state in
all clear/disconnect/cancel paths.
….78.0

When the SKI roster (owned names list) opens, the balance/coins section
now automatically collapses to avoid crowding. Refactored 4 duplicate
roster-toggle blocks into a shared _toggleRoster() helper.

Also bumps wrangler from ^4.77.0 to ^4.78.0 (global + local).
Replaces the position:fixed floating popover with an inline card slot
below the roster grid. The card uses a horizontal layout (QR left, info
right) with min-height: 88px so it doesn't cause layout shift. Expiry
shows a dash placeholder when unavailable. Removes all positioning math
and the document.body-appended element.
…ding balance

Price chip ($75, $100 etc) was showing for taken names that aren't
available for registration. Now hidden when name is taken and not owned
or listed.

SEND button now appears even when the balance/coins section is collapsed,
as long as the target is someone else's address. Previously required
coinChipsOpen to be true.
… toggle

Closing the roster no longer clears the name input. The name stays
visible so the user doesn't lose context when toggling the roster.
Only clicking inside the input box or the X clear button resets it.
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