NAV
php shell html

Swapbot API

Welcome to the Swapbot API.

Authentication

Protected API calls require authentication. See https://github.com/tokenly/hmac-auth/blob/master/README.md for details.

Public Bot Information

Load a bot by ID

<?php
$bot_id = '8baabb48-8250-4184-8342-e540244bda5b';
$bot_data = $api->getBotById($bot_id);
BOT_ID="8baabb48-8250-4184-8342-e540244bda5b"
curl -X GET https://swapbot.tokenly.com/api/v1/public/bot/$BOT_ID
<!-- There is no HTML example for this API endpoint -->

The above command returns data structured like the following. Note that there may be more data returned than listed below.

{
    "id": "8baabb48-8250-4184-8342-e540244bda5b",
    "name": "The Official TOKENLY 'bot",
    "state": "active",
    "address": "1YxC7GN6NipW12XLPuCFcTFfkMKYAu1Lb",
    "description": "This bot sells **TOKENLY**, a digital gift certificate...",
    "descriptionHtml": "<p>This bot sells <strong>TOKENLY</strong>, a digital gift certificate...",
    "logoImageDetails": {
        "fullUrl": "https://s3.amazonaws.com/tokenly-swapbot/images/d6c9594065c361575afab0229d49015e6872793ebf870875f89aa0b0b86dbfc7/full.png",
        "mediumUrl": "https://s3.amazonaws.com/tokenly-swapbot/images/d6c9594065c361575afab0229d49015e6872793ebf870875f89aa0b0b86dbfc7/medium.png",
        "thumbUrl": "https://s3.amazonaws.com/tokenly-swapbot/images/d6c9594065c361575afab0229d49015e6872793ebf870875f89aa0b0b86dbfc7/thumb.png"
    },
    "urlSlug": "the-official-tokenly-bot",
    "username": "adam",
    "hash": "0e28460cb598d6d9235554e89734fd3c4c620833e7c6c90d84ca120890bb813d",
    "lastChangedAt": "2016-03-21T12:19:45+0000",
    "balances": {
        "BTC": 0.06300014,
        "TOKENLY": 1672.98906687
    },
    "confirmationsRequired": 2,
    "swapRules": [
        {
            "discounts": [
                {
                    "moq": "4",
                    "pct": 0.05
                }
            ]
        }
    ],
    "swaps": [
        {
            "cost": "5",
            "direction": "sell",
            "divisible": false,
            "fiat": "USD",
            "in": "BTC",
            "min_out": "2",
            "out": "TOKENLY",
            "source": "bitcoinAverage",
            "strategy": "fiat"
        },
        {
            "direction": "buy",
            "in": "TOKENLY",
            "min": "1",
            "out": "LTBCOIN",
            "price": null,
            "rate": "15000",
            "strategy": "rate"
        }
    ]
}

Fetches all information about a bot by its id.

HTTP Request

GET https://swapbot.tokenly.com/api/v1/public/bot/{botId}

URL Parameters

Parameter Description
botId The bot identifier.

Search for Bots

<?php
$bot_id = '8baabb48-8250-4184-8342-e540244bda5b';
$bot_data = $api->getBotById($bot_id);
curl -X GET "http://swapbot.tokenly.com/api/v1/public/bots?name=tokenly"
<!-- There is no HTML example for this API endpoint -->

The above command returns data structured like the following. Note that there may be more data returned than listed below.

