v1

latestOpenAPI 3.1.02026-07-2411601020.7 KB

[Sandbox] Update swap status

[Available in Sandbox environment only] Update status of a swap transaction to completed.

put/sandbox/swap/transactions/{contractId}

Path parameters

contractIdstring required

Retrieve the unique swap transaction ID from the response of Execute a swap quote endpoint.

Headers

X-XFERS-APP-API-KEYstring required

You can retrieve this from your Dashboard Developer Tools.<br><br><strong>Note:</strong> The X-XFERS-APP-API-KEY is a mandatory header for all authentication methods, including standard API key usage and HTTP Request Signing mode.

X-PUBLIC-KEY-IDstring

The Key ID, can be retrieved from your StraitsX Dashboard.<br><br><strong>Note:</strong> This header attribute is required when HTTP Request Signing is enabled for your account.

X-TIMESTAMPstring

Current Unix epoch time in seconds. Must be within ±300 seconds of server time.<br><br><strong>Note:</strong> This header attribute is required when HTTP Request Signing is enabled for your account.

X-NONCEstring

A unique UUID string per request, used for replay protection. Must not be reused within the timestamp window.<br>Regex: /\A[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\z/i<br><br><strong>Note:</strong> This header attribute is required when HTTP Request Signing is enabled for your account.

X-SIGNATUREstring

Base64-encoded digital signature of the canonical request string.<br><br><strong>Note:</strong> This header attribute is required when HTTP Request Signing is enabled for your account.

Request body

Response

200

Example response

{
  "data": {
    "id": "contract_dcd62fefd4d6462bbfb36def34551adb",
    "type": "swapTransaction",
    "attributes": {
      "idempotencyId": "swaptrx-5",
      "quoteId": "898158a6-335e-44c0-a36c-ea967ba3c761",
      "status": "completed",
      "swapPair": "XSGDUSDC",
      "sourceCurrency": "USDC",
      "targetCurrency": "XSGD",
      "fixedSide": "source",
      "totalSourceCurrencyAmount": "11.0",
      "sourceCurrencyAmount": "10.99",
      "targetCurrencyAmount": "14.38",
      "rate": "1.309",
      "expiresAt": "2024-04-01T14:47:13.120+08:00",
      "fees": [
        {
          "type": "TransactionFee",
          "amount": "0.01",
          "currency": "USDC"
        }
      ],
      "createdAt": "2024-04-01T14:43:10.334+08:00",
      "updatedAt": "2024-04-01T14:43:16.371+08:00"
    }
  }
}