API Documentation
将 MakeSwap 强大的原生跨链兑换功能直接集成到您的应用程序中。我们的 API 提供对底层协议的访问,支持比特币、以太坊、波卡等主要区块链之间的安全、非托管兑换。
安全 & 非托管
所有兑换均通过 MPC 验证器执行。我们从不持有用户资金。
快速执行
通过 JIT 流动性提供商优化路由。
支持资产
与 Quote 端点交互时,请使用正确的资产标识符。标识符遵循 Chain.Ticker 格式。
支持资产列表
资产标识符格式
资产由字符串格式标识: CHAIN.TICKER 或 CHAIN.TICKER-CONTRACT
Supported Asset List is intentionally curated to major assets only. Long-tail and scam-token candidates are excluded.
- 原生资产: e.g., ETH.ETH (Ethereum), BTC.BTC (Bitcoin)
- 代币资产: e.g., ETH.USDC-0xA0b8... (USDC on Ethereum)
GET获取代币
以编程方式获取支持资产的完整列表。
curl -X GET "https://makeswap.io/api/v1/tokens"
POST获取报价
获取给定交易对的可用兑换路线和报价。此端点经过优化,通过 Chainflip 提供商返回支持的原生资产的有效路线。
curl -X POST "https://makeswap.io/api/v1/quote" \
-H "Content-Type: application/json" \
-d '{"sellAsset":"BTC.BTC", "buyAsset":"ETH.ETH", "sellAmount":"0.1"}'
交互式游乐场 - 获取报价
参数
| 字段 | 类型 | 必填 | 描述 |
|---|---|---|---|
| sellAsset | string | Yes | 资产标识符 (例如 'BTC.BTC') |
| buyAsset | string | Yes | 资产标识符 (例如 'ETH.ETH') |
| sellAmount | string | Yes | 以原生单位兑换的金额 |
POSTSwap
Create swap transaction details from a previously selected route. This endpoint proxies SwapKit v3 /v3/swap.
curl -X POST "https://makeswap.io/api/v1/swap" \
-H "Content-Type: application/json" \
-d '{ "routeId": "uuid", "sourceAddress": "bc1...", "destinationAddress": "0x123..." }'
{
"routeId": "uuid",
"targetAddress": "bc1...",
"tx": "base64_or_hex",
"swapId": "uuid"
}POST追踪兑换
Track swap status using hash + chainId, depositChannelId, or depositAddress.
curl -X POST "https://makeswap.io/api/v1/track" \
-H "Content-Type: application/json" \
-d '{ "hash": "0x...", "chainId": "1" }'
{
"id": "12345",
"status": "deposit_received", // waiting_deposit, sending, complete
"depositAddress": "...",
"txHash": null,
"outAmount": null
}POSTIntegration Token
Issue short-lived tokens for iframe, SDK, or wallet integrations. You can authenticate with partner credentials or an internal signed request.
curl -X POST "https://makeswap.io/api/v1/integrations/token" \
-H "Content-Type: application/json" \
-d '{ \"origin\": \"https://partner.example\", \"affiliateFeeBps\": 100 }'
Partner mode headers
- x-makeswap-key-id
- x-makeswap-key-secret
Internal wallet mode headers
- x-makeswap-internal-key-id
- x-makeswap-internal-timestamp (unix seconds)
- x-makeswap-internal-signature (HMAC-SHA256 hex of METHOD\\nPATH\\nTIMESTAMP\\nSHA256(BODY))
- x-makeswap-internal-body-sha256 (optional integrity check)
Embed quickstart
<iframe src="https://makeswap.io/embed?token=INTEGRATION_TOKEN" style="width:100%;min-height:640px;border:0" title="MakeSwap Widget" />
No-SDK partner onboarding
<iframe src="https://makeswap.io/embed/PARTNER_ID?sellAsset=BTC.BTC&buyAsset=ETH.ETH" style="width:100%;height:760px;border:0" title="MakeSwap Widget" />
The partner route validates parent website origin against allowed origins configured in admin.