[
  {
    "id": "e5cb4df3-b85e-4194-a673-c9d45c2b8117",
    "name": "Tokenly's SWAPBOTMONTH Vendor",
    "username": "adam",
    "botUrl": "https://swapbot.tokenly.com/bot/adam/tokenlys-swapbotmonth-vendor",
    "descriptionHtml": "This bot sells <strong>SWAPBOTMONTH</strong>, a digital gift certificate token that is redeemable for...",
    "robohashImage": "https://robohash.tokenly.com/0fbcfc58b9e571bd221710af2d46556c426a47122283a29df460d8ccb6c2169f.png?set=set3",
    "backgroundImage": "https://s3.amazonaws.com/tokenly-swapbot/images/4a0d9687d068e157e5f96974a15794274b5582504684673131e290aa7bd49061/full.jpg",
    "logoImage": "https://s3.amazonaws.com/tokenly-swapbot/images/cdd95d3b306d015442243b5357641c6bc7efcdd721f76c086f04c62dc19f3267/thumb.png",
    "swaps": [
      {
        "strategy": "fiat",
        "direction": "sell",
        "in": "BTC",
        "out": "SWAPBOTMONTH",
        "cost": "7",
        "divisible": false,
        "min_out": "1",
        "type": "buy",
        "fiat": "USD",
        "source": "bitcoinAverage"
      }
    ],
    "balances": {
      "BTC": 0.0009098,
      "SWAPBOTMONTH": 492
    },
    "address": "17B6qaNi6UxjbA8iZp4UAAqFxsd1CYnnSh"
  },
  {
    "id": "8baabb48-8250-4184-8342-e540244bda5b",
    "name": "The Official TOKENLY 'bot",
    "username": "adam",
    "botUrl": "https://swapbot.tokenly.com/bot/adam/the-official-tokenly-bot",
    "descriptionHtml": "<p>This bot sells <strong>TOKENLY</strong>, a digital gift certificate...",
    "robohashImage": "https://robohash.tokenly.com/0e28460cb598d6d9235554e89734fd3c4c620833e7c6c90d84ca120890bb813d.png?set=set3",
    "backgroundImage": "https://s3.amazonaws.com/tokenly-swapbot/images/5b78c3721cdedaa466cb2fe41aeab8ae67364b786e3c74967fe0959312d54e4f/full.jpg",
    "logoImage": "https://s3.amazonaws.com/tokenly-swapbot/images/d6c9594065c361575afab0229d49015e6872793ebf870875f89aa0b0b86dbfc7/thumb.png",
    "swaps": [
      {
        "strategy": "fiat",
        "direction": "sell",
        "in": "BTC",
        "out": "TOKENLY",
        "cost": "5",
        "divisible": false,
        "min_out": "2",
        "type": "buy",
        "fiat": "USD",
        "source": "bitcoinAverage"
      }
    ],
    "balances": {
      "BTC": 0.06300014,
      "TOKENLY": 1672.98906687
    },
    "address": "1YxC7GN6NipW12XLPuCFcTFfkMKYAu1Lb"
  }
]

Fetches all information about a bot by its id.

HTTP Request

GET https://swapbot.tokenly.com/api/v1/public/bots{?parameters}

URL Query Parameters

Parameter Description
name Filter by partial bot name match.
description Filter by partial bot description match.
username Filter by partial username match.
inToken Filter by exact inToken match.
outToken Filter by exact outToken match.
state Filter by bot state (brandnew, lowfuel, active, inactive, unpaid).
sort Sort the bot by a field. Allowed sort fields are name and created_at.

Public Swap Information

Swaps by Bot ID

<?php
$bot_id = '8baabb48-8250-4184-8342-e540244bda5b';
$swaps_data = $api->getSwapsByBotId($bot_id);
BOT_ID="8baabb48-8250-4184-8342-e540244bda5b"
curl -X GET https://swapbot.tokenly.com/api/v1/public/swaps/$BOT_ID
<!-- There is no HTML example for this API endpoint -->

The above command returns data structured like the following. Note that there may be more data returned than listed below.

[
    {
        "completedAt": "2016-04-10T18:20:23+0000",
        "createdAt": "2016-04-10T18:00:25+0000",
        "id": "aa57ec51-d7e3-4588-a13c-50fd12dd2d1d",
        "receipt": {
            "assetIn": "XCP",
            "assetOut": "TOKENLY",
            "changeOut": 0,
            "completedAt": 1460312420,
            "confirmations": 2,
            "confirmationsOut": 1,
            "conversionRate": 1.6616331972,
            "destination": "12DmtEzT9ssUfzwEAShR1qveRQc5gnfxGe",
            "quantityIn": 7.53422725,
            "quantityOut": 2,
            "timestamp": 1460312420,
            "txidIn": "44072a2a3c92cc88ce918a2ae3903abe1b6aa9fb417215a6cf822d75b0accf1c",
            "txidOut": "4e6609b8a8f014469364d14a68e78169d1b9c10fa8162b13dadfb84c5102573f",
            "type": "swap"
        },
        "state": "complete",
        "txid": "44072a2a3c92cc88ce918a2ae3903abe1b6aa9fb417215a6cf822d75b0accf1c",
        "updatedAt": "2016-04-10T18:23:58+0000"
    }
]

Fetches all of the swaps for the given bot. The swaps may be in progress or complete.

HTTP Request

GET https://swapbot.tokenly.com/api/v1/public/swaps/{botId}

URL Parameters

