Skip to content

feat(webapp): selectable multi-token support + custom RPC network detection#146

Merged
dev-jodee merged 2 commits into
mainfrom
feat/webapp-multi-token
Jun 1, 2026
Merged

feat(webapp): selectable multi-token support + custom RPC network detection#146
dev-jodee merged 2 commits into
mainfrom
feat/webapp-multi-token

Conversation

@dev-jodee
Copy link
Copy Markdown
Collaborator

Summary

  • Fix: custom RPC stored cluster id solana:custom, which ConnectorKit forwards to the wallet as the signing chain — wallets only sign for solana:mainnet|devnet|testnet, so enabling delegations failed with "Failed to sign transaction 1 of 1". Custom RPC now detects the network via getGenesisHash and overrides the matching real cluster's URL, keeping the wallet chain valid.
  • Feat: make the webapp genuinely multi-token (the program/SDK already are). Adds a persisted SelectedToken context + token picker scoping the delegations page, wallet overview, and dashboard summary.
  • Route all amount formatting/parsing through token decimals instead of a hardcoded 1e6; replace hardcoded "USDC" labels with token.symbol.
  • Payment-collection totals now break down per token instead of summing across mints.
  • Add tokens from the UI: paste a mint → decimals read on-chain, symbol/name user-supplied, stored per network in localStorage.

Test Plan

  • pnpm --filter webapp build (tsc -b + vite) — clean.
  • pnpm --filter webapp test — 19/19 pass (incl. token-display + delegation-filters).
  • Manual: custom RPC (mainnet) → Enable Delegations now prompts the wallet instead of failing to sign.
  • Manual: add a 2nd token via the picker "+" → picker appears, amounts/symbols/decimals follow the selection; selection survives refresh.

Notes

  • Faucet stays USDC-mock (devnet mint-authority tool) by design.
  • create-plan-dialog still uses the raw design-system Select for its token field (same base-ui closed-trigger label quirk) — not changed here.

dev-jodee added 2 commits June 1, 2026 17:35
Custom RPC stored cluster id `solana:custom`, which ConnectorKit passes
straight to the wallet as the signing chain. Wallets only sign for
`solana:mainnet|devnet|testnet`, so signing failed with "Failed to sign
transaction 1 of 1".

Custom RPC now detects the network via getGenesisHash and overrides the
matching real cluster's URL, keeping the wallet chain valid. Drops the
`solana:custom` cluster and the `custom` Network entry.
The webapp was effectively USDC-locked: amounts divided by a hardcoded
1e6, "USDC" was hardcoded in labels, and delegation/account views pinned
the USDC mint, despite the program and SDK being mint-agnostic.

- Add a SelectedToken context (persisted to localStorage) + token picker,
  scoping the delegations page, wallet overview, and dashboard summary to
  the chosen token.
- Route all amount formatting/parsing through token decimals instead of a
  fixed 1e6 multiplier; replace hardcoded "USDC" labels with token.symbol.
- Show per-token breakdowns in the payment collection totals instead of
  summing across mints.
- Add tokens from the UI: paste a mint, decimals are read on-chain, symbol
  and name are user-supplied; stored per network in localStorage.
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 1, 2026

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

Project Deployment Actions Updated (UTC)
solana-subscriptions-program Ready Ready Preview, Comment Jun 1, 2026 9:36pm

Request Review

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 1, 2026

Compute Unit Report

Instruction Samples Min CUs Max CUs Avg CUs Est Cost (Low) [SOL] Est Cost (Med) [SOL] Est Cost (High) [SOL]
cancel_subscription 22 1720 2030 1919 0.000005000 0.000005076 0.000005959
close_subscription_authority 10 1803 1833 1806 0.000005000 0.000005072 0.000005903
create_fixed_delegation 41 3520 14022 6033 0.000005001 0.000005241 0.000008016
create_plan 97 3436 12449 4908 0.000005001 0.000005196 0.000007454
create_recurring_delegation 29 3555 11050 5263 0.000005001 0.000005210 0.000007631
delete_plan 9 359 359 359 0.000005000 0.000005014 0.000005179
init_subscription_authority 173 6226 19726 9412 0.000005002 0.000005376 0.000009706
resume_subscription 3 1723 1723 1723 0.000005000 0.000005068 0.000005861
revoke_delegation 19 255 519 353 0.000005000 0.000005014 0.000005176
subscribe 32 6485 12485 7616 0.000005002 0.000005304 0.000008808
transfer_fixed 9 5476 9979 7031 0.000005002 0.000005281 0.000008515
transfer_recurring 19 5591 14452 6750 0.000005002 0.000005270 0.000008375
transfer_subscription 10 5838 8838 7043 0.000005002 0.000005281 0.000008521
update_plan 22 424 503 477 0.000005000 0.000005019 0.000005238

Generated: 2026-06-01

@dev-jodee dev-jodee merged commit ca7d530 into main Jun 1, 2026
13 checks passed
@dev-jodee dev-jodee deleted the feat/webapp-multi-token branch June 1, 2026 21:47
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