API
本网站背后的公共 API。完整的机器可读描述以 OpenAPI 3.1 格式提供,地址为 https://api.noveraswap.com/v1/openapi.json。
集成指南
从一个链接到完整的服务器集成,有三种方式为您的用户提供私密兑换。
推荐链接
在推广计划页面获取推荐码。同时您会获得一个以 aff_ 开头的仪表板密钥;它只显示一次,请妥善保管。
分享 https://noveraswap.com/?ref=YOURCODE(将 YOURCODE 替换为您的推荐码),或在首页或任一兑换页面(/swap/…)的地址后加上 ?ref=YOURCODE;推荐码在有兑换表单的页面上生效。
通过您的链接创建的每一笔订单,都会让您获得本服务就该订单实际收到款项的一部分分成。您只能看到总计数据,永远看不到关于您所推荐的人的任何信息。
在您于仪表板中申请付款后,收益将以 USDC 支付。大多数付款会在几分钟内自动发送;有时某笔付款需要等待我们的团队处理,可能需要几天时间。
小组件
使用 iframe 将兑换表单嵌入您的页面。访客是在框架中的本站页面上完成兑换,因此您的网站从不经手他们的币或地址。
<iframe
src="https://noveraswap.com/widget?from=usdt-eth&to=usdc-base&ref=YOURCODE&theme=auto"
title="NoveraSwap"
width="420"
height="680"
allow="clipboard-write"
style="border:0"
loading="lazy"
></iframe>查询参数(均为可选):
from— 要发送的资产,使用其在本网站上的 ID(例如 usdt-eth)to— 要接收的资产,使用其 IDamount— 要发送的金额,以点作为小数分隔符mode— private 或 standardref— 您的推荐码,使通过小组件创建的订单计入您的名下theme— dark、light 或 auto(跟随访客的系统设置)lockTo— 1 表示固定要接收的资产;需要同时设置 to
小组件通过 postMessage 向您的页面通报进度:novera:order_created 携带订单号,novera:phase_changed 携带订单号及其公开阶段。使用消息前,请先确认它来自本网站(event.origin)。
window.addEventListener('message', (event) => {
if (event.origin !== 'https://noveraswap.com') return;
if (event.data?.type === 'novera:order_created') {
// event.data.orderId
}
if (event.data?.type === 'novera:phase_changed') {
// event.data.orderId, event.data.phase
}
});服务器对服务器 API
在推广伙伴面板中创建您的密钥(请先在推广计划页面获取代码)。用它创建的每一笔订单都会为您带来推广分成,与通过您的推荐链接下的订单完全相同。再次创建密钥会立即替换之前的密钥。
请从您自己的服务器调用 API,使用以 nsk_ 开头的集成方密钥,并通过 X-Api-Key 请求头发送。切勿在浏览器中使用该密钥:带有 Origin 请求头的请求会被拒绝。
请求速率限制按密钥执行。请像保管密码一样把密钥保存在您的服务器上:持有密钥的人就能以您的名义创建订单。
新密钥起初与没有密钥的访客适用相同的限制(包括偶尔需要的工作量证明),且只能保留少量等待存款的订单;在其部分订单完成付款后,即获得完整限额。订单几乎从未付款的密钥会被封禁;支持团队可以重新启用。
完整参考是位于 https://api.noveraswap.com/v1/openapi.json 的 OpenAPI 文档。
集成方使用同一个 API,以服务器对服务器的方式调用,并使用自己的密钥。浏览器永远无法使用集成方密钥。
Affiliates
| 端点 | 功能 |
|---|---|
| POST/v1/affiliates | Sign up as an affiliate and reserve a referral code. |
| GET/v1/affiliates/me | The affiliate account and its totals (aggregates only). |
| PATCH/v1/affiliates/me | Change the payout address or contact. |
| DELETE/v1/affiliates/me/api-key | Revoke the affiliate's own server-to-server API key. |
| POST/v1/affiliates/me/api-key | Create (or replace) the affiliate's own server-to-server API key. |
| POST/v1/affiliates/me/key | Replace the affiliate key. |
| POST/v1/affiliates/me/payout-request | Request a payout of the whole withdrawable balance. |
| POST/v1/affiliates/me/recovery-code | Make a new recovery code. |
| DELETE/v1/affiliates/me/recovery-email | Remove the recovery email. |
| POST/v1/affiliates/me/recovery-email | Add or replace the optional recovery email. |
| POST/v1/affiliates/me/recovery-email/verify | Confirm the recovery email with the code mailed to it. |
| GET/v1/affiliates/me/statements | Statements and payout requests with their status, newest first. |
| GET/v1/affiliates/me/stats | Referred orders and earnings per day, week or month (aggregates only). |
| GET/v1/affiliates/me/tickets | The affiliate's support requests, newest first. |
| POST/v1/affiliates/me/tickets | Open a support request about the affiliate account. |
| GET/v1/affiliates/me/tickets/{ticketId} | One support request and its thread. |
| POST/v1/affiliates/me/tickets/{ticketId}/close | Close a support request. |
| POST/v1/affiliates/me/tickets/{ticketId}/messages | Write to a support request. |
| POST/v1/affiliates/recover | Ask for a key recovery code (no key). |
| POST/v1/affiliates/recover/confirm | Exchange a recovery code for a new key (no key). |
Catalogue
| 端点 | 功能 |
|---|---|
| GET/v1/assets | Enabled assets with their networks and the pricing notice copy. |
| GET/v1/pairs/limits | Minimum and maximum input amount for a pair. |
Utilities
| 端点 | 功能 |
|---|---|
| GET/v1/go/{id} | Redirect to the sponsor, counting the click. |
| GET/v1/openapi.json | This OpenAPI 3.1 document. |
| GET/v1/pow | Proof-of-work challenge parameters for `X-Novera-PoW`. |
| GET/v1/sponsors | The sponsored card for a slot, if any. |
| POST/v1/sponsors/{id}/impression | Count one impression of a placement. |
| GET/v1/status | Service status, completion statistics, incidents and the signing-key manifest. |
| POST/v1/telemetry/client-errors | Opt-in client error reports. |
| POST/v1/validate-address | Check an address for an asset, locally. |
Health
| 端点 | 功能 |
|---|---|
| GET/v1/health | Liveness; no dependencies. |
| GET/v1/health/ready | Readiness: `200` when ready (possibly degraded), `503` otherwise. |
Orders
| 端点 | 功能 |
|---|---|
| POST/v1/orders | Create an order from a quote. |
| GET/v1/orders/{publicId} | Order status: minimal without the secret, full with it. |
| POST/v1/orders/{publicId}/action | Answer the form in `actionRequired`. |
| POST/v1/orders/{publicId}/cancel | Cancel an order that is still waiting for its deposit. |
| DELETE/v1/orders/{publicId}/details | Delete the order details now instead of at the automatic deletion. |
| GET/v1/orders/{publicId}/events | The full public timeline, with transaction hashes where present. |
| POST/v1/orders/{publicId}/notifications | Opt into status notifications by email or Telegram. |
| DELETE/v1/orders/{publicId}/notifications/{channel} | Remove a notification channel. |
| POST/v1/orders/{publicId}/refund-address | Register or replace the refund address. |
Support
| 端点 | 功能 |
|---|---|
| GET/v1/orders/{publicId}/tickets | Every ticket on the order with its thread. |
| POST/v1/orders/{publicId}/tickets | Open a support ticket on an order. |
| GET/v1/orders/{publicId}/tickets/{ticketId} | One ticket and its thread. |
| POST/v1/orders/{publicId}/tickets/{ticketId}/close | Close a ticket and release its hold on the order details. |
| POST/v1/orders/{publicId}/tickets/{ticketId}/messages | Add a message to a ticket. |
| POST/v1/support/requests | Open a support request without an order. |
| GET/v1/support/requests/{ticketId} | A request without an order and its thread. |
| POST/v1/support/requests/{ticketId}/close | Close a request without an order. |
| POST/v1/support/requests/{ticketId}/messages | Add a message to a request without an order. |
Quotes
| 端点 | 功能 |
|---|---|
| POST/v1/quotes | Quote a swap. |