Parameter Description
botId The bot identifier.

Search Available Swaps

<?php
$swaps_data = $api->getAvailableSwaps();
curl -X GET "http://swapbot.tokenly.com/api/v1/public/availableswaps?outToken=TOKENLY&sort=cost"
<!-- There is no HTML example for this API endpoint -->

The above command returns data structured like the following. Note that there may be more data returned than listed below.

[
    {
        "swap": {
            "cost": 3.6856237517155,
            "divisible": false,
            "fiat": "USD",
            "in": "XCP",
            "min": "1",
            "out": "TOKENLY",
            "rate": 0.27132449413333
        },
        "bot": {
            "id": "8baabb48-8250-4184-8342-e540244bda5b",
            "name": "The Official TOKENLY 'bot",
            "address": "1YxC7GN6NipW12XLPuCFcTFfkMKYAu1Lb",
            "descriptionHtml": "<p>This bot sells <strong>TOKENLY</strong>, a digital gift certificate token...\n",
            "botUrl": "https://swapbot.tokenly.com/bot/adam/the-official-tokenly-bot",
            "logoImage": "https://s3.amazonaws.com/tokenly-swapbot/images/d6c9594065c361575afab0229d49015e6872793ebf870875f89aa0b0b86dbfc7/thumb.png",
            "robohashImage": "https://robohash.tokenly.com/0e28460cb598d6d9235554e89734fd3c4c620833e7c6c90d84ca120890bb813d.png?set=set3",
            "backgroundImage": "https://s3.amazonaws.com/tokenly-swapbot/images/5b78c3721cdedaa466cb2fe41aeab8ae67364b786e3c74967fe0959312d54e4f/full.jpg",
            "username": "adam"
        }
    }
]

Fetches available swaps for all active Swapbots. The details of the swap are returned in the swap object and details of the bot providing the swap are listed for convenience in the bot object.

Note that the same bot may be returned multiple times since it may offer multiple swaps that match the search criteria.

HTTP Request

GET https://swapbot.tokenly.com/api/v1/public/availableswaps{?parameters}

URL Query Parameters

Parameter Description
inToken Filter by exact inToken match.
outToken Filter by exact outToken match.
sort Sorts the swaps by a field. Allowed sort fields are inToken, outToken and cost.

Public Bot Events

All Events by bot ID

<?php
$bot_id = '8baabb48-8250-4184-8342-e540244bda5b';
$bot_data = $api->getAllBotEvents($bot_id);
BOT_ID="8baabb48-8250-4184-8342-e540244bda5b"
curl -X GET https://swapbot.tokenly.com/api/v1/public/botevents/$BOT_ID
<!-- There is no HTML example for this API endpoint -->

The above command returns data structured like the following. Note that there may be more data returned than listed below.

[
    {
        "createdAt": "2016-04-10T18:20:07+0000",
        "event": {
            "name": "swap.stateChange",
            "state": "confirming"
        },
        "id": "27d0ea71-fabd-4cfb-a2c5-c00b9ade70b9",
        "level": 100,
        "message": "Entered state confirming",
        "serial": 1460312407689,
        "swapUuid": "aa57ec51-d7e3-4588-a13c-50fd12dd2d1d"
    },
    {
        "createdAt": "2016-04-10T18:20:07+0000",
        "event": {
            "assetIn": "XCP",
            "assetOut": "TOKENLY",
            "changeOut": 0,
            "changeOutAsset": "BTC",
            "confirmations": 1,
            "destination": "12DmtEzT9ssUfzwEAShR1qveRQc5gnfxGe",
            "isComplete": false,
            "isError": false,
            "name": "swap.confirming",
            "quantityIn": 7.53422725,
            "quantityOut": 2,
            "state": "confirming",
            "txidIn": "44072a2a3c92cc88ce918a2ae3903abe1b6aa9fb417215a6cf822d75b0accf1c"
        },
        "id": "64b6f8f3-7dd9-4b30-b62b-31bd0d312916",
        "level": 200,
        "message": "Received 7.53422725 XCP  from 12DmtEzT9ssUfzwEAShR1qveRQc5gnfxGe with 1 confirmation.",
        "serial": 1460312407670,
        "swapUuid": "aa57ec51-d7e3-4588-a13c-50fd12dd2d1d"
    }
]

Returns a list of all bot events. This is the firehose of all events for this bot. This is useful for loading recent activity about a bot. Newer events are returned first.

For real time updates of events, see the Websocket section.

