Adara Exchange Platform API (v1)

Download OpenAPI specification:Download

Fetching Data

All REST endpoints are documented below. Most endpoints are accessible via WebSocket. Actions with orders are not support via WebSocket.

WebSocket

To send request via WebSocket one need to:

  1. Connect to api.adara.io. We are using socket.io.
  2. Send frame such this: ["GET/v1/quote", '{}'].
  3. If endpoint support SUB and UNSUB methods, you can request subscription to events of this endpoints: ["SUB/v1/quote", '{}'], ["UNSUB/v1/quote", '{}']

Sending requests with API-keys

To access for authenticated endpoint you should add this headers:

  • X-ADX-APIKEY - your public key
  • X-ADX-EXPIRE - timestamp when request will expire, using to guard against replay attacks
  • X-ADX-SIGNATURE - HMAC SHA512 signature with ${method}${totalParams}expiredAt=${expiredAt} as a value and your secret key as a key

totalParams is a query string for GET and DELETE requests and stringified JSON from body for other requests.

Example to send request

Append payload with expiredAt timestamp and full url:

  • For POST and other requests with body:
      const method = 'POST';
      const payload = {
                          "data":
                              {
                                  "id": "1",
                                  "type": "order",
                                  "attributes": {...},
                                  "relationships": {...}
                              },
                          "included": [...],
                      };
      const payloadWithExpired = `${method}${JSON.stringify(payload)}expiredAt=1543941436186`;
  • For GET and DELETE requests:
      const method = 'GET';
      // full request path is 'http://crm.adara-local.io/v1.0/customer/582c5fa6-18ae-4212-9a52-c6009f354ae4'
      // take 2 last segments of path, start with leading '/'
      const payload = '/customer/582c5fa6-18ae-4212-9a52-c6009f354ae4';
      const payloadWithExpired = '${method}${payload}expiredAt=1543941436186'

Calculate signature:

    const signature = crypto.createHmac('sha512', secretKey).update(payloadWithExpired).digest('base64')

Append HTTP headers to the initial request:

    {
        "X-ADX-EXPIRE": expireAt
        "X-ADX-APIKEY": apiKey
        "X-ADX-SIGNATURE": signature
    }

Send the request. If request signature failed to be verified, server respond with Error:

  • 401 - Not enough sign data (expire or apices missed)
  • 401 - Signature expired, if expire is too old
  • 401 - Signature check failed, if signature calculated on server side doesn't match client side signature
  • 401 - Signature check failed (wrong apiKey hidden error), if apiKey doesn't exist or was revoked/deactivated.

Authentication

ApiKeyAuth

Security scheme type: API Key
Cookie parameter name: token

SignedRequest

Security scheme type: API Key
Header parameter name: X-ADX-APIKEY, X-ADX-SIGNATURE, X-ADX-EXPIRE

orderBook

Get the full order book for specified asset (symbol)

Support SUB and UNSUB methods

query Parameters
filters
required
object
Example:

Filter parameters - symbol and scale.

page
object

Responses

200

Order book content for asset: list of order book records.

400

Unexpected symbol or scale parameter value

404

No Order book for specified symbol

get /orderBook
http://api.adara.io/v1/orderBook

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "data":
    [
    ]
}

marketDepth

Get the full market depth for specified asset (symbol)

In fact, the endpoint completely repeats the endpoint for Order Book. Support SUB and UNSUB methods.

query Parameters
filters
required
object
Example:

Filter parameters - symbol and scale.

page
object

Responses

200

Market depth content for asset: list of market depth records.

400

Unexpected symbol or scale parameter value

404

No Order book for specified symbol

get /marketDepth
http://api.adara.io/v1/marketDepth

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "data":
    [
    ]
}

limits

Get limits

Responses

200

Limits

get /limits
http://api.adara.io/v1/limits

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "data":
    [
    ]
}

quote

Get current values of all currency pair

Support SUB and UNSUB methods

Authorizations:
query Parameters
include
string
Enum: "balance" "chart"
Example: include=balance

Name of related object to include into response. If no include balance, auth is unessesary.

filters
object
Example:

Filters for currency pair

Responses

200

Get current values of all currency pair

401

Unauthorized

403

Forbidden

get /quote/
http://api.adara.io/v1/quote/

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "data":
    [
    ],
  • "included":
    [
    ]
}

Get current values of specific currency pair

Support SUB and UNSUB methods

Authorizations:
path Parameters
id
required
string

Id of quote (equal to symbol name) to be loaded.

query Parameters
filters
object
include
string
Enum: "balance" "chart"
Example: include=balance

Name of related object to include into response. If no include balance, auth is unessesary.

Responses

200

Get current values of all currency pair

401

Unauthorized

403

Forbidden

get /quote/{id}
http://api.adara.io/v1/quote/{id}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "data":
    {
    },
  • "included":
    [
    ]
}

Get current values of all currency pair for selected period

Support SUB and UNSUB methods

query Parameters
filters
object

Responses

200

Get current values of all markets

get /market
http://api.adara.io/v1/market

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "data":
    {
    },
  • "included":
    [
    ]
}

balance

Get total balance

Authorizations:
query Parameters
filters
object

If default is true, return total balance only in default currency

Responses

200

Balance

401

Unauthorized

403

Forbidden

get /balance
http://api.adara.io/v1/balance

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "data":
    [
    ],
  • "included":
    [
    ]
}

currencyBalance

Get total currency balance

Support SUB and UNSUB methods

Authorizations:
query Parameters
filters
object

Responses

200

CurrencyBalance

401

Unauthorized

403

Forbidden

get /currencyBalance
http://api.adara.io/v1/currencyBalance

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "data":
    [
    ],
  • "included":
    [
    ]
}

trades

Get last trades

Support SUB and UNSUB methods. If filter is not specified, default symbol is used.

query Parameters
page
object
filters
object

Responses

200

Return last trades

get /trade
http://api.adara.io/v1/trade

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "data":
    [