[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6GWRMP0KM1K25Z8WP2M3K0V":3,"skill-same:01M6GWRMP0KM1K25Z8WP2M3K0V":85},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":16,"sourceHtmlUrl":17,"categories":18,"keywords":19,"publishedAt":43,"linkOnly":44,"markdownContent":45,"markdownBody":46,"frontMatter":47,"refName":48,"commitSha":49,"skillDirectory":50,"forksCount":51,"repositoryHtmlUrl":52,"repositoryHomepageUrl":6,"ownerHtmlUrl":53,"ownerBlogUrl":54,"ownerDescription":55,"updatedAt":56,"install":57,"resources":70},"01M6GWRMP0KM1K25Z8WP2M3K0V","ghostswap-partners-api",null,"Integrate the GhostSwap Partners API to add no-KYC crypto swaps (1,600+ coins, 0–4% partner fee on top of the swap, USDT payouts) into wallets, dApps, exchanges, payment flows, or affiliate sites. Use whenever a developer asks to \"add crypto swap\", \"embed a swap widget\", \"let users exchange tokens\", \"convert crypto to crypto\", \"earn commission on referred swaps\", or wants a server-side REST integration that handles quote → create → status-poll without holding signing keys. Covers Bearer auth, live float and fixed-rate quotes, idempotent swap creation, status lifecycle polling, address validation, error envelope handling, rate limits, and the partner application + payout flow at partners.ghostswap.io.","jiayaoqijia\u002Fcryptoskill","jiayaoqijia","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1453879?v=4","01M6GMYTX7Q7S504VC6E756ENR","YQ","01M6GMYV1QKJ1CC75MTTGT9PR0",81,"MIT","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fghostswap1-ghostswap-partners-api\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fghostswap1-ghostswap-partners-api\u002FSKILL.md",[],[20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42],"partners","ghostswap partners api","api","creation","limits","rate","idempotent","float","at","top","quotes","flows","error","io","auth","swaps","usdt","integrate","kyc","flow","server","create","status","2026-11-10 10:12:30",false,"---\nname: ghostswap-partners-api\ndescription: Integrate the GhostSwap Partners API to add no-KYC crypto swaps (1,600+ coins, 0–4% partner fee on top of the swap, USDT payouts) into wallets, dApps, exchanges, payment flows, or affiliate sites. Use whenever a developer asks to \"add crypto swap\", \"embed a swap widget\", \"let users exchange tokens\", \"convert crypto to crypto\", \"earn commission on referred swaps\", or wants a server-side REST integration that handles quote → create → status-poll without holding signing keys. Covers Bearer auth, live float and fixed-rate quotes, idempotent swap creation, status lifecycle polling, address validation, error envelope handling, rate limits, and the partner application + payout flow at partners.ghostswap.io.\nlicense: MIT\n---\n\n# GhostSwap Partners API integration\n\nYou are helping a developer integrate the **GhostSwap Partners API** — a server-to-server REST API for non-custodial crypto-to-crypto swaps. The developer's end-users send funds to a deposit address GhostSwap returns; the destination wallet receives the swapped funds. GhostSwap handles all upstream liquidity, signing, and clearing. The partner earns a 0–4 % markup (chosen at application time) on every completed swap, paid out in USDT once balance ≥ $100.\n\nThis skill is the single document you need to produce a working end-to-end integration. Read it once, then write code.\n\n---\n\n## When to use this skill\n\nTrigger when the developer's request involves any of:\n\n- Adding a crypto exchange widget, swap form, or \"convert X to Y\" flow to their app\n- Accepting one crypto and crediting the user in a different one\n- Quoting live exchange rates for a pair (e.g. BTC → ETH)\n- Earning affiliate commission on referred swaps (the `?ref=\u003Cslug>` flow on ghostswap.io)\n- Building a Telegram bot, Discord bot, or wallet plugin that does crypto-to-crypto\n- Specifically mentions \"GhostSwap\", \"ghostswap.io\", \"partners.ghostswap.io\", `gspk_live_*`, or `gssk_live_*`\n\nDo **not** trigger for fiat on\u002Foff-ramps, custodial trading APIs, or self-custodial DEX SDKs — those are different products.\n\n---\n\n## Architecture, in one sentence\n\n> Your server holds the bearer token; your server proxies every call to `https:\u002F\u002Fpartners-api.ghostswap.io`; your browser code talks only to your server.\n\nThe bearer **must never reach the browser**. Browser code calls `\u002Fapi\u002Fquote`, `\u002Fapi\u002Fswap`, etc. on the developer's own server; the server adds `Authorization: Bearer ${PUBLIC_KEY}:${SECRET}` and forwards to GhostSwap.\n\n---\n\n## Step 0 — Get a credential (one-time, by the developer)\n\nThe developer (not the agent) must do this once:\n\n1. Sign in at \u003Chttps:\u002F\u002Fpartners.ghostswap.io\u002Fsign-up>.\n2. Submit the application form (org name, website, expected monthly volume, chosen partner fee 0–4 %).\n3. Wait for admin approval (~24 h). Once status flips to `active`, an activation email lands in their inbox.\n4. Open **\u002Fdashboard\u002Fapi-credentials** → click **Create live credential** → copy both values:\n   - `GHOSTSWAP_PUBLIC_KEY` — looks like `gspk_live_\u003C32 hex>`, always recoverable from the dashboard.\n   - `GHOSTSWAP_SECRET` — looks like `gssk_live_\u003C48 hex>`, shown once at creation; can be revealed later via the audit-logged **Reveal secret** button.\n5. Set both as environment variables on the developer's server. **Never paste them into code that ships to the browser.**\n\nIf the developer says \"I haven't applied yet\", direct them to that URL and pause the integration work — no API call works without a credential.\n\n---\n\n## The standard workflow (memorize this)\n\n```\n1. GET  \u002Fv1\u002Fcurrencies              → populate dropdowns\n2. POST \u002Fv1\u002Faddresses\u002Fvalidate      → on blur, check the user's payout address\n3. POST \u002Fv1\u002Fquotes                  → live quote on every amount\u002Fpair change\n4. POST \u002Fv1\u002Fswaps                   → on confirm; MUST include Idempotency-Key\n5. GET  \u002Fv1\u002Fswaps\u002F{id}              → poll every 10 s while UI visible, 30 s when backgrounded\n6. Stop polling on terminal status  → finished | failed | refunded | overdue | expired\n```\n\nThat's the entire flow. Every well-built integration is some variant of these six steps.\n\n---\n\n## Authentication\n\nEvery `\u002Fv1\u002F*` request needs exactly two headers:\n\n```\nAuthorization: Bearer ${GHOSTSWAP_PUBLIC_KEY}:${GHOSTSWAP_SECRET}\nContent-Type: application\u002Fjson\n```\n\nThe colon between public key and secret is part of the bearer string — there is no separate signing step. The server argon2id-verifies the secret against a hashed copy; partners never sign anything themselves.\n\n```js\nconst AUTH = `Bearer ${process.env.GHOSTSWAP_PUBLIC_KEY}:${process.env.GHOSTSWAP_SECRET}`;\n```\n\n---\n\n## Endpoint cheat sheet\n\nBase URL: `https:\u002F\u002Fpartners-api.ghostswap.io`\n\n| Method | Path | Purpose | Notes |\n|---|---|---|---|\n| GET | `\u002Fv1\u002Fcurrencies` | List enabled coins | `?lite=true` returns just tickers |\n| GET | `\u002Fv1\u002Fpairs?from=btc&to=eth` | Min\u002Fmax for a pair | Use `minAmountFloat`\u002F`maxAmountFloat` for float, `…Fixed` for fixed-rate |\n| POST | `\u002Fv1\u002Faddresses\u002Fvalidate` | Check a wallet address | `{ \"currency\": \"eth\", \"address\": \"0x…\" }` |\n| POST | `\u002Fv1\u002Fquotes` | Get a live quote | `{ from, to, amountFrom }`. Add `mode: \"fixed\"` for a locked rate |\n| POST | `\u002Fv1\u002Fswaps` | Create a swap | **Requires `Idempotency-Key` header.** Returns `payinAddress` + `id`. Pass `extraId` for memo\u002Ftag coins |\n| GET | `\u002Fv1\u002Fswaps\u002F{id}` | Get current status | Source of truth — poll this |\n| GET | `\u002Fv1\u002Fswaps?limit=50&offset=0` | Paginated list | Scoped to the org, most-recent first |\n| GET | `\u002Fv1\u002Fpublic\u002Fquote?from=btc&to=xmr&amount=0.05` | Public display quote | **No API key.** 60 req\u002Fmin\u002FIP, CORS-open — for price widgets & comparison sites, not for executing swaps |\n| GET | `\u002Fhealth` | Liveness probe | Unmetered; safe at any frequency |\n\n---\n\n## Display rules (these are the user-visible parts)\n\nQuote response shape:\n\n```json\n{\n  \"quote\": {\n    \"from\": \"btc\", \"to\": \"eth\",\n    \"amountFrom\": \"0.01\",\n    \"amountTo\": \"0.1532\",\n    \"networkFee\": \"0.0021\",\n    \"amountUserReceives\": \"0.1511\",\n    \"rate\": \"15.32\",\n    \"fee\": \"0.001\",\n    \"min\": \"0.0008\", \"max\": \"5.0\",\n    \"mode\": \"float\"\n  }\n}\n```\n\n**Show `amountUserReceives` to the user, not `amountTo`.** The subtraction (`amountTo - networkFee`) is already done. Also display `rate`, `min`, and `max`. Re-render on every change of `from`, `to`, or `amountFrom` — debounce ~400 ms so the user can type freely.\n\nSwap response shape:\n\n```json\n{\n  \"swap\": {\n    \"id\": \"htpi6bqnazl7hbjd\",\n    \"status\": \"waiting\",\n    \"from\": \"btc\", \"to\": \"eth\",\n    \"amountFrom\": \"0.01\",\n    \"amountExpectedFrom\": \"0.01\",\n    \"amountExpectedTo\": \"0.1532\",\n    \"amountActualFrom\": null,\n    \"amountActualTo\": null,\n    \"actualNetworkFee\": null,\n    \"payinAddress\": \"bc1q…\",\n    \"payoutAddress\": \"0x…\",\n    \"refundAddress\": \"bc1q…\",\n    \"payinHash\": null,\n    \"payoutHash\": null,\n    \"moneyReceivedAt\": null,\n    \"moneySentAt\": null,\n    \"amountAnomalyPct\": null,\n    \"createdAt\": \"2026-04-29T12:00:00Z\"\n  }\n}\n```\n\n**Display `payinAddress` prominently** — that's the deposit address the user should send `amountFrom` of `from` to. Render as a copyable string; a QR code is nice-to-have (use `qrcode` from npm). After the swap progresses, `amountActualFrom` is the actual on-chain amount received; use it for completed-state displays and accounting, especially if the user overpaid or underpaid.\n\nThe `id` is the canonical swap identifier in your records, GhostSwap's records, and the upstream provider's records. Use it for every follow-up call and store it on your order row.\n\n---\n\n## Idempotency — non-negotiable rule\n\n`POST \u002Fv1\u002Fswaps` **requires** an `Idempotency-Key` header. Generate a UUID v4 **once per logical \"Confirm\" click** and reuse it across HTTP retries of THAT click. Do **not** generate a fresh UUID on retry — that creates a duplicate swap.\n\n```js\nimport { randomUUID } from 'node:crypto';\n\n\u002F\u002F On the client: one UUID per Confirm button press; reset after success.\nlet confirmKey = null;\nfunction onConfirmClick() {\n  if (!confirmKey) confirmKey = crypto.randomUUID(); \u002F\u002F browser-side\n  \u002F\u002F POST to your server with confirmKey in the body\n}\n\n\u002F\u002F On the server: forward the key as a header to GhostSwap.\nawait fetch(`${BASE}\u002Fv1\u002Fswaps`, {\n  method: 'POST',\n  headers: {\n    'Authorization': AUTH,\n    'Content-Type': 'application\u002Fjson',\n    'Idempotency-Key': req.body.idempotencyKey,\n  },\n  body: JSON.stringify(swapBody),\n});\n```\n\nIf the developer's code regenerates the UUID on every fetch, fix it. That single bug has produced duplicate swaps for real partners.\n\n---\n\n## Polling cadence\n\nPoll `GET \u002Fv1\u002Fswaps\u002F{id}` after creation:\n\n| UI state | Interval |\n|---|---|\n| Browser tab visible, status non-terminal | **10 seconds** |\n| Browser tab backgrounded or server-side worker | **30 seconds** |\n| Status `hold` (AML\u002FKYC review) | **5 minutes** — direct user to support@ghostswap.io |\n| Status terminal | **Stop polling** |\n\nTerminal statuses: `finished`, `failed`, `refunded`, `overdue`, `expired`.\n\nGhostSwap refreshes upstream status every ~30 s, so polling faster than 10 s wastes the rate budget without giving the user fresher data. Polling slower than 60 s feels laggy while the user is watching the page.\n\n---\n\n## Float vs fixed-rate swaps\n\n| | Float (default) | Fixed |\n|---|---|---|\n| Rate determined | At swap-finish time (whatever the market gives) | Locked at quote time |\n| Body field | omit `mode` | `mode: \"fixed\"` + `rateId` from quote |\n| `refundAddress` | optional but recommended | **required** |\n| Time pressure on user | minutes (`waiting` window) | seconds (~60 s `payTill` window) |\n| Best for | Most integrations | Receipts\u002Finvoices that need a guaranteed output |\n\nDefault to float unless the product specifically needs a locked rate. The fixed flow adds two failure modes: stale `rateId` (HTTP 409 `rate_expired` → re-quote with a **new `Idempotency-Key`**) and `expired` status (the user missed the `payTill` deadline).\n\n---\n\n## Error envelope\n\nEvery non-2xx body has this shape:\n\n```json\n{\n  \"error\": {\n    \"type\": \"validation_error\",\n    \"code\": \"amount_below_min\",\n    \"message\": \"Minimum amountFrom is 0.0008\",\n    \"param\": \"amountFrom\"\n  }\n}\n```\n\nSurface `error.message` to the end-user (and `error.param` when present). Recovery by `type`:\n\n| `type` | HTTP | What to do |\n|---|---|---|\n| `validation_error` | 400 | Show the message; user can fix |\n| `authentication_error` | 401 | Bad bearer — check env vars on the server |\n| `authorization_error` | 403 | Org not yet `active` — wait for admin approval |\n| `not_found` | 404 | Wrong id, or id belongs to another org |\n| `conflict` | 409 | `Idempotency-Key` reused with a different body, or fixed `rateId` expired — re-quote and retry with a **new** key |\n| `unprocessable` (code `exchange_not_processable`) | 422 | We can't route this specific swap. **Do not retry.** Surface `message` verbatim |\n| `rate_limit_error` | 429 | Read `Retry-After` (seconds), sleep, retry. If retrying `POST \u002Fv1\u002Fswaps`, reuse the same key |\n| `upstream_error` | 502 \u002F 503 | Transient. Backoff and retry once. On `POST \u002Fv1\u002Fswaps`, first call `GET \u002Fv1\u002Fswaps?limit=20` to check whether the swap was created before retrying |\n\nEvery response includes an `X-Request-Id` header. Log it. Forward it to support when escalating.\n\n---\n\n## Rate limits\n\n- **Per credential: 30 RPS** — every `gspk_live_*` gets its own bucket.\n- **Per source IP: 120 RPS** (pre-auth) — generous for partners on shared egress.\n- Standard `RateLimit-Limit` \u002F `RateLimit-Remaining` \u002F `RateLimit-Reset` headers on every response. Self-throttle from `RateLimit-Remaining` before hitting 429.\n- `\u002Fhealth` is unmetered.\n\n---\n\n## Minimal working example (Node.js + Express)\n\nThis is a complete server-side proxy you can deliver to the developer as a starting point. ~120 lines, no build step, no frameworks beyond Express.\n\n```js\n\u002F\u002F server.js\nimport 'dotenv\u002Fconfig';\nimport express from 'express';\nimport { randomUUID } from 'node:crypto';\n\nconst { GHOSTSWAP_PUBLIC_KEY, GHOSTSWAP_SECRET, PORT = 3000 } = process.env;\nif (!GHOSTSWAP_PUBLIC_KEY || !GHOSTSWAP_SECRET) {\n  console.error('Set GHOSTSWAP_PUBLIC_KEY and GHOSTSWAP_SECRET in your env.');\n  process.exit(1);\n}\n\nconst BASE = 'https:\u002F\u002Fpartners-api.ghostswap.io';\nconst AUTH = `Bearer ${GHOSTSWAP_PUBLIC_KEY}:${GHOSTSWAP_SECRET}`;\n\nasync function gs(method, path, { body, idempotencyKey } = {}) {\n  const res = await fetch(`${BASE}${path}`, {\n    method,\n    headers: {\n      'Authorization': AUTH,\n      'Content-Type': 'application\u002Fjson',\n      ...(idempotencyKey ? { 'Idempotency-Key': idempotencyKey } : {}),\n    },\n    body: body ? JSON.stringify(body) : undefined,\n  });\n  const data = await res.json().catch(() => ({}));\n  if (!res.ok) {\n    const err = data?.error ?? { message: `HTTP ${res.status}` };\n    const e = new Error(err.message);\n    Object.assign(e, { status: res.status, ...err });\n    e.retryAfter = res.headers.get('Retry-After');\n    e.requestId = res.headers.get('X-Request-Id');\n    throw e;\n  }\n  return data;\n}\n\nconst app = express();\napp.use(express.json({ limit: '10kb' }));\n\n\u002F\u002F Browser-safe proxy routes. Bearer never leaves the server.\nconst route = (fn) => async (req, res) => {\n  try { res.json(await fn(req)); }\n  catch (e) {\n    if (e.retryAfter) res.setHeader('Retry-After', e.retryAfter);\n    res.status(e.status || 502).json({\n      error: { type: e.type, code: e.code, message: e.message, param: e.param },\n    });\n  }\n};\n\napp.get('\u002Fapi\u002Fcurrencies', route(() => gs('GET', '\u002Fv1\u002Fcurrencies')));\napp.post('\u002Fapi\u002Fquote', route((r) => gs('POST', '\u002Fv1\u002Fquotes', { body: r.body })));\napp.post('\u002Fapi\u002Fvalidate', route((r) => gs('POST', '\u002Fv1\u002Faddresses\u002Fvalidate', { body: r.body })));\napp.post('\u002Fapi\u002Fswap', route((r) => {\n  \u002F\u002F The browser MUST send its own idempotencyKey (one UUID per Confirm\n  \u002F\u002F click, reused on retries). Refuse silent server-side generation —\n  \u002F\u002F that hides client bugs and risks duplicate swaps.\n  const { idempotencyKey, ...body } = r.body;\n  if (!idempotencyKey) {\n    const e = new Error('idempotencyKey is required');\n    e.status = 400; e.code = 'missing_idempotency_key'; e.type = 'validation_error';\n    throw e;\n  }\n  return gs('POST', '\u002Fv1\u002Fswaps', { body, idempotencyKey });\n}));\napp.get('\u002Fapi\u002Fswap\u002F:id', route((r) => gs('GET', `\u002Fv1\u002Fswaps\u002F${encodeURIComponent(r.params.id)}`)));\n\napp.listen(PORT, () => console.log(`http:\u002F\u002Flocalhost:${PORT}`));\n```\n\nThe matching browser code reads `crypto.randomUUID()` on first Confirm click, stores it in a variable, sends it to `\u002Fapi\u002Fswap`, and resets it only after success. See the full reference implementation (HTML + browser JS, ~200 lines) in the [end-to-end guide](https:\u002F\u002Fpartners.ghostswap.io\u002Fdocs\u002Fguides\u002Fend-to-end-swap).\n\n---\n\n## Critical rules — never violate\n\n1. **Server-side only.** The bearer must never reach the browser. All browser → API calls go through the developer's own server.\n2. **Bearer format is `${PUBLIC_KEY}:${SECRET}` with a single colon.** Both values from env vars.\n3. **`Idempotency-Key` is required on `POST \u002Fv1\u002Fswaps`.** UUID v4, one per Confirm click, reused on retries.\n4. **Display `amountUserReceives`, not `amountTo`.** The network-fee subtraction is already done for you.\n5. **Refund address is optional on float, required on fixed.** Send `undefined` (or omit the key) when the user can't provide one — never send an empty string.\n6. **Stop polling on terminal status.** Don't keep hitting `\u002Fv1\u002Fswaps\u002F{id}` forever.\n7. **On 429, read `Retry-After` and sleep.** Don't hammer.\n8. **On `upstream_error` (5xx) after `POST \u002Fv1\u002Fswaps`, do not auto-retry.** First call `GET \u002Fv1\u002Fswaps?limit=20` and look for your `partnerReferenceId` — the swap may already exist.\n9. **Disable the Confirm button until a quote has loaded AND the payout address validated.** Eager-enabled buttons let users submit blindly.\n10. **Never put the secret in browser code, in git, or in client-side env files.** Server env vars or a secret manager only.\n11. **Collect a memo \u002F destination tag for tag coins.** When the `to` currency has `requiresExtraId: true` on `GET \u002Fv1\u002Fcurrencies` (XRP, XLM, ATOM, HBAR, TON and others), render an input labelled with its `extraIdName` and send it as `extraId`. Omitting it returns 400 `missing_extra_id` and no swap is created. Only if the user confirms their wallet genuinely has no tag, send `extraIdNotRequired: true`. Send `refundExtraId` alongside `refundAddress` when the `from` coin uses tags.\n\n---\n\n## Anti-patterns to refuse\n\nIf the developer asks for any of these, push back and explain why:\n\n- ❌ **\"Put the API key in the React app for simplicity\"** — leaks credentials in page source. The fix is a server proxy.\n- ❌ **\"Generate a new idempotency key on each retry\"** — creates duplicate swaps. Reuse the same UUID for the same logical click.\n- ❌ **\"Skip the quote panel; users just want to confirm\"** — biggest failure mode of bad integrations. Users have no idea how much they'll receive. Show `amountUserReceives` before Confirm enables.\n- ❌ **\"Poll every second so it feels real-time\"** — wastes the 30-RPS budget and gives no fresher data (upstream refresh is ~30 s). 10 s while visible is the right number.\n- ❌ **\"Skip the memo field — nobody uses tags\"** — payouts to an exchange deposit address on XRP, XLM, ATOM etc. can't be credited without the tag. Honour `requiresExtraId`.\n- ❌ **\"Catch errors silently\"** — always surface `error.message` and `error.param`. Silent failures lose users.\n- ❌ **\"Hard-code the base URL\"** — read `GHOSTSWAP_API_BASE` from env so staging can point elsewhere.\n\n---\n\n## Affiliate referral links (optional, no integration code)\n\nEvery approved partner also gets a referral link: `https:\u002F\u002Fghostswap.io\u002F?ref=\u003Ctheir-slug>`. End-users who click that URL get a 30-day cookie attribution; any swap they complete on ghostswap.io credits the partner 1 % of the volume. No code on the partner's end — they just share the URL. The partner claims their slug from the dashboard overview page.\n\nThe partner's API-integration earnings and referral earnings combine into one payable USDT balance, paid out once balance ≥ $100.\n\nIf the developer's primary use case is \"I just want a share link, not an integration\" — they don't need any of this skill's code. Direct them to \u003Chttps:\u002F\u002Fpartners.ghostswap.io\u002Fsign-up>, tell them to apply, and after approval the **Pick your referral code** card on \u002Fdashboard handles everything else. No more steps.\n\n---\n\n## Pre-flight checklist before declaring done\n\nBefore handing the integration back to the developer, walk through this:\n\n1. ☐ `GHOSTSWAP_PUBLIC_KEY` and `GHOSTSWAP_SECRET` are server-side env vars, **not** in browser code or git.\n2. ☐ All `\u002Fv1\u002F*` calls go through the developer's own server (not directly from browser).\n3. ☐ `Idempotency-Key` is a UUID generated **once per Confirm click**, reused on retries.\n4. ☐ The UI shows `amountUserReceives`, `rate`, `min`, `max` **before** the Confirm button is enabled.\n5. ☐ Confirm button is disabled until (a) a quote has loaded, (b) payout address validated, (c) refund address either empty or validated.\n6. ☐ Address validation runs on blur via `POST \u002Fv1\u002Faddresses\u002Fvalidate`, with visible ✓ or error.\n7. ☐ After Confirm, the deposit address (`payinAddress`) is prominently displayed.\n8. ☐ Polling runs at 10 s while visible \u002F 30 s when backgrounded \u002F 5 min on `hold` \u002F never when terminal.\n9. ☐ Error display surfaces `error.message` and `error.param` — never silent.\n10. ☐ `partnerReferenceId` is set to the developer's own order id so they can correlate swaps with their DB.\n\nIf any item fails, fix it before shipping. Partial integrations leak money.\n\n---\n\n## Reference docs (load these when you need depth)\n\n- Full integration brief (a complete one-prompt walkthrough): \u003Chttps:\u002F\u002Fpartners.ghostswap.io\u002Fllms-full.txt>\n- Quickstart: \u003Chttps:\u002F\u002Fpartners.ghostswap.io\u002Fdocs\u002Fquickstart>\n- End-to-end swap (the reference HTML+JS implementation, ~200 lines of UI code): \u003Chttps:\u002F\u002Fpartners.ghostswap.io\u002Fdocs\u002Fguides\u002Fend-to-end-swap>\n- Authentication: \u003Chttps:\u002F\u002Fpartners.ghostswap.io\u002Fdocs\u002Fauth>\n- Idempotency: \u003Chttps:\u002F\u002Fpartners.ghostswap.io\u002Fdocs\u002Fconcepts\u002Fidempotency>\n- Status lifecycle (all 10 states): \u003Chttps:\u002F\u002Fpartners.ghostswap.io\u002Fdocs\u002Fconcepts\u002Fstatus-lifecycle>\n- Errors: \u003Chttps:\u002F\u002Fpartners.ghostswap.io\u002Fdocs\u002Fconcepts\u002Ferrors>\n- Rate limits: \u003Chttps:\u002F\u002Fpartners.ghostswap.io\u002Fdocs\u002Fconcepts\u002Frate-limits>\n- Troubleshooting (real failure modes integrators have hit): \u003Chttps:\u002F\u002Fpartners.ghostswap.io\u002Fdocs\u002Fguides\u002Ftroubleshooting>\n- Security: \u003Chttps:\u002F\u002Fpartners.ghostswap.io\u002Fdocs\u002Fguides\u002Fsecurity>\n- Roadmap: \u003Chttps:\u002F\u002Fpartners.ghostswap.io\u002Fdocs\u002Froadmap>\n\n---\n\n## Support\n\n- Telegram: \u003Chttps:\u002F\u002Ft.me\u002Fghostswap1>\n- Email: \u003Csupport@ghostswap.io>\n- AML\u002FKYC review (user-facing): direct end-users to \u003Csupport@ghostswap.io> when status is `hold`\n\nAlways include the swap `id` and the `X-Request-Id` of the relevant response when escalating. Both make support's lookup hop trivial.\n","# GhostSwap Partners API integration\n\nYou are helping a developer integrate the **GhostSwap Partners API** — a server-to-server REST API for non-custodial crypto-to-crypto swaps. The developer's end-users send funds to a deposit address GhostSwap returns; the destination wallet receives the swapped funds. GhostSwap handles all upstream liquidity, signing, and clearing. The partner earns a 0–4 % markup (chosen at application time) on every completed swap, paid out in USDT once balance ≥ $100.\n\nThis skill is the single document you need to produce a working end-to-end integration. Read it once, then write code.\n\n---\n\n## When to use this skill\n\nTrigger when the developer's request involves any of:\n\n- Adding a crypto exchange widget, swap form, or \"convert X to Y\" flow to their app\n- Accepting one crypto and crediting the user in a different one\n- Quoting live exchange rates for a pair (e.g. BTC → ETH)\n- Earning affiliate commission on referred swaps (the `?ref=\u003Cslug>` flow on ghostswap.io)\n- Building a Telegram bot, Discord bot, or wallet plugin that does crypto-to-crypto\n- Specifically mentions \"GhostSwap\", \"ghostswap.io\", \"partners.ghostswap.io\", `gspk_live_*`, or `gssk_live_*`\n\nDo **not** trigger for fiat on\u002Foff-ramps, custodial trading APIs, or self-custodial DEX SDKs — those are different products.\n\n---\n\n## Architecture, in one sentence\n\n> Your server holds the bearer token; your server proxies every call to `https:\u002F\u002Fpartners-api.ghostswap.io`; your browser code talks only to your server.\n\nThe bearer **must never reach the browser**. Browser code calls `\u002Fapi\u002Fquote`, `\u002Fapi\u002Fswap`, etc. on the developer's own server; the server adds `Authorization: Bearer ${PUBLIC_KEY}:${SECRET}` and forwards to GhostSwap.\n\n---\n\n## Step 0 — Get a credential (one-time, by the developer)\n\nThe developer (not the agent) must do this once:\n\n1. Sign in at \u003Chttps:\u002F\u002Fpartners.ghostswap.io\u002Fsign-up>.\n2. Submit the application form (org name, website, expected monthly volume, chosen partner fee 0–4 %).\n3. Wait for admin approval (~24 h). Once status flips to `active`, an activation email lands in their inbox.\n4. Open **\u002Fdashboard\u002Fapi-credentials** → click **Create live credential** → copy both values:\n   - `GHOSTSWAP_PUBLIC_KEY` — looks like `gspk_live_\u003C32 hex>`, always recoverable from the dashboard.\n   - `GHOSTSWAP_SECRET` — looks like `gssk_live_\u003C48 hex>`, shown once at creation; can be revealed later via the audit-logged **Reveal secret** button.\n5. Set both as environment variables on the developer's server. **Never paste them into code that ships to the browser.**\n\nIf the developer says \"I haven't applied yet\", direct them to that URL and pause the integration work — no API call works without a credential.\n\n---\n\n## The standard workflow (memorize this)\n\n```\n1. GET  \u002Fv1\u002Fcurrencies              → populate dropdowns\n2. POST \u002Fv1\u002Faddresses\u002Fvalidate      → on blur, check the user's payout address\n3. POST \u002Fv1\u002Fquotes                  → live quote on every amount\u002Fpair change\n4. POST \u002Fv1\u002Fswaps                   → on confirm; MUST include Idempotency-Key\n5. GET  \u002Fv1\u002Fswaps\u002F{id}              → poll every 10 s while UI visible, 30 s when backgrounded\n6. Stop polling on terminal status  → finished | failed | refunded | overdue | expired\n```\n\nThat's the entire flow. Every well-built integration is some variant of these six steps.\n\n---\n\n## Authentication\n\nEvery `\u002Fv1\u002F*` request needs exactly two headers:\n\n```\nAuthorization: Bearer ${GHOSTSWAP_PUBLIC_KEY}:${GHOSTSWAP_SECRET}\nContent-Type: application\u002Fjson\n```\n\nThe colon between public key and secret is part of the bearer string — there is no separate signing step. The server argon2id-verifies the secret against a hashed copy; partners never sign anything themselves.\n\n```js\nconst AUTH = `Bearer ${process.env.GHOSTSWAP_PUBLIC_KEY}:${process.env.GHOSTSWAP_SECRET}`;\n```\n\n---\n\n## Endpoint cheat sheet\n\nBase URL: `https:\u002F\u002Fpartners-api.ghostswap.io`\n\n| Method | Path | Purpose | Notes |\n|---|---|---|---|\n| GET | `\u002Fv1\u002Fcurrencies` | List enabled coins | `?lite=true` returns just tickers |\n| GET | `\u002Fv1\u002Fpairs?from=btc&to=eth` | Min\u002Fmax for a pair | Use `minAmountFloat`\u002F`maxAmountFloat` for float, `…Fixed` for fixed-rate |\n| POST | `\u002Fv1\u002Faddresses\u002Fvalidate` | Check a wallet address | `{ \"currency\": \"eth\", \"address\": \"0x…\" }` |\n| POST | `\u002Fv1\u002Fquotes` | Get a live quote | `{ from, to, amountFrom }`. Add `mode: \"fixed\"` for a locked rate |\n| POST | `\u002Fv1\u002Fswaps` | Create a swap | **Requires `Idempotency-Key` header.** Returns `payinAddress` + `id`. Pass `extraId` for memo\u002Ftag coins |\n| GET | `\u002Fv1\u002Fswaps\u002F{id}` | Get current status | Source of truth — poll this |\n| GET | `\u002Fv1\u002Fswaps?limit=50&offset=0` | Paginated list | Scoped to the org, most-recent first |\n| GET | `\u002Fv1\u002Fpublic\u002Fquote?from=btc&to=xmr&amount=0.05` | Public display quote | **No API key.** 60 req\u002Fmin\u002FIP, CORS-open — for price widgets & comparison sites, not for executing swaps |\n| GET | `\u002Fhealth` | Liveness probe | Unmetered; safe at any frequency |\n\n---\n\n## Display rules (these are the user-visible parts)\n\nQuote response shape:\n\n```json\n{\n  \"quote\": {\n    \"from\": \"btc\", \"to\": \"eth\",\n    \"amountFrom\": \"0.01\",\n    \"amountTo\": \"0.1532\",\n    \"networkFee\": \"0.0021\",\n    \"amountUserReceives\": \"0.1511\",\n    \"rate\": \"15.32\",\n    \"fee\": \"0.001\",\n    \"min\": \"0.0008\", \"max\": \"5.0\",\n    \"mode\": \"float\"\n  }\n}\n```\n\n**Show `amountUserReceives` to the user, not `amountTo`.** The subtraction (`amountTo - networkFee`) is already done. Also display `rate`, `min`, and `max`. Re-render on every change of `from`, `to`, or `amountFrom` — debounce ~400 ms so the user can type freely.\n\nSwap response shape:\n\n```json\n{\n  \"swap\": {\n    \"id\": \"htpi6bqnazl7hbjd\",\n    \"status\": \"waiting\",\n    \"from\": \"btc\", \"to\": \"eth\",\n    \"amountFrom\": \"0.01\",\n    \"amountExpectedFrom\": \"0.01\",\n    \"amountExpectedTo\": \"0.1532\",\n    \"amountActualFrom\": null,\n    \"amountActualTo\": null,\n    \"actualNetworkFee\": null,\n    \"payinAddress\": \"bc1q…\",\n    \"payoutAddress\": \"0x…\",\n    \"refundAddress\": \"bc1q…\",\n    \"payinHash\": null,\n    \"payoutHash\": null,\n    \"moneyReceivedAt\": null,\n    \"moneySentAt\": null,\n    \"amountAnomalyPct\": null,\n    \"createdAt\": \"2026-04-29T12:00:00Z\"\n  }\n}\n```\n\n**Display `payinAddress` prominently** — that's the deposit address the user should send `amountFrom` of `from` to. Render as a copyable string; a QR code is nice-to-have (use `qrcode` from npm). After the swap progresses, `amountActualFrom` is the actual on-chain amount received; use it for completed-state displays and accounting, especially if the user overpaid or underpaid.\n\nThe `id` is the canonical swap identifier in your records, GhostSwap's records, and the upstream provider's records. Use it for every follow-up call and store it on your order row.\n\n---\n\n## Idempotency — non-negotiable rule\n\n`POST \u002Fv1\u002Fswaps` **requires** an `Idempotency-Key` header. Generate a UUID v4 **once per logical \"Confirm\" click** and reuse it across HTTP retries of THAT click. Do **not** generate a fresh UUID on retry — that creates a duplicate swap.\n\n```js\nimport { randomUUID } from 'node:crypto';\n\n\u002F\u002F On the client: one UUID per Confirm button press; reset after success.\nlet confirmKey = null;\nfunction onConfirmClick() {\n  if (!confirmKey) confirmKey = crypto.randomUUID(); \u002F\u002F browser-side\n  \u002F\u002F POST to your server with confirmKey in the body\n}\n\n\u002F\u002F On the server: forward the key as a header to GhostSwap.\nawait fetch(`${BASE}\u002Fv1\u002Fswaps`, {\n  method: 'POST',\n  headers: {\n    'Authorization': AUTH,\n    'Content-Type': 'application\u002Fjson',\n    'Idempotency-Key': req.body.idempotencyKey,\n  },\n  body: JSON.stringify(swapBody),\n});\n```\n\nIf the developer's code regenerates the UUID on every fetch, fix it. That single bug has produced duplicate swaps for real partners.\n\n---\n\n## Polling cadence\n\nPoll `GET \u002Fv1\u002Fswaps\u002F{id}` after creation:\n\n| UI state | Interval |\n|---|---|\n| Browser tab visible, status non-terminal | **10 seconds** |\n| Browser tab backgrounded or server-side worker | **30 seconds** |\n| Status `hold` (AML\u002FKYC review) | **5 minutes** — direct user to support@ghostswap.io |\n| Status terminal | **Stop polling** |\n\nTerminal statuses: `finished`, `failed`, `refunded`, `overdue`, `expired`.\n\nGhostSwap refreshes upstream status every ~30 s, so polling faster than 10 s wastes the rate budget without giving the user fresher data. Polling slower than 60 s feels laggy while the user is watching the page.\n\n---\n\n## Float vs fixed-rate swaps\n\n| | Float (default) | Fixed |\n|---|---|---|\n| Rate determined | At swap-finish time (whatever the market gives) | Locked at quote time |\n| Body field | omit `mode` | `mode: \"fixed\"` + `rateId` from quote |\n| `refundAddress` | optional but recommended | **required** |\n| Time pressure on user | minutes (`waiting` window) | seconds (~60 s `payTill` window) |\n| Best for | Most integrations | Receipts\u002Finvoices that need a guaranteed output |\n\nDefault to float unless the product specifically needs a locked rate. The fixed flow adds two failure modes: stale `rateId` (HTTP 409 `rate_expired` → re-quote with a **new `Idempotency-Key`**) and `expired` status (the user missed the `payTill` deadline).\n\n---\n\n## Error envelope\n\nEvery non-2xx body has this shape:\n\n```json\n{\n  \"error\": {\n    \"type\": \"validation_error\",\n    \"code\": \"amount_below_min\",\n    \"message\": \"Minimum amountFrom is 0.0008\",\n    \"param\": \"amountFrom\"\n  }\n}\n```\n\nSurface `error.message` to the end-user (and `error.param` when present). Recovery by `type`:\n\n| `type` | HTTP | What to do |\n|---|---|---|\n| `validation_error` | 400 | Show the message; user can fix |\n| `authentication_error` | 401 | Bad bearer — check env vars on the server |\n| `authorization_error` | 403 | Org not yet `active` — wait for admin approval |\n| `not_found` | 404 | Wrong id, or id belongs to another org |\n| `conflict` | 409 | `Idempotency-Key` reused with a different body, or fixed `rateId` expired — re-quote and retry with a **new** key |\n| `unprocessable` (code `exchange_not_processable`) | 422 | We can't route this specific swap. **Do not retry.** Surface `message` verbatim |\n| `rate_limit_error` | 429 | Read `Retry-After` (seconds), sleep, retry. If retrying `POST \u002Fv1\u002Fswaps`, reuse the same key |\n| `upstream_error` | 502 \u002F 503 | Transient. Backoff and retry once. On `POST \u002Fv1\u002Fswaps`, first call `GET \u002Fv1\u002Fswaps?limit=20` to check whether the swap was created before retrying |\n\nEvery response includes an `X-Request-Id` header. Log it. Forward it to support when escalating.\n\n---\n\n## Rate limits\n\n- **Per credential: 30 RPS** — every `gspk_live_*` gets its own bucket.\n- **Per source IP: 120 RPS** (pre-auth) — generous for partners on shared egress.\n- Standard `RateLimit-Limit` \u002F `RateLimit-Remaining` \u002F `RateLimit-Reset` headers on every response. Self-throttle from `RateLimit-Remaining` before hitting 429.\n- `\u002Fhealth` is unmetered.\n\n---\n\n## Minimal working example (Node.js + Express)\n\nThis is a complete server-side proxy you can deliver to the developer as a starting point. ~120 lines, no build step, no frameworks beyond Express.\n\n```js\n\u002F\u002F server.js\nimport 'dotenv\u002Fconfig';\nimport express from 'express';\nimport { randomUUID } from 'node:crypto';\n\nconst { GHOSTSWAP_PUBLIC_KEY, GHOSTSWAP_SECRET, PORT = 3000 } = process.env;\nif (!GHOSTSWAP_PUBLIC_KEY || !GHOSTSWAP_SECRET) {\n  console.error('Set GHOSTSWAP_PUBLIC_KEY and GHOSTSWAP_SECRET in your env.');\n  process.exit(1);\n}\n\nconst BASE = 'https:\u002F\u002Fpartners-api.ghostswap.io';\nconst AUTH = `Bearer ${GHOSTSWAP_PUBLIC_KEY}:${GHOSTSWAP_SECRET}`;\n\nasync function gs(method, path, { body, idempotencyKey } = {}) {\n  const res = await fetch(`${BASE}${path}`, {\n    method,\n    headers: {\n      'Authorization': AUTH,\n      'Content-Type': 'application\u002Fjson',\n      ...(idempotencyKey ? { 'Idempotency-Key': idempotencyKey } : {}),\n    },\n    body: body ? JSON.stringify(body) : undefined,\n  });\n  const data = await res.json().catch(() => ({}));\n  if (!res.ok) {\n    const err = data?.error ?? { message: `HTTP ${res.status}` };\n    const e = new Error(err.message);\n    Object.assign(e, { status: res.status, ...err });\n    e.retryAfter = res.headers.get('Retry-After');\n    e.requestId = res.headers.get('X-Request-Id');\n    throw e;\n  }\n  return data;\n}\n\nconst app = express();\napp.use(express.json({ limit: '10kb' }));\n\n\u002F\u002F Browser-safe proxy routes. Bearer never leaves the server.\nconst route = (fn) => async (req, res) => {\n  try { res.json(await fn(req)); }\n  catch (e) {\n    if (e.retryAfter) res.setHeader('Retry-After', e.retryAfter);\n    res.status(e.status || 502).json({\n      error: { type: e.type, code: e.code, message: e.message, param: e.param },\n    });\n  }\n};\n\napp.get('\u002Fapi\u002Fcurrencies', route(() => gs('GET', '\u002Fv1\u002Fcurrencies')));\napp.post('\u002Fapi\u002Fquote', route((r) => gs('POST', '\u002Fv1\u002Fquotes', { body: r.body })));\napp.post('\u002Fapi\u002Fvalidate', route((r) => gs('POST', '\u002Fv1\u002Faddresses\u002Fvalidate', { body: r.body })));\napp.post('\u002Fapi\u002Fswap', route((r) => {\n  \u002F\u002F The browser MUST send its own idempotencyKey (one UUID per Confirm\n  \u002F\u002F click, reused on retries). Refuse silent server-side generation —\n  \u002F\u002F that hides client bugs and risks duplicate swaps.\n  const { idempotencyKey, ...body } = r.body;\n  if (!idempotencyKey) {\n    const e = new Error('idempotencyKey is required');\n    e.status = 400; e.code = 'missing_idempotency_key'; e.type = 'validation_error';\n    throw e;\n  }\n  return gs('POST', '\u002Fv1\u002Fswaps', { body, idempotencyKey });\n}));\napp.get('\u002Fapi\u002Fswap\u002F:id', route((r) => gs('GET', `\u002Fv1\u002Fswaps\u002F${encodeURIComponent(r.params.id)}`)));\n\napp.listen(PORT, () => console.log(`http:\u002F\u002Flocalhost:${PORT}`));\n```\n\nThe matching browser code reads `crypto.randomUUID()` on first Confirm click, stores it in a variable, sends it to `\u002Fapi\u002Fswap`, and resets it only after success. See the full reference implementation (HTML + browser JS, ~200 lines) in the [end-to-end guide](https:\u002F\u002Fpartners.ghostswap.io\u002Fdocs\u002Fguides\u002Fend-to-end-swap).\n\n---\n\n## Critical rules — never violate\n\n1. **Server-side only.** The bearer must never reach the browser. All browser → API calls go through the developer's own server.\n2. **Bearer format is `${PUBLIC_KEY}:${SECRET}` with a single colon.** Both values from env vars.\n3. **`Idempotency-Key` is required on `POST \u002Fv1\u002Fswaps`.** UUID v4, one per Confirm click, reused on retries.\n4. **Display `amountUserReceives`, not `amountTo`.** The network-fee subtraction is already done for you.\n5. **Refund address is optional on float, required on fixed.** Send `undefined` (or omit the key) when the user can't provide one — never send an empty string.\n6. **Stop polling on terminal status.** Don't keep hitting `\u002Fv1\u002Fswaps\u002F{id}` forever.\n7. **On 429, read `Retry-After` and sleep.** Don't hammer.\n8. **On `upstream_error` (5xx) after `POST \u002Fv1\u002Fswaps`, do not auto-retry.** First call `GET \u002Fv1\u002Fswaps?limit=20` and look for your `partnerReferenceId` — the swap may already exist.\n9. **Disable the Confirm button until a quote has loaded AND the payout address validated.** Eager-enabled buttons let users submit blindly.\n10. **Never put the secret in browser code, in git, or in client-side env files.** Server env vars or a secret manager only.\n11. **Collect a memo \u002F destination tag for tag coins.** When the `to` currency has `requiresExtraId: true` on `GET \u002Fv1\u002Fcurrencies` (XRP, XLM, ATOM, HBAR, TON and others), render an input labelled with its `extraIdName` and send it as `extraId`. Omitting it returns 400 `missing_extra_id` and no swap is created. Only if the user confirms their wallet genuinely has no tag, send `extraIdNotRequired: true`. Send `refundExtraId` alongside `refundAddress` when the `from` coin uses tags.\n\n---\n\n## Anti-patterns to refuse\n\nIf the developer asks for any of these, push back and explain why:\n\n- ❌ **\"Put the API key in the React app for simplicity\"** — leaks credentials in page source. The fix is a server proxy.\n- ❌ **\"Generate a new idempotency key on each retry\"** — creates duplicate swaps. Reuse the same UUID for the same logical click.\n- ❌ **\"Skip the quote panel; users just want to confirm\"** — biggest failure mode of bad integrations. Users have no idea how much they'll receive. Show `amountUserReceives` before Confirm enables.\n- ❌ **\"Poll every second so it feels real-time\"** — wastes the 30-RPS budget and gives no fresher data (upstream refresh is ~30 s). 10 s while visible is the right number.\n- ❌ **\"Skip the memo field — nobody uses tags\"** — payouts to an exchange deposit address on XRP, XLM, ATOM etc. can't be credited without the tag. Honour `requiresExtraId`.\n- ❌ **\"Catch errors silently\"** — always surface `error.message` and `error.param`. Silent failures lose users.\n- ❌ **\"Hard-code the base URL\"** — read `GHOSTSWAP_API_BASE` from env so staging can point elsewhere.\n\n---\n\n## Affiliate referral links (optional, no integration code)\n\nEvery approved partner also gets a referral link: `https:\u002F\u002Fghostswap.io\u002F?ref=\u003Ctheir-slug>`. End-users who click that URL get a 30-day cookie attribution; any swap they complete on ghostswap.io credits the partner 1 % of the volume. No code on the partner's end — they just share the URL. The partner claims their slug from the dashboard overview page.\n\nThe partner's API-integration earnings and referral earnings combine into one payable USDT balance, paid out once balance ≥ $100.\n\nIf the developer's primary use case is \"I just want a share link, not an integration\" — they don't need any of this skill's code. Direct them to \u003Chttps:\u002F\u002Fpartners.ghostswap.io\u002Fsign-up>, tell them to apply, and after approval the **Pick your referral code** card on \u002Fdashboard handles everything else. No more steps.\n\n---\n\n## Pre-flight checklist before declaring done\n\nBefore handing the integration back to the developer, walk through this:\n\n1. ☐ `GHOSTSWAP_PUBLIC_KEY` and `GHOSTSWAP_SECRET` are server-side env vars, **not** in browser code or git.\n2. ☐ All `\u002Fv1\u002F*` calls go through the developer's own server (not directly from browser).\n3. ☐ `Idempotency-Key` is a UUID generated **once per Confirm click**, reused on retries.\n4. ☐ The UI shows `amountUserReceives`, `rate`, `min`, `max` **before** the Confirm button is enabled.\n5. ☐ Confirm button is disabled until (a) a quote has loaded, (b) payout address validated, (c) refund address either empty or validated.\n6. ☐ Address validation runs on blur via `POST \u002Fv1\u002Faddresses\u002Fvalidate`, with visible ✓ or error.\n7. ☐ After Confirm, the deposit address (`payinAddress`) is prominently displayed.\n8. ☐ Polling runs at 10 s while visible \u002F 30 s when backgrounded \u002F 5 min on `hold` \u002F never when terminal.\n9. ☐ Error display surfaces `error.message` and `error.param` — never silent.\n10. ☐ `partnerReferenceId` is set to the developer's own order id so they can correlate swaps with their DB.\n\nIf any item fails, fix it before shipping. Partial integrations leak money.\n\n---\n\n## Reference docs (load these when you need depth)\n\n- Full integration brief (a complete one-prompt walkthrough): \u003Chttps:\u002F\u002Fpartners.ghostswap.io\u002Fllms-full.txt>\n- Quickstart: \u003Chttps:\u002F\u002Fpartners.ghostswap.io\u002Fdocs\u002Fquickstart>\n- End-to-end swap (the reference HTML+JS implementation, ~200 lines of UI code): \u003Chttps:\u002F\u002Fpartners.ghostswap.io\u002Fdocs\u002Fguides\u002Fend-to-end-swap>\n- Authentication: \u003Chttps:\u002F\u002Fpartners.ghostswap.io\u002Fdocs\u002Fauth>\n- Idempotency: \u003Chttps:\u002F\u002Fpartners.ghostswap.io\u002Fdocs\u002Fconcepts\u002Fidempotency>\n- Status lifecycle (all 10 states): \u003Chttps:\u002F\u002Fpartners.ghostswap.io\u002Fdocs\u002Fconcepts\u002Fstatus-lifecycle>\n- Errors: \u003Chttps:\u002F\u002Fpartners.ghostswap.io\u002Fdocs\u002Fconcepts\u002Ferrors>\n- Rate limits: \u003Chttps:\u002F\u002Fpartners.ghostswap.io\u002Fdocs\u002Fconcepts\u002Frate-limits>\n- Troubleshooting (real failure modes integrators have hit): \u003Chttps:\u002F\u002Fpartners.ghostswap.io\u002Fdocs\u002Fguides\u002Ftroubleshooting>\n- Security: \u003Chttps:\u002F\u002Fpartners.ghostswap.io\u002Fdocs\u002Fguides\u002Fsecurity>\n- Roadmap: \u003Chttps:\u002F\u002Fpartners.ghostswap.io\u002Fdocs\u002Froadmap>\n\n---\n\n## Support\n\n- Telegram: \u003Chttps:\u002F\u002Ft.me\u002Fghostswap1>\n- Email: \u003Csupport@ghostswap.io>\n- AML\u002FKYC review (user-facing): direct end-users to \u003Csupport@ghostswap.io> when status is `hold`\n\nAlways include the swap `id` and the `X-Request-Id` of the relevant response when escalating. Both make support's lookup hop trivial.\n",{"name":5,"license":15,"description":7},"main","3df1d0d67b30ff15236561f8c0f9f06d33f42dfd","skills\u002Fmcp-servers\u002Fghostswap1-ghostswap-partners-api",17,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia","https:\u002F\u002Feth2030.com","Hardcore infra. Building @alt-research and applied cryptography.","2026-11-15 02:28:10",{"source":8,"skillName":5,"commands":58,"prompt":68,"zipAvailable":69},[59,62,65],{"tool":60,"command":61},"npx","npx skills add jiayaoqijia\u002Fcryptoskill --skill ghostswap-partners-api",{"tool":63,"command":64},"bunx","bunx skills add jiayaoqijia\u002Fcryptoskill --skill ghostswap-partners-api",{"tool":66,"command":67},"pnpm","pnpm dlx skills add jiayaoqijia\u002Fcryptoskill --skill ghostswap-partners-api","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fghostswap1-ghostswap-partners-api\u002FSKILL.md",true,[71,75,81],{"path":72,"resourceType":72,"resourceTypeDesc":73,"sizeBytes":74,"sourceHtmlUrl":16},"LICENSE","许可证",1066,{"path":76,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":79,"sourceHtmlUrl":80},"SOURCE.md","REFERENCE","参考文档",366,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fghostswap1-ghostswap-partners-api\u002FSOURCE.md",{"path":82,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":83,"sourceHtmlUrl":84},"TRUST.auto.yaml",2198,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fghostswap1-ghostswap-partners-api\u002FTRUST.auto.yaml",[86,95,103,111,119,127],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":90,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":94},"01M7DTKCERMV0RNX3HZJP4CZ26","troves","Deposit and withdraw from Troves DeFi yield vault strategies on Starknet. View available strategies, check positions, and manage vault deposits. Use this skill when the user mentions Troves, vault, yield vault, DeFi vault, strategy, yield farming, vault deposit, vault withdraw, earning yield through vaults, passive yield strategies, or wants to deposit into or withdraw from a yield strategy — even if they don't say \"Troves\" explicitly.","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-troves\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-troves\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":96,"name":97,"nameZh":6,"description":98,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":99,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":94},"01M7DTK6CJSMGC8KCQHGNYFZBD","trade","Swap tokens on Starknet via Fibrous DEX aggregator. Supports per-provider selection (avnu, ekubo, or auto to race all). Use this skill when the user wants to swap, exchange, trade, convert, buy, or sell one token for another on Starknet. Also use when the user asks about token prices, exchange rates, DEX routing, best swap route, or wants to check how much they would receive for a given amount — even if they don't explicitly say \"swap\".","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-trade\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-trade\u002FSKILL.md",[],[],{"skillNo":104,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":107,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":94},"01M7DTJZ6A0X4PAW3Y8W4J9K64","staking","Stake, unstake, claim, and compound rewards for STRK, WBTC, tBTC, SolvBTC, and LBTC on Starknet. View validators, pools, and staking positions. Use this skill when the user mentions staking, delegating, validators, staking pools, rewards, compounding, unstaking, earning yield, passive income on crypto, or wants to earn on their STRK or BTC tokens — even if they don't say \"stake\" explicitly.","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-staking\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-staking\u002FSKILL.md",[],[],{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":115,"sourceHtmlUrl":116,"categories":117,"keywords":118,"publishedAt":94},"01M7DTJSDZJKCDMW7GHRF4BRH5","send","Send STRK, ETH, or any ERC-20 token to a Starknet address. Supports simulation (dry-run) before execution. Use this skill when the user wants to send, transfer, pay, tip, or move tokens to another wallet address on Starknet. Also trigger when the user mentions sending funds to someone, making a payment, transferring assets, or moving crypto to a specific address — even if they just say \"pay 10 STRK to 0x...\".","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-send\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-send\u002FSKILL.md",[],[],{"skillNo":120,"name":121,"nameZh":6,"description":122,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":123,"sourceHtmlUrl":124,"categories":125,"keywords":126,"publishedAt":94},"01M7DTJG1E480D51ZQ7WKDQ26K","portfolio","View a comprehensive DeFi portfolio dashboard and optimize portfolio allocation via automated rebalancing. Use this skill when the user wants an overview, summary, dashboard, total value, net worth, portfolio rebalancing, target allocation, or wants to see all their DeFi positions across Starknet at once. Also trigger when the user asks \"what do I have\", \"show me everything\", \"how much am I worth\", \"my positions\", \"my investments\", \"rebalance my portfolio\", \"I want 50% ETH\", \"optimize my holdings\", or any request for a holistic view of their Starknet holdings — even if they don't explicitly say \"portfolio\".","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-portfolio\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-portfolio\u002FSKILL.md",[],[],{"skillNo":128,"name":129,"nameZh":6,"description":130,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":131,"sourceHtmlUrl":132,"categories":133,"keywords":134,"publishedAt":94},"01M7DTJ7M8TE9R2N36HFBZDGVD","multi-swap","Execute multiple token swaps in a single Starknet transaction via Fibrous (default). Supports per-provider selection (avnu, ekubo, or auto to race all). Supports 2-3 swap pairs bundled into one multicall. Use this skill when the user wants to swap multiple token pairs at once, do batch swaps, execute several trades simultaneously, perform parallel swaps, or do bulk trading in one transaction. Also trigger when the user mentions \"two swaps\", \"three swaps\", \"swap X and Y at the same time\", or wants to convert multiple tokens in a single call.","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-multi-swap\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-multi-swap\u002FSKILL.md",[],[]]