Skip to content

Swap - Xgram Support#441

Merged
j0ntz merged 2 commits intomasterfrom
jon/xgram
Mar 11, 2026
Merged

Swap - Xgram Support#441
j0ntz merged 2 commits intomasterfrom
jon/xgram

Conversation

@j0ntz
Copy link
Contributor

@j0ntz j0ntz commented Feb 26, 2026

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

none

Description

Context

Asana: "exch: Swap - Xgram Support" (P1). This branch reapplies the plugin work from #405 so the exchange engine can serve the Xgram team with the new swap flow and mappings.

Changes

Original PR
  • Register the xgram plugin in src/index.ts, include its synchronizer in scripts/allSynchronizers.ts, and add the mapping source plus generated file so EdgeCurrencyPluginIds map to Xgram network codes.
  • Implement src/swap/central/xgram.ts to compose the Xgram API calls, assemble swap estimates, handle memos/mapping metadata, and feed the swap engine usable EdgeSpendInfo.
Additional changes
  • Improve Xgram error handling by parsing ccyAmount limit strings, producing the correct SwapBelowLimitError/SwapAboveLimitError, and recognizing literal error responses via the new asXgramStringError.

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

None

Requirements

If you have made any visual changes to the GUI. Make sure you have:

  • Tested on iOS device
  • Tested on Android device
  • Tested on small-screen device (iPod Touch)
  • Tested on large-screen device (tablet)

Note

Medium Risk
Adds a new external swap provider with new API integration and error/limit handling, which could affect quoting and spend construction if mappings or response parsing are wrong.

Overview
Adds Xgram as a new centralized swap provider, including a new xgram swap plugin wired into src/index.ts and a corresponding mapctl synchronizer registered in scripts/allSynchronizers.ts.

Introduces hand-maintained currency/network mappings (scripts/mappings/xgramMappings.ts) with a generated runtime mapping (src/mappings/xgram.ts), plus a new XGRAM_API_KEY config entry. The Xgram plugin implements quote/order creation against Xgram’s API, builds EdgeSpendInfo (including memo/tag handling), and improves error translation for region restrictions, unsupported currencies, and min/max limits (including parsing string ccyAmount limit errors).

Written by Cursor Bugbot for commit fca8baa. This will update automatically on new commits. Configure here.

Loading
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.

2 participants