/track - Request the status of a swap

The /tracker endpoint provides real-time status information for a specific transaction. It is particularly useful for tracking the progress and details of swaps, transfers, and other operations. To use this endpoint, you must provide the chain ID and transaction hash. For a complete list of chain IDs used by SwapKit you can check the table here.

Method: POST URL: https://api.swapkit.dev/track

Request Body:

Field
Type
Description

hash

string

Transaction hash (required)

chainId

string

Chain ID of the transaction (required)

block

number

Set to 0.

Example Request:

curl -X 'POST' \
  'https://api.swapkit.dev/track' \
  -H 'Content-Type: application/json' \
  -H "x-api-key: YOUR_VARIABLE_HERE" \
  -d '{
  "hash": "0x1890aba1c0b25126892af2ab09f5c1bba75adefc47918a96ea498764ab643ce9",
  "chainId": "1",
  "block": 0
}'

Response

The response contains detailed information about the transaction status, type, and associated metadata. It also includes the array "legs" which represent the different stages or components of the transaction.

Response Fields:

Field
Type
Description

chainId

string

The chain ID where the transaction occurred.

hash

string

The transaction hash.

block

number

The block number where the transaction was included.

type

string

The type of the transaction (e.g., swap, token_transfer).

status

string

The transaction status (e.g., completed). We will expand on it later.

trackingStatus

string

The current tracking status (using status is enough and this field should not be necessary).

fromAsset

string

The asset being sent.

fromAmount

string

The amount of fromAsset.

fromAddress

string

The address sending the asset.

toAsset

string

The asset being received.

toAmount

string

The amount of toAsset.

toAddress

string

The recipient address.

finalisedAt

number

UNIX timestamp indicating when the transaction finalized.

meta

object

Metadata including images and provider info.

payload

object

Additional transaction specific data.

legs

array

Detailed breakdown of each transaction leg.


Example response:

{
  "chainId": "43114",
  "hash": "0x18f6d7b91ceffcc6d70b5d73f324198d9847531b7fe53d9446b7e60a64fa44b9",
  "block": 57181100,
  "type": "swap",
  "status": "completed",
  "trackingStatus": "completed",
  "fromAsset": "AVAX.AVAX",
  "fromAmount": "9.58",
  "fromAddress": "0xC935B2397f0c6f85235ceFba2Eb714fb5F919Ca0",
  "toAsset": "THOR.RUNE",
  "toAmount": "0",
  "toAddress": "thor1mse4ysqpru6s7f6twlskt2yz963xz630mwtxqn",
  "finalisedAt": 1739313043,
  "meta": {
    "provider": "THORCHAIN",
    "providerAction": "swap",
    "images": {
      "from": "https://storage.googleapis.com/token-list-swapkit/images/avax.avax.png",
      "to": "https://storage.googleapis.com/token-list-swapkit/images/thor.rune.png",
      "provider": "https://storage.googleapis.com/token-list-swapkit/images/thor.rune.png",
      "chain": "https://storage.googleapis.com/token-list-swapkit/avax.avax.png"
    }
  },
  "payload": {
    "memo": "=:r:thor1mse4ysqpru6s7f6twlskt2yz963xz630mwtxqn:0:-_/t:5/50"
  },
  "legs": [
    {
      "chainId": "43114",
      "hash": "0x18f6d7b91ceffcc6d70b5d73f324198d9847531b7fe53d9446b7e60a64fa44b9",
      "block": 57181100,
      "type": "swap",
      "status": "completed",
      "trackingStatus": "completed",
      "fromAsset": "AVAX.AVAX",
      "fromAmount": "9.58",
      "fromAddress": "0xC935B2397f0c6f85235ceFba2Eb714fb5F919Ca0",
      "toAsset": "AVAX.AVAX",
      "toAmount": "9.58",
      "toAddress": "0x8F66c4AE756BEbC49Ec8B81966DD8bba9f127549",
      "finalisedAt": 1739313038,
      "meta": {
        "images": {
          "from": "https://storage.googleapis.com/token-list-swapkit/images/avax.avax.png",
          "to": "https://storage.googleapis.com/token-list-swapkit/images/avax.avax.png",
          "chain": "https://storage.googleapis.com/token-list-swapkit/avax.avax.png"
        }
      },
      "payload": {
        "memo": "=:r:thor1mse4ysqpru6s7f6twlskt2yz963xz630mwtxqn:0:-_/t:5/50"
      }
    },
    {
      "chainId": "thorchain-1",
      "hash": "18f6d7b91ceffcc6d70b5d73f324198d9847531b7fe53d9446b7e60a64fa44b9",
      "block": 19828318,
      "type": "swap",
      "status": "completed",
      "trackingStatus": "completed",
      "fromAsset": "AVAX.AVAX",
      "fromAmount": "9.58",
      "fromAddress": "0xc935b2397f0c6f85235cefba2eb714fb5f919ca0",
      "toAsset": "THOR.RUNE",
      "toAmount": "0",
      "toAddress": "thor1mse4ysqpru6s7f6twlskt2yz963xz630mwtxqn",
      "finalisedAt": 1739313043,
      "meta": {
        "provider": "THORCHAIN",
        "providerAction": "swap",
        "images": {
          "from": "https://storage.googleapis.com/token-list-swapkit/images/avax.avax.png",
          "to": "https://storage.googleapis.com/token-list-swapkit/images/thor.rune.png",
          "provider": "https://storage.googleapis.com/token-list-swapkit/images/thor.rune.png",
          "chain": "https://storage.googleapis.com/token-list-swapkit/thor.rune.png"
        }
      },
      "payload": {
        "memo": "=:r:thor1mse4ysqpru6s7f6twlskt2yz963xz630mwtxqn:0:-_/t:5/50",
        "thorname": ""
      }
    }
  ]
}

Notes:

  • The legs array provides a detailed view of each step in the transaction process.

  • meta contains additional information, including images and the swap provider details.

  • The payload may include data like evmCalldata or memo for more complex transactions.

Transaction status

An important part of the response is the transaction status from the status field, which can have multiple values:

Status value
Explanation

not_started

The swap has not happened yet.

pending

Intermediate state. The transaction has been detected by the mempool but is pending block confirmation.

swapping

The swap is happening.

completed

The swap is finished.

refunded

The swap was refunded because of the slippage settings.

unknown

Catch all for other situations.

failed

The transaction failed in an inbound EVM contract.

Last updated