HTTP Request

GET https://swapbot.tokenly.com/api/v1/public/botevents/{botId}

URL Parameters

Parameter Description
botId The bot identifier.

Bot Events by Bot ID

<?php
$bot_id = '8baabb48-8250-4184-8342-e540244bda5b';
$bot_data = $api->getBotEventStream($bot_id);
BOT_ID="8baabb48-8250-4184-8342-e540244bda5b"
curl -X GET https://swapbot.tokenly.com/api/v1/public/boteventstream/$BOT_ID
<!-- There is no HTML example for this API endpoint -->

The above command returns data structured like the following. Note that there may be more data returned than listed below.

[
  {
      "createdAt": "2015-07-29T01:08:16+0000",
      "event": {
          "assetOut": "BTC",
          "destination": "14ap1ewpdBPQZSZAcAtvy6nWyJCZ75ubHQ",
          "isActive": true,
          "name": "income.forwarded",
          "quantityOut": 0.09,
          "state": "active",
          "txid": "e03dc38d0598607d1fb7214ce37d6933f6b6098f55b23e1d504f5287f8ce9946"
      },
      "id": "1bca2e06-e85b-47a0-81a8-3118d01466f3",
      "level": 200,
      "message": "Sent an income forwarding payment of 0.09 BTC to 14ap1ewpdBPQZSZAcAtvy6nWyJCZ75ubHQ with transaction ID e03dc38d0598607d1fb7214ce37d6933f6b6098f55b23e1d504f5287f8ce9946.",
      "serial": 1438132096384
  },
  {
      "createdAt": "2015-07-29T11:31:15+0000",
      "event": {
          "assetOut": "BTC",
          "confirmations": 1,
          "destination": "14ap1ewpdBPQZSZAcAtvy6nWyJCZ75ubHQ",
          "isActive": true,
          "name": "income.forwardSent",
          "quantityOut": 0.09,
          "state": "active",
          "txid": "e03dc38d0598607d1fb7214ce37d6933f6b6098f55b23e1d504f5287f8ce9946"
      },
      "id": "56428ec5-383f-4fb7-847d-977137a6ac65",
      "level": 100,
      "message": "Income of 0.09 BTC was forwarded to 14ap1ewpdBPQZSZAcAtvy6nWyJCZ75ubHQ with 1 confirmation.",
      "serial": 1438169475505
  }
]

Returns a list of ‘Bostream’ events for this bot. Botstream events are events related to the configuration and lifecycle of the Swapbot. Older events are returned first.

Despite its name, this is not a websocket endpoint. For real time updates of events, see the Websocket section.

HTTP Request

GET https://swapbot.tokenly.com/api/v1/public/botevents/{botId}

URL Parameters

Parameter Description
botId The bot identifier.

Public Swap Events

Swap Events by Bot ID

<?php
$bot_id = '8baabb48-8250-4184-8342-e540244bda5b';
$swap_data = $api->getSwapEvents($bot_id);
BOT_ID="8baabb48-8250-4184-8342-e540244bda5b"
curl -X GET https://swapbot.tokenly.com/api/v1/public/swapevents/$BOT_ID
<!-- There is no HTML example for this API endpoint -->

The above command returns data structured like the following. Note that there may be more data returned than listed below.

