Get Swap

To check transaction status, you can retrieve created swap.

GET https://api.layerswap.io/api/swaps/

Get swap by Id or ReferenceId

Path Parameters

Name
Type
Description

id*

String

ID can be either the Swap response data.id received in the create swap endpoint or a partner provided reference_id from the create swap request

Headers

Name
Type
Description

X-LS-APIKEY*

API Key Retrived from Partner Setup

{
  "data": {
    "id": "28996c7d-ee95-4727-8efe-ba0006aa16d4",
    "from_network": {
      "name": "IMMUTABLEX_GOERLI",
      "display_name": "ImmutableX Goerli",
      "logo": "https://devlslayerswapbridgesa.blob.core.windows.net/layerswap/networks/immutablex_goerli.png"
    },
    "to_network": {
      "name": "ARBITRUM_GOERLI",
      "display_name": "Arbitrum One Goerli",
      "logo": "https://devlslayerswapbridgesa.blob.core.windows.net/layerswap/networks/arbitrum_goerli.png"
    },
    "from": "Fake CEX (for testing)",
    "to": "Arbitrum One Goerli",
    "amount": 1,
    "fee": 0,
   "asset": {
      "name": "ETH",
      "display_name": "ETH",
      "logo": "https://devlslayerswapbridgesa.blob.core.windows.net/layerswap/currencies/eth.png",
      "usd_price": 1745.42,
      "contract": null,
      "decimals": 6,
      "precision": 6
    },
    "to_address": "0xC11c16C421419a11211197B7D4857ff62013a4C3",
    "source_address": "0xC11c16C421419a11211197B7D4857ff62013a4C3",
    "deposit_address": "0x7393b2a34cc9a40315fb18a33c3bf6307d346733",
    "status": "completed",
    "reference_id": "1",
    "app_name": "MyApp",
    "transactions" : [
      {
        "timestamp": 1691491520123,
        "type": "input",
        "from": "0xD5c11b416bAa7E1256E209AfaE96d734B5B0A461",
        "to": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
        "created_date": "2023-01-25T13:18:14.347986+00:00",
        "transaction_id": "0xbf521e098e100c94b9ac2203274eff799a2d54fed204bbc19816e77877481307",
        "explorer_url": "https://goerli.etherscan.io/tx/0xbf521e098e100c94b9ac2203274eff799a2d54fed204bbc19816e77877481307",
        "confirmations": 1,
        "max_confirmations": 1,
        "amount": 0.005063,
        "usd_price": 7.91539294,
        "usd_value": 0.04007563445522
      },
      {
        "timestamp": 1691491520123,
        "type": "output",
        "from": "0xCE0BaBc8398144Aa98D9210d595E3A9714910748",
        "to": "0xeBec795c9c8bBD61FFc14A6662944748F299cAcf",
        "created_date": "2023-01-25T13:18:32.031303+00:00",
        "transaction_id": "0x1e639aaf80069cbd2cbebf0c3fea974146844566e43ddd7074b9b47728e4d2d9",
        "explorer_url": "https://explorer.loopring.io/tx/0x1e639aaf80069cbd2cbebf0c3fea974146844566e43ddd7074b9b47728e4d2d9-transfer",
        "confirmations": 0,
        "max_confirmations": 0,
        "amount": 0.005,
        "usd_price": 7.8169,
        "usd_value": 0.0390845
      }
    ]
  },
  "error": null
}

A detailed explanation of Swap Object is available here.

Raw Request

Raw response

Last updated

Was this helpful?