Skip to content

Add a MoneyGram SEP-24 cash in and out prototype - #6329

Open
j0ntz wants to merge 6 commits into
developfrom
jon/moneygram-sep24-ramp
Open

j0ntz wants to merge 6 commits into
developfrom
jon/moneygram-sep24-ramp

Conversation

@j0ntz

@j0ntz j0ntz commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

Requirements

none

Description

Asana task

Prototype MoneyGram cash in and cash out as a ramp plugin over SEP-10 and SEP-24, driven against testanchor.stellar.org on Stellar testnet. No credentials: SEP-10 is signed with the wallet key and client_domain is skipped for now.

  • Anchor client (SEP-1, SEP-10, SEP-24): reads the anchor's stellar.toml, logs in by asking the Stellar engine to validate and sign the challenge, and calls /info, the interactive endpoints and /transaction. The JWT is cached per wallet and anchor and refreshed once on a 401.
  • Ramp plugin: buy and sell quotes for XLM and listed tokens, with limits from /info. Approving a quote starts the interactive flow and opens the anchor's page.
    • Deposit: a token deposit first opens the USDC trustline after the user agrees to the XLM fee. The poller follows the transfer to completed and tags the incoming transaction as a MoneyGram buy.
    • Withdraw: when the anchor reports pending_user_transfer_start, a locked send scene opens with the anchor's account, amount_in and memo. The sent transaction is tagged as a sell.
    • Status: each transfer is saved in the plugin store and resumed at login, including a completed deposit whose payout has not been tagged yet. error, expired and refunded are shown to the user.
    • Tokens are matched by code and issuer against the anchor's [[CURRENCIES]]. A look-alike token from another issuer gets no quote.
    • Anchor URLs: the transfer server and auth endpoint must be https on the toml's home domain or a subdomain. Interactive and more_info_url pages must be https on the anchor's site or a listed anchor UI host (ANCHOR_UI_HOSTS, which holds anchor-ref-ui-testanchor.stellar.org).
    • Withdraw safety: the send scene locks address, amount and memo (new lockTilesMap.memo flag in SendScene2), a payment already tagged with the order id is reused instead of paid twice, and withdraws take turns at the send prompt one at a time per account. Back or Not now leaves the order open and the next pass asks again.
    • Watches stop when the account logs out, and the quote reports zero crypto and fiat amounts so ranking treats it as unpriced, like the other external ramps.
  • Stellar testnet: the stellartestnet plugin is enabled with a default wallet name and the mainnet reserve warnings.
  • waitForWalletOtherMethods fix: bridged proxies expose methods as non-enumerable properties. Object.keys was always empty and the wait ran to its 10 minute timeout. It now probes own property names.
  • The first commit is a lint auto-fix: the commit hook's eslint pass marked Services.tsx with the NavigationBase migration note. It has no behavior change.

Tested on the iOS simulator with friendbot funds: an XLM deposit, an XLM withdraw and a USDC deposit (with trustline setup) each reached completed and were tagged in the wallet's history. On the final heads the withdraw and the USDC deposit were driven again. Frame 30 is the locked send scene: the anchor's account, 5 XLM and memo id 607720223292254453, with no edit control on the address or memo. Frame 31 is Transaction Success, and the anchor then reported the withdrawal completed. Frames 33 to 35 are the USDC deposit form, the anchor's completed page with the payout transaction, and the new history row tagged "Buy USD Coin". Logout checks, send turns and the zero-amount quote are covered by unit tests only. Unit tests also cover the anchor client, URL checks, quote limits, token matching, the transfer store and the watch loop.

Known prototype gaps: the quote shows no fiat amount (MoneyGram prices on its own page), and the trustline prompt does not mention the 0.5 XLM reserve the trustline locks.


Note

Medium Risk
New fiat on/off-ramp path touches SEP-10 auth, anchored WebViews, and programmatic sends with locked address/amount/memo; mistakes could mis-route funds, though the prototype targets testnet and validates anchor URLs/domains.

Overview
Adds a MoneyGram fiat ramp over Stellar SEP-10/SEP-24 (testnet anchor): quotes for native XLM and anchor-listed tokens, interactive WebView flow, persisted transfers, and background polling that drives deposits (including USDC trustline approval), locked withdraw sends, and buy/sell tagging in wallet history. Login resume restarts open transfers via Services and logs purchase events.

Also enables stellartestnet wallet support, adds SendScene2 memo locking for ramp payout memos, and fixes waitForWalletOtherMethods so bridged engine methods are detected immediately (changelog notes this also stops FIO refreshes from sitting on the old 10-minute wait). Large Jest coverage for anchor parsing, auth, URL checks, limits, and transfer lifecycle.

Reviewed by Cursor Bugbot for commit 63b4882. Bugbot is set up for automated code reviews on this repo. Configure here.

Test evidence

63b4882
Add USDC to MoneyGram with trustline setup
2026-11-07
🪓 called showOutcome for a completed sell at resume to show the cash out complete toast, which the Transaction Success modal hides

1. resume error

2. buy quote

3. deposit form

4. deposit done

5. deposit tagged

6. history fixed

7. recv fixed

8. sell quote

9. withdraw form

12. withdraw tagged

13. usdc quote

14. usdc activate

18. 🪓 withdraw complete

19. send later

28. round3 resume account

29. round3 resume send

30. memo locked

31. final sent

33. final usdc deposit form

34. final usdc anchor completed

35. final usdc buy tagged

j0ntz added 3 commits November 6, 2026 02:31
Services is a service-level component that passes navigation to many
children, so it keeps NavigationBase until the v7 migration.
Bridged proxies define their methods as non-enumerable properties, so
Object.keys(wallet.otherMethods) is always empty on the GUI side and
waitForWalletOtherMethods waited out its full 10 minute timeout even
when the engine methods were there. Probe the own property names for
functions instead.
Load edge-currency-accountbased's stellartestnet plugin and give it a
default wallet name and the same reserve warnings as mainnet Stellar,
so testnet anchors such as testanchor.stellar.org can be exercised from
the app.

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread src/plugins/ramps/moneygram/sep10.ts Resolved
Comment thread src/plugins/ramps/moneygram/sep10.ts Resolved
@j0ntz
j0ntz force-pushed the jon/moneygram-sep24-ramp branch from 42b8d19 to cfb1305 Compare November 7, 2026 00:33

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

@j0ntz
j0ntz force-pushed the jon/moneygram-sep24-ramp branch from cfb1305 to 44eabe8 Compare November 7, 2026 00:42

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread src/plugins/ramps/moneygram/sep24Api.ts Resolved
@j0ntz
j0ntz force-pushed the jon/moneygram-sep24-ramp branch from 44eabe8 to 458df8a Compare November 7, 2026 01:05

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread src/plugins/ramps/moneygram/sep24Api.ts Resolved
Read an anchor's stellar.toml, log in with SEP-10 by having the Stellar
engine validate and sign the challenge with the wallet key, and call
the SEP-24 info, interactive and transaction endpoints. The JWT is
cached per wallet and anchor and refreshed once when the anchor answers
401. client_domain is not sent yet.
@j0ntz
j0ntz force-pushed the jon/moneygram-sep24-ramp branch from 458df8a to 7ad2ef3 Compare November 7, 2026 01:33

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

@j0ntz
j0ntz force-pushed the jon/moneygram-sep24-ramp branch from 7ad2ef3 to 5148c1b Compare November 7, 2026 01:52

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

@j0ntz
j0ntz force-pushed the jon/moneygram-sep24-ramp branch from 5148c1b to 7d9a6b9 Compare November 7, 2026 02:13

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

@j0ntz
j0ntz force-pushed the jon/moneygram-sep24-ramp branch from 7d9a6b9 to 8e36abe Compare November 7, 2026 02:33

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 8e36abe. Configure here.

j0ntz added 2 commits November 6, 2026 18:45
Offer MoneyGram buy and sell quotes for native XLM when the anchor's
network matches the wallet, with limits from SEP-24 /info. Approving a
quote starts the interactive deposit or withdraw, saves the transfer
in the plugin store and opens the anchor's page. A poller follows the
transfer: a withdraw waiting for funds opens a locked send scene with
the anchor's address, amount and memo, and a completed deposit tags
the incoming transaction as a MoneyGram buy. Unfinished transfers are
resumed at login, and error, expired and refunded statuses are shown.
Read the [[CURRENCIES]] tables from the anchor's stellar.toml and offer
a Stellar token only when its code and issuer match a listed currency,
so a look-alike token from another issuer gets no quote. Before a token
deposit, open the wallet's trustline through the engine's activation
quote after the user agrees to the XLM fee, since the anchor cannot pay
a token into an account that does not trust it.
@j0ntz
j0ntz force-pushed the jon/moneygram-sep24-ramp branch from 8e36abe to 63b4882 Compare November 7, 2026 02: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