[
    {
        "createdAt": "2016-04-09T10:10:41+0000",
        "event": {
            "assetIn": "BTC",
            "assetOut": "TOKENLY",
            "changeOut": 5.695e-05,
            "changeOutAsset": "BTC",
            "completedAt": 1460193013,
            "confirmations": 2,
            "confirmationsOut": 6,
            "destination": "1Na5Z6ZsKrD6TyhGZNRxsK75caiWqpwTCK",
            "isComplete": true,
            "isError": false,
            "name": "send.confirmed",
            "quantityIn": 0.0358522,
            "quantityOut": 3,
            "state": "complete",
            "txidIn": "9a2f970fcc4fc3ab2589d3f2cb51c05395cd44f516dccc0d362597b5921828b3",
            "txidOut": "5797cccee227cfbba1418dfcd78bdda2bd96a8f7ee9359fbd019a8ff710d724c",
            "type": "swap"
        },
        "id": "0399775b-57f8-470b-a008-bd8410203210",
        "level": 200,
        "message": "Sent 3 TOKENLY and 5695 satoshis (0.00005695) BTC in change to 1Na5Z6ZsKrD6TyhGZNRxsK75caiWqpwTCK with 6 confirmations.",
        "serial": 1460196641136,
        "swapUuid": "6a1df577-5c93-4faf-a393-72a8784191a6"
    },
    {
        "createdAt": "2016-04-10T18:48:49+0000",
        "event": {
            "assetIn": "XCP",
            "assetOut": "TOKENLY",
            "changeOut": 0,
            "changeOutAsset": "BTC",
            "completedAt": 1460312420,
            "confirmations": 2,
            "confirmationsOut": 6,
            "destination": "12DmtEzT9ssUfzwEAShR1qveRQc5gnfxGe",
            "isComplete": true,
            "isError": false,
            "name": "send.confirmed",
            "quantityIn": 7.53422725,
            "quantityOut": 2,
            "state": "complete",
            "txidIn": "44072a2a3c92cc88ce918a2ae3903abe1b6aa9fb417215a6cf822d75b0accf1c",
            "txidOut": "4e6609b8a8f014469364d14a68e78169d1b9c10fa8162b13dadfb84c5102573f",
            "type": "swap"
        },
        "id": "017bfb75-02d2-4522-a1c7-35bff7bd5681",
        "level": 200,
        "message": "Sent 2 TOKENLY to 12DmtEzT9ssUfzwEAShR1qveRQc5gnfxGe with 6 confirmations.",
        "serial": 1460314129707,
        "swapUuid": "aa57ec51-d7e3-4588-a13c-50fd12dd2d1d"
    }
]

Returns a list of swap events for the given bot. This is a filtered list of swap events related to the bot. For each swap, only the latest swap event is returned unless specified otherwise. Older events are returned first.

For real time updates of events, see the Websocket section.

HTTP Request

GET https://swapbot.tokenly.com/api/v1/public/swapevents/{botId}[?allevents=1]

URL Parameters

Parameter Description
botId The bot identifier

URL Query Parameters

Parameter Description
allevents If this is set, then all swap events are returned. The default is to return only the latest swap event for each swap.

Websocket Events

The websockets return a realtime feed of all bot events.

All websocket communications use the Faye protocol.

All Bot Events Websocket

<?php # see the html example
# see the html example
<head><title>Bot Events Example</title></head>
<body>
    <pre id="Events"></pre>
    <script src="https://pusher.tokenly.com/public/client.js"></script>
    <script>
        var BOT_ID = '8baabb48-8250-4184-8342-e540244bda5b';
        var client = new window.Faye.Client("https://pusher.tokenly.com/public");
        var el = document.getElementById('Events');
        var sep = "\n--------------------------------\n";
        client.subscribe("/swapbot_events_"+BOT_ID, function (data) {
            el.innerHTML = el.innerHTML + (new Date()) + ": " + window.JSON.stringify(data) + sep;
        });
        el.innerHTML = el.innerHTML + (new Date()) + ": BEGIN " + sep;
    </script>
</body>

The websocket returns events that look like this:

{
    "createdAt": "2016-04-10T18:20:07+0000",
    "event": {
        "assetIn": "XCP",
        "assetOut": "TOKENLY",
        "changeOut": 0,
        "changeOutAsset": "BTC",
        "confirmations": 1,
        "destination": "12DmtEzT9ssUfzwEAShR1qveRQc5gnfxGe",
        "isComplete": false,
        "isError": false,
        "name": "swap.confirming",
        "quantityIn": 7.53422725,
        "quantityOut": 2,
        "state": "confirming",
        "txidIn": "44072a2a3c92cc88ce918a2ae3903abe1b6aa9fb417215a6cf822d75b0accf1c"
    },
    "id": "64b6f8f3-7dd9-4b30-b62b-31bd0d312916",
    "level": 200,
    "message": "Received 7.53422725 XCP  from 12DmtEzT9ssUfzwEAShR1qveRQc5gnfxGe with 1 confirmation.",
    "serial": 1460312407670,
    "swapUuid": "aa57ec51-d7e3-4588-a13c-50fd12dd2d1d"
}

Returns a realtime feed of all bot events via a websocket connection. This is the firehose of all events for this bot.

Websocket Client Library

https://pusher.tokenly.com/public/client.js

Channel Name

/swapbot_events_{botId}

Botstream Events Websocket

