Skip to content

feat(wallet): show non-fungible tokens in the Tokens tab #502

Description

@MastaP

Problem

The Tokens tab renders coin-shaped rows only, so an NFT will not appear even once the backend and SDK support it.

  • src/sdk/hooks/payments/useTokens.ts re-enriches every token via TokenRegistry.getDefinition(t.coinId), falling back to the SDK's baked values when the coin is unknown. Correct for coins — but a non-fungible token has no coinId to look up, so it needs the type-keyed lookup the SDK issue adds.
  • src/components/wallet/L3/views/L3WalletView.tsx:404-409 renders the tokens list; rows are amount + decimals shaped.
  • SendModal.tsx consumes the same hook via sendableTokens — an NFT must be excluded from (or explicitly handled by) the amount-based send flow.

Scope

  • Render a non-fungible row: name/icon from the registry's assetKind: 'non-fungible' definition when known; token type + truncated token id when not. No amount, no decimals.
  • Exclude NFTs from sendableTokens until SDK transfer support exists.
  • Keep the empty state ("No individual tokens found.", L3WalletView.tsx:407) correct for a wallet that holds only NFTs.

Incidental finding (not part of this feature)

L3WalletView.tsx:166,187,212,406 and SendModal filter on t.coinId !== 'NAMETAG'. That is a fossil of the removed self-issued UnicityIdToken mint — nametags have been Nostr-binding-only since the 2.0.0 base-SDK bump, and a grep of sphere-sdk source confirms it never emits that coinId. Worth deleting while this code is open.

Blocked by

unicity-sphere/sphere-sdk#777, which is itself blocked by unicity-sphere/wallet-api#140.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    • Status
      In progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions