TR Mock Anchor the SEP path

The SEP path: one portable integration, testnet to mainnet.

This is the main way to use this anchor. The SEP path is the standard Stellar way to move between Turkish Lira and USDC. You integrate it once, against this testnet mock, and the same code works against any real SEP anchor later — you only change the network and the home domain.

The entire handoff is two values: a home domain (tr-mock-anchor.fly.dev) and an asset (USDC). Everything else — where to log in, where to deposit and withdraw, the asset issuer, the signing key — is discovered automatically from the home domain's stellar.toml. A wallet or dApp needs nothing more.

What "SEP" is (and is not)

A SEP is a Stellar Ecosystem Proposal — a shared standard. The SEP path is a normal, programmatic HTTP API, exactly like a custom API. The difference is that its shape is defined by the standard, so it is the same on every anchor. That is what makes an integration portable.

SEPRoleEndpoint here
SEP-1Discovery: the stellar.toml "signboard"/.well-known/stellar.toml
SEP-10Login by signing a challenge with the user's key (no password)/auth
SEP-6Programmatic deposit & withdraw/sep6/*
SEP-12KYC (here: simulated, auto-approved, no personal data)/sep12/*
SEP-38Quotes (USD/TRY rate)/sep38/*

Why the SEP path is the main story: portability

An integration built against the SEP path moves to a real anchor by changing two things: the network (testnet → public) and the home domain. Nothing else. Whatever a builder does on testnet here, their users do on mainnet later.

Config values (copy these)

Home domain:        tr-mock-anchor.fly.dev
Asset code:         USDC
Asset issuer:       GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5
Network:            Stellar testnet
Network passphrase: Test SDF Network ; September 2015
SEP endpoints (discovered from stellar.toml):
  WEB_AUTH_ENDPOINT   https://tr-mock-anchor.fly.dev/auth
  TRANSFER_SERVER     https://tr-mock-anchor.fly.dev/sep6
  KYC_SERVER          https://tr-mock-anchor.fly.dev/sep12
  ANCHOR_QUOTE_SERVER https://tr-mock-anchor.fly.dev/sep38
  SIGNING_KEY         GDXYO6FJCNXZEWGXD54GT76FGFYLOLSOGSOJLNQ6WGHCGEQPO7NTE73M
Limits:  none (testnet sandbox) · fee 0.5% spread · USD/TRY from the live rate

The flow, end to end

All of this is what a wallet or dApp does. You can watch it run live at /explorer (the SEP demo), or drive it from demo-wallet.stellar.org by entering the home domain above. The raw calls:

  1. SEP-1 — discover. Read the signboard; learn every endpoint.
    curl https://tr-mock-anchor.fly.dev/.well-known/stellar.toml
  2. SEP-10 — log in. Get a challenge, sign it with the user's Stellar key, post it back for a JWT. No email, no password; the key is the identity.
    # 1) get a challenge transaction (XDR)
    curl "https://tr-mock-anchor.fly.dev/auth?account=G...USER_PUBLIC_KEY"
    # 2) sign the returned `transaction` with the user's key, then:
    curl -X POST https://tr-mock-anchor.fly.dev/auth \
      -H "content-type: application/json" \
      -d '{"transaction":"<signed challenge XDR>"}'
    # -> { "token": "<JWT>" }   use it as:  Authorization: Bearer <JWT>
  3. SEP-6 — capabilities. Ask what the anchor supports.
    curl https://tr-mock-anchor.fly.dev/sep6/info
  4. SEP-6 — deposit (TRY → USDC). Returns an order id and bank instructions (IBAN + reference).
    curl -H "Authorization: Bearer <JWT>" \
      "https://tr-mock-anchor.fly.dev/sep6/deposit?asset_code=USDC&account=G...USER&amount=200&funding_method=bank_account"
  5. Play the bank (sandbox only). The mock has no real bank, so you trigger the incoming TRY yourself. In production the real bank transfer does this.
    curl -X POST "https://tr-mock-anchor.fly.dev/sep6/tx/<ID>/simulate-bank-transfer" \
      -H "content-type: application/json" -d '{"amount":"200.00"}'
  6. Poll to completion. The anchor pays real testnet USDC; the status walks to completed.
    curl -H "Authorization: Bearer <JWT>" \
      "https://tr-mock-anchor.fly.dev/sep6/transaction?id=<ID>"
  7. SEP-6 — withdraw (USDC → TRY). Returns the treasury address + a memo. Send USDC there with that memo; the anchor pays TRY (simulated FAST).
    curl -H "Authorization: Bearer <JWT>" \
      "https://tr-mock-anchor.fly.dev/sep6/withdraw?asset_code=USDC&type=bank_account&amount=4.08"

SEP-38 quotes (/sep38/*) lock a rate; SEP-12 KYC (/sep12/*) is auto-approved and asks for no personal data. Deposit-exchange / withdraw-exchange endpoints use SEP-38 identifiers: on-chain asset code in destination_asset/source_asset, and iso4217:TRY for the off-chain leg.

How to build with it

You are building…Do this
A wallet, DEX, or dApp with connected walletsUse @stellar/typescript-wallet-sdk (SEP-6/10/38 built in) and @creit.tech/stellar-wallets-kit (connect + sign). Point them at the home domain above.
Just testing the anchorOpen demo-wallet.stellar.org, enter home domain tr-mock-anchor.fly.dev, add USDC, run a SEP-6 deposit. Or use /explorer here.

Requirements & caveats

Going to mainnet

The SEP path is designed to carry over. What changes: the network passphrase (public), the home domain (the real anchor's), and the legs that were simulated become real (bank transfer, KYC, live assets). The endpoint shapes and your integration code do not change. One dependency: the target mainnet anchor must implement SEP-6/24. Full detail: /mainnet.