<head><title>Botstream Events Example</title></head>
<body>
    <pre id="Events"></pre>
    <script src="https://pusher.tokenly.com/public/client.js"></script>
    <script>
        var BOT_ID = '8baabb48-8250-4184-8342-e540244bda5b';
        var client = new window.Faye.Client("https://pusher.tokenly.com/public");
        var el = document.getElementById('Events');
        var sep = "\n--------------------------------\n";
        client.subscribe("/swapbot_botstream_"+BOT_ID, function (data) {
            el.innerHTML = el.innerHTML + (new Date()) + ": " + window.JSON.stringify(data) + sep;
        });
        el.innerHTML = el.innerHTML + (new Date()) + ": BEGIN " + sep;
    </script>
</body>

The websocket returns events that look like this:

{
    "createdAt": "2016-04-06T15:30:19+0000",
    "event": {
        "assetOut": "BTC",
        "destination": "14ap1ewpdBPQZSZAcAtvy6nWyJCZ75ubHQ",
        "isActive": true,
        "name": "income.forwarded",
        "quantityOut": 0.09,
        "state": "active",
        "txid": "d4184befa330e6c793a04f3ce08b9c56e343eb4df86d5fce7f05a28616de8334"
    },
    "id": "1d21a3b9-db68-4cb8-ac88-031d2df2d61f",
    "level": 200,
    "message": "Sent an income forwarding payment of 0.09 BTC to 14ap1ewpdBPQZSZAcAtvy6nWyJCZ75ubHQ with transaction ID d4184befa330e6c793a04f3ce08b9c56e343eb4df86d5fce7f05a28616de8334.",
    "serial": 1459956619843
}

Returns a realtime feed of botstream events via a websocket connection. Botstream events are events related to the configuration and lifecycle of the Swapbot.

Websocket Client Library

https://pusher.tokenly.com/public/client.js

Channel Name

/swapbot_botstream_{botId}

Swapstream Events Websocket

<head><title>Swapstream Events Example</title></head>
<body>
    <pre id="Events"></pre>
    <script src="https://pusher.tokenly.com/public/client.js"></script>
    <script>
        var BOT_ID = '8baabb48-8250-4184-8342-e540244bda5b';
        var client = new window.Faye.Client("https://pusher.tokenly.com/public");
        var el = document.getElementById('Events');
        var sep = "\n--------------------------------\n";
        client.subscribe("/swapbot_swapstream_"+BOT_ID, function (data) {
            el.innerHTML = el.innerHTML + (new Date()) + ": " + window.JSON.stringify(data) + sep;
        });
        el.innerHTML = el.innerHTML + (new Date()) + ": BEGIN " + sep;
    </script>
</body>

The websocket returns events that look like this:

{
    "createdAt": "2016-04-10T18:20:23+0000",
    "event": {
        "assetIn": "XCP",
        "assetOut": "TOKENLY",
        "changeOut": 0,
        "changeOutAsset": "BTC",
        "completedAt": 1460312420,
        "confirmations": 2,
        "confirmationsOut": 0,
        "destination": "12DmtEzT9ssUfzwEAShR1qveRQc5gnfxGe",
        "isComplete": false,
        "isError": false,
        "name": "swap.sent",
        "quantityIn": 7.53422725,
        "quantityOut": 2,
        "state": "sent",
        "txidIn": "44072a2a3c92cc88ce918a2ae3903abe1b6aa9fb417215a6cf822d75b0accf1c",
        "txidOut": "4e6609b8a8f014469364d14a68e78169d1b9c10fa8162b13dadfb84c5102573f",
        "type": "swap"
    },
    "id": "9ef23465-4c43-4b0a-a654-063eb0355179",
    "level": 200,
    "message": "Sent 2 TOKENLY to 12DmtEzT9ssUfzwEAShR1qveRQc5gnfxGe.",
    "serial": 1460312423994,
    "swapUuid": "aa57ec51-d7e3-4588-a13c-50fd12dd2d1d"
}

Returns a realtime feed of swapstream events via a websocket connection. Swapstream events are events related to swap events happening on the Swapbot.

Websocket Client Library

https://pusher.tokenly.com/public/client.js

Channel Name

/swapbot_swapstream_{botId}

Errors

The Swapbot API uses the following error codes:

Error Code Name Meaning
403 Forbidden The credentials are wrong or missing
404 Not Found The resource is not found
405 Method Not Allowed You tried to access an endpoint with an invalid method
410 Gone The requested resource is no longer present
429 Too Many Requests Too Many Requests
500 Internal Server Error We had a problem with our server. Try again later.
503 Service Unavailable We’re temporarially offline for maintenance. Please try again later.