Skip to content

Bug: stream/[id]/page.tsx passes a truncated token contract address instead of the token symbol to StreamActions/WithdrawButton #318

Description

@Jaydbrown

app/stream/[id]/page.tsx (around line 234) renders:

<StreamActions
  ...
  token={truncateAddress(info.token)}
  ...
/>

info.token is the SEP-41 token contract address (e.g. CDLZFC3S...CYSC), not a symbol like XLM/USDC. truncateAddress() just shortens it to CDLZ…CYSC — it doesn't resolve it to a symbol via lib/tokens.ts's tokenByAddress().

That truncated address string is then threaded straight through to components/stream/StreamActions.tsx, which passes it to components/stream/WithdrawButton.tsx as token and also displays it directly:

  • WithdrawButton.tsx: Withdraw {amount} {token} renders as e.g. "Withdraw 42.50 CDLZ…CYSC" instead of "Withdraw 42.50 XLM".
  • StreamActions.tsx's top-up modal: "Add more {token} to extend the stream's lifetime..." and the input label "Amount ({token})" both show the truncated contract address instead of a symbol.

This is confusing/broken for end users, who have no way to know which token they're withdrawing or topping up without manually resolving the contract address themselves. Fix: resolve info.token to a symbol via tokenByAddress(info.token, network)?.symbol (falling back to the truncated address only if the token isn't in the known list) before passing it down as token.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions