Skip to content

Disable TON network in Changelly and SideShift swap allowlists#89

Merged
andycreed0x merged 5 commits into
developfrom
disable-ton-network
May 28, 2026
Merged

Disable TON network in Changelly and SideShift swap allowlists#89
andycreed0x merged 5 commits into
developfrom
disable-ton-network

Conversation

@andycreed0x

Copy link
Copy Markdown
Collaborator

Purpose

Remove TON from the curated swap allowlists in both Changelly and SideShift integrations. New TON swap orders are rejected at the tool/CLI/MCP layer; existing TON swaps already on disk remain pollable via `*_status` until they reach a terminal state.

Description

Soft-disable approach: TON is removed from the source-of-truth data structures (`EXTERNAL_USDT_IDS`, `NETWORK_TO_USDT_ID`, `_ADDRESS_PATTERNS`, `ALLOWED_PAIRS`). The existing `CHANGELLY_ALLOW_ALL_PAIRS=1` / `SIDESHIFT_ALLOW_ALL_NETWORKS=1` env-var overrides remain the escape hatch for debugging or power users.

Main Changes

  • ♻️ Remove `"usdton"` from `EXTERNAL_USDT_IDS`, `NETWORK_TO_USDT_ID`, and `_ADDRESS_PATTERNS` in `changelly.py`
  • ♻️ Remove `("usdt", "ton")` from `ALLOWED_PAIRS` in `sideshift.py`
  • ♻️ Remove `"ton"` from `click.Choice` in `cli/changelly.py` and docstrings in `cli/sideshift.py`
  • ♻️ Remove `"ton"` from the three `external_network` MCP enums in `server.py` (changelly_quote / changelly_send / changelly_receive)
  • 📝 Update all prose references ("6 chains" → "5", "7 chains" → "6", TON removed from memo-network examples) across `server.py`, `tools.py`, `cli/`
  • ✅ `tests/test_changelly.py`: `ALLOWED_PAIRS` size 12 → 10, drop TON parametrize rows, add `"usdton"` to the filter-drain assertion
  • ✅ `tests/test_sideshift.py`: drop `("usdt","ton")` from allowlist parametrize; add `assert "ton" not in` for both filtered networks and tokenDetails (raw fixture keeps TON to validate the filter)
  • 📝 Fix two stale numeric comments missed in first pass (`changelly.py` docstring "6 variants" → "5", `test_sideshift.py` class docstring "7 chains" → "6")

⚠️ Breaking Changes

  • Calling `changelly_send`, `changelly_receive`, or `changelly_quote` with `external_network="ton"` now raises `ValueError` / CLI `UsageError`.
  • `network_to_asset_id("ton")` raises `ValueError`.
  • SideShift send/receive with `deposit_network="ton"` or `settle_network="ton"` raises `ValueError`.
  • In-flight TON swaps already on disk are not affected — `changelly_status` / `sideshift_status` do not re-validate the allowlist.

Checklist

  • Added/updated tests (if necessary)
  • Added/updated relevant documentation (if necessary)

@andycreed0x andycreed0x marked this pull request as ready for review May 28, 2026 16:20
@andycreed0x andycreed0x requested a review from marinate305 May 28, 2026 16:20
@andycreed0x andycreed0x merged commit cf3d01d into develop May 28, 2026
4 checks passed
@andycreed0x andycreed0x deleted the disable-ton-network branch May 28, 2026 18:04
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