Skip to content

fix(swap): block veDelegate from being swapped — v2.10.0#625

Merged
Agilulfo1820 merged 2 commits into
mainfrom
fix/swap
May 20, 2026
Merged

fix(swap): block veDelegate from being swapped — v2.10.0#625
Agilulfo1820 merged 2 commits into
mainfrom
fix/swap

Conversation

@Agilulfo1820

@Agilulfo1820 Agilulfo1820 commented May 20, 2026

Copy link
Copy Markdown
Member

Summary

  • veDelegate is no longer selectable as either side of a swap (excluded from the from/to token lists).
  • The "Swap" action on the veDelegate token detail screen is now disabled.
  • Bump kit to 2.10.0.

veDelegate remains transferable via the Send flow — only swapping is blocked.

Test plan

  • Open the account modal → Swap → "From" picker: veDelegate is hidden
  • Open the account modal → Swap → "To" picker: veDelegate is hidden
  • Open the veDelegate token detail: the Swap action button is disabled
  • VOT3 still excluded from swap (regression check)
  • Send flow still lists veDelegate (regression check)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Expanded token swap restrictions to prevent swapping of additional tokens, ensuring consistent exclusion across all swap flows.
  • Chores

    • Version bumped to 2.10.0

Review Change Stack

Agilulfo1820 and others added 2 commits May 20, 2026 12:55
Disable swap on the veDelegate token detail and exclude veDelegate from
both sides of the swap token-selection list. veDelegate remains
transferable elsewhere.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented May 20, 2026

Copy link
Copy Markdown

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This PR extends swap token exclusions by introducing a centralized SWAP_EXCLUDED_TOKEN_SYMBOLS list that combines non-transferable tokens with veDelegate, applies it to token initialization and UI filtering in the swap flow, and reinforces the restriction by disabling the swap action button for non-swappable tokens in token detail views.

Changes

veDelegate Swap Exclusion Hardening

Layer / File(s) Summary
Version bump
packages/vechain-kit/package.json
Package version incremented from 2.9.0 to 2.10.0.
Swap token exclusion centralization
packages/vechain-kit/src/components/AccountModal/Contents/Swap/SwapTokenContent.tsx
SWAP_EXCLUDED_TOKEN_SYMBOLS constant defined by combining NON_TRANSFERABLE_TOKEN_SYMBOLS with veDelegate. The exclusion list is then applied to the fromToken and toToken initialization conditionals to gate token prefill from provided addresses, and wired into both "select-from-token" and "select-to-token" SelectTokenContent flows via excludedTokenSymbols prop.
Token detail swap button disable
packages/vechain-kit/src/components/AccountModal/Contents/TokenDetail/TokenDetailContent.tsx
Introduced isNonSwappable computed flag derived from isNonTransferable combined with a token.symbol === 'veDelegate' check. The "Swap" action button isDisabled prop now uses isNonSwappable instead of only isNonTransferable.

Sequence Diagram(s)

No sequence diagrams generated for this PR. The changes are focused on exclusion filtering logic and button state management, which do not involve multi-component request/response flows or complex control-flow sequences warranting visualization.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~4 minutes

Possibly related PRs

  • vechain/vechain-kit#587: Adds NON_TRANSFERABLE_TOKEN_SYMBOLS-based filtering to SwapTokenContent token prefill logic; this PR extends that pattern by creating a combined exclusion list that also includes veDelegate.
  • vechain/vechain-kit#612: Introduces similar "disable swap for restricted tokens" logic in the broader token detail and asset flow refactor; this PR refines that pattern by centralizing veDelegate exclusion across both swap initialization and UI filtering.

Poem

🐰 A hop through token swaps today,

Where veDelegate stays far away,

With SWAP_EXCLUDED_TOKEN_SYMBOLS clear,

Swap buttons disabled, no swapping here! ✨

Version 2.10 hops along the way! 🚀

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix(swap): block veDelegate from being swapped — v2.10.0' accurately summarizes the main change: preventing veDelegate token from being used in swap operations while bumping the version.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/swap

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Agilulfo1820 Agilulfo1820 merged commit 4e7f983 into main May 20, 2026
8 of 9 checks passed
@Agilulfo1820 Agilulfo1820 deleted the fix/swap branch May 20, 2026 10:58
@github-actions

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

Size Change: 0 B

Total Size: 8.84 MB

ℹ️ View Unchanged
Filename Size
packages/vechain-kit/dist/assets 4.1 kB
packages/vechain-kit/dist/assets-C0RHiZ9a.mjs 51.4 kB
packages/vechain-kit/dist/assets-C0RHiZ9a.mjs.map 74.6 kB
packages/vechain-kit/dist/assets-CZs6EVH8.cjs 58.9 kB
packages/vechain-kit/dist/assets-CZs6EVH8.cjs.map 76.1 kB
packages/vechain-kit/dist/assets/index.cjs 716 B
packages/vechain-kit/dist/assets/index.d.cts 973 B
packages/vechain-kit/dist/assets/index.d.mts 973 B
packages/vechain-kit/dist/assets/index.mjs 718 B
packages/vechain-kit/dist/index-_BVsv12E.d.cts 5.63 kB
packages/vechain-kit/dist/index-_BVsv12E.d.cts.map 2.99 kB
packages/vechain-kit/dist/index-BYfc-9J5.d.mts 5.63 kB
packages/vechain-kit/dist/index-BYfc-9J5.d.mts.map 2.99 kB
packages/vechain-kit/dist/index-Cgipk2NO.d.cts 185 kB
packages/vechain-kit/dist/index-Cgipk2NO.d.cts.map 50.3 kB
packages/vechain-kit/dist/index-DnhWq-hP.d.mts 185 kB
packages/vechain-kit/dist/index-DnhWq-hP.d.mts.map 49.2 kB
packages/vechain-kit/dist/index.cjs 1.14 MB
packages/vechain-kit/dist/index.cjs.map 2.83 MB
packages/vechain-kit/dist/index.d.cts 24.5 kB
packages/vechain-kit/dist/index.d.mts 24.5 kB
packages/vechain-kit/dist/index.mjs 1.1 MB
packages/vechain-kit/dist/index.mjs.map 2.77 MB
packages/vechain-kit/dist/utils 4.1 kB
packages/vechain-kit/dist/utils-C4gc1L9t.cjs 27.4 kB
packages/vechain-kit/dist/utils-C4gc1L9t.cjs.map 68.2 kB
packages/vechain-kit/dist/utils-DPIscp9_.mjs 22.2 kB
packages/vechain-kit/dist/utils-DPIscp9_.mjs.map 67.5 kB
packages/vechain-kit/dist/utils/index.cjs 2.02 kB
packages/vechain-kit/dist/utils/index.d.cts 3.1 kB
packages/vechain-kit/dist/utils/index.d.mts 3.1 kB
packages/vechain-kit/dist/utils/index.mjs 2.04 kB

compressed-size-action

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