コンテンツへスキップ
NoveraSwap
ja

API

このウェブサイトを支える公開 API です。機械可読な完全な仕様は、OpenAPI 3.1 形式で https://api.noveraswap.com/v1/openapi.json から入手できます。

連携ガイド

リンクから完全なサーバー連携まで、ユーザーにプライベートスワップを提供する3つの方法です。

紹介リンク

アフィリエイトページでコードを取得してください。あわせて aff_ で始まるダッシュボードキーが発行されます。一度しか表示されないので、大切に保管してください。

YOURCODE を自分のコードに置き換えて https://noveraswap.com/?ref=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 — 受け取る資産。ID で指定
  • amount — 送る金額。小数点にはドットを使用
  • mode — private または standard
  • ref — ウィジェットでの注文をお客様の実績として数えるためのアフィリエイトコード
  • theme — dark、light または auto(訪問者のシステム設定に従う)
  • lockTo — 1 で受け取る資産を固定(to が必要)

ウィジェットは postMessage で進行状況をページに通知します。novera:order_created は注文IDを、novera:phase_changed は注文IDと公開フェーズを伝えます。メッセージを使う前に、このサイトから送られたものか(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
  }
});
ホストページが受取アドレスや返金アドレスを事前入力することは、URL でも postMessage でも決してできません。コインの送り先を入力できるのは訪問者本人だけです。受取先をご自身で設定する必要がある場合は、サーバー間 API をご利用ください。

サーバー間 API

アフィリエイトダッシュボードでキーを作成してください(先にアフィリエイトページでコードを取得します)。このキーで作成した注文はすべて、紹介リンク経由の注文とまったく同じようにアフィリエイト報酬の対象になります。キーを再度作成すると、以前のキーは直ちに置き換えられます。

nsk_ で始まるインテグレーターキーを X-Api-Key ヘッダーで送り、ご自身のサーバーから API を呼び出してください。キーは決してブラウザで使わないでください。Origin ヘッダー付きのリクエストは拒否されます。

レート制限はキーごとに適用されます。キーはパスワードと同じようにサーバー上で保管してください。キーを持つ人は誰でもお客様の名義で注文を作成できます。

新しいキーは、キーを持たない訪問者と同じ制限(ときどき必要なプルーフ・オブ・ワークを含む)で始まり、入金待ちの注文は少数しか保持できません。注文の一部が支払われると、完全な制限が適用されます。注文がほとんど支払われないキーはブロックされます。再有効化はサポートが行えます。

完全なリファレンスは https://api.noveraswap.com/v1/openapi.json にある OpenAPI ドキュメントです。

インテグレーターは、同じ API を独自のキーを使ってサーバー間で利用します。ブラウザからインテグレーターのキーを使用することは決してできません。

Affiliates

エンドポイント内容
POST/v1/affiliatesSign up as an affiliate and reserve a referral code.
GET/v1/affiliates/meThe affiliate account and its totals (aggregates only).
PATCH/v1/affiliates/meChange the payout address or contact.
DELETE/v1/affiliates/me/api-keyRevoke the affiliate's own server-to-server API key.
POST/v1/affiliates/me/api-keyCreate (or replace) the affiliate's own server-to-server API key.
POST/v1/affiliates/me/keyReplace the affiliate key.
POST/v1/affiliates/me/payout-requestRequest a payout of the whole withdrawable balance.
POST/v1/affiliates/me/recovery-codeMake a new recovery code.
DELETE/v1/affiliates/me/recovery-emailRemove the recovery email.
POST/v1/affiliates/me/recovery-emailAdd or replace the optional recovery email.
POST/v1/affiliates/me/recovery-email/verifyConfirm the recovery email with the code mailed to it.
GET/v1/affiliates/me/statementsStatements and payout requests with their status, newest first.
GET/v1/affiliates/me/statsReferred orders and earnings per day, week or month (aggregates only).
GET/v1/affiliates/me/ticketsThe affiliate's support requests, newest first.
POST/v1/affiliates/me/ticketsOpen 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}/closeClose a support request.
POST/v1/affiliates/me/tickets/{ticketId}/messagesWrite to a support request.
POST/v1/affiliates/recoverAsk for a key recovery code (no key).
POST/v1/affiliates/recover/confirmExchange a recovery code for a new key (no key).

Catalogue

エンドポイント内容
GET/v1/assetsEnabled assets with their networks and the pricing notice copy.
GET/v1/pairs/limitsMinimum and maximum input amount for a pair.

Utilities

エンドポイント内容
GET/v1/go/{id}Redirect to the sponsor, counting the click.
GET/v1/openapi.jsonThis OpenAPI 3.1 document.
GET/v1/powProof-of-work challenge parameters for `X-Novera-PoW`.
GET/v1/sponsorsThe sponsored card for a slot, if any.
POST/v1/sponsors/{id}/impressionCount one impression of a placement.
GET/v1/statusService status, completion statistics, incidents and the signing-key manifest.
POST/v1/telemetry/client-errorsOpt-in client error reports.
POST/v1/validate-addressCheck an address for an asset, locally.

Health

エンドポイント内容
GET/v1/healthLiveness; no dependencies.
GET/v1/health/readyReadiness: `200` when ready (possibly degraded), `503` otherwise.

Orders

エンドポイント内容
POST/v1/ordersCreate an order from a quote.
GET/v1/orders/{publicId}Order status: minimal without the secret, full with it.
POST/v1/orders/{publicId}/actionAnswer the form in `actionRequired`.
POST/v1/orders/{publicId}/cancelCancel an order that is still waiting for its deposit.
DELETE/v1/orders/{publicId}/detailsDelete the order details now instead of at the automatic deletion.
GET/v1/orders/{publicId}/eventsThe full public timeline, with transaction hashes where present.
POST/v1/orders/{publicId}/notificationsOpt into status notifications by email or Telegram.
DELETE/v1/orders/{publicId}/notifications/{channel}Remove a notification channel.
POST/v1/orders/{publicId}/refund-addressRegister or replace the refund address.

Support

エンドポイント内容
GET/v1/orders/{publicId}/ticketsEvery ticket on the order with its thread.
POST/v1/orders/{publicId}/ticketsOpen a support ticket on an order.
GET/v1/orders/{publicId}/tickets/{ticketId}One ticket and its thread.
POST/v1/orders/{publicId}/tickets/{ticketId}/closeClose a ticket and release its hold on the order details.
POST/v1/orders/{publicId}/tickets/{ticketId}/messagesAdd a message to a ticket.
POST/v1/support/requestsOpen a support request without an order.
GET/v1/support/requests/{ticketId}A request without an order and its thread.
POST/v1/support/requests/{ticketId}/closeClose a request without an order.
POST/v1/support/requests/{ticketId}/messagesAdd a message to a request without an order.

Quotes

エンドポイント内容
POST/v1/quotesQuote a swap.