Introduction
This document represents an ideal exchange API.
Endpoints marked with *** represent MVP required endpoints
Parameter/Result filed names are open to change.
Endpoint urls are open to change.
Some result fields might not be absolutely required.
Authentication
This is an example of a reasonable authentication pattern. Other authentication schemes may be substituted without issue.
API Key Authentication
Python example code of Daxxr's API Key requirements
import hashlib
import hmac
import requests
import time
def make_headers(apikey, apisecret):
nonce = str(round(time.time() * 1000))
algo = hmac.new(apisecret.encode('utf-8'), digestmod = hashlib.sha256)
algo.update(nonce.encode('utf-8'))
algo.update(apikey.encode('utf-8'))
return {
"X-Auth-Apikey": apikey,
"X-Auth-Nonce": nonce,
"X-Auth-Signature": algo.hexdigest()
}
response = requests.get(url, headers=make_headers(apikey, apisecret))
Requests under the path https://daxxr.tokamaktech.net/api/v2/xt require API Key authentication
| Key | Value | Description |
|---|---|---|
| X-Auth-Apikey | API Key | Your public API key from the Daxxr exchange |
| X-Auth-Nonce | integer timestamp | This value should be the integer number of milliseconds since the UNIX Epoc (ie. UNIX time with milliseconds * 1000) |
| X-Auth-Signature | Request signature | This signature is the 256 HMAC of the concatenation of the bytes of {nonce, apikey} using the API Secret key to sign |
Result
An example result
{
"side": "buy",
"token": "Hp2umpVKBy9xxAVAUXYOLKXR46pVKp1kzjzomPu~8PtnMzMBU_MNGrNS0woAAAA-"
}
Each HTTP request to the API will return either a JSON array or object.
Data Types
Timestamp
Example JSON response with two time values
{
"time" : "2018-11-15T19:41:46",
"last_updated" : "2018-11-15T18:32:25.125"
}
All Time values returned in API responses are represented as ISO 8601 strings representing time in the UTC time zone.
Errors
Example response when an error has been encountered:
{
"errors": [
"authz.client_session_mismatch"
]
}
When an error is returned, the result will contain an "errors" key with a list of error codes. The HTTP status will be set to a non-200 result.
Account Endpoints
*** Get All Balances
Example 1: Get all account balances
GET https://daxxr.tokamaktech.net/api/v2/xt/account/balances
curl -X GET -G \
'https://daxxr.tokamaktech.net/api/v2/xt/account/balances'
JSONResponse
[
{
"currency": "btc",
"totalBalance": "10.0",
"availableBalance": "9.4"
},
{
"currency": "ltc",
"totalBalance": "1.0",
"availableBalance": "0.0"
}
]
Endpoint Description
Get all currency balances
https://daxxr.tokamaktech.net/api/v2/xt/account/balances
Method: GET
Query Parameters
-
nonzero Optional
Only return non-zero balances
Valid Values: boolean
Response Codes
-
200Success
-
401Invalid Authentication
Results
-
currency
stringthe currency name -
availableBalance
stringthe available balance. Ie. the balance that is not locked. -
totalBalance
stringThe total balance including any locked balances.
Get Account Balances by Currency
Example 1: Get all account balances by currency
GET https://daxxr.tokamaktech.net/api/v2/xt/account/balances/{currency}
curl -X GET -G \
'https://daxxr.tokamaktech.net/api/v2/xt/account/balances/{currency}'
JSONResponse
{
"currency": "btc",
"totalBalance": "10.0",
"availableBalance": "0.0"
}
Endpoint Description
Get Account Balances by Currency
https://daxxr.tokamaktech.net/api/v2/xt/account/balances/{currency}
Method: GET
-
currency Required
Currency code
Type: string
Example Value:btc
Response Codes
-
200Success
-
401Invalid Authentication
-
404Unknown currency provided
Results
-
currency
stringthe currency name -
totalBalance
stringthe available balance. Ie. the balance that is not locked. -
availableBalance
stringThe total balance including any locked balances.
Get Beneficiaries
Example 1: Get all account beneficiaries
GET https://daxxr.tokamaktech.net/api/v2/xt/account/beneficiaries
curl -X GET -G \
'https://daxxr.tokamaktech.net/api/v2/xt/account/beneficiaries'
JSONResponse
[
{
"id": 255,
"currency": "eth",
"name": "John Doe",
"description": "John Doe",
"data": {
"address": "0x00eec1e95026faf0412d7a29b94d514d31446141"
},
"state": "active"
}
]
Endpoint Description
Get Whitelisted withdrawal addresses for this account.
https://daxxr.tokamaktech.net/api/v2/xt/account/beneficiaries
Method: GET
Query Parameters
-
currency Optional
Currency code
Valid Values: string
-
state Optional
Filter beneficiary state
Valid Values:- pending
- active
- inactive
Response Codes
-
200Success
-
400Invalid state
-
401Invalid Authentication
-
404Unknown currency
Results
-
id
integerthe exchange id of this beneficiary -
currency
stringthe currency related to this beneficiary -
name
stringthe user supplied name for this beneficiary when the beneficiary was created -
description
stringthe user description supplied when the beneficiary was created -
data
stringa json dictionary of the required details of this withdrawal address. This may be just the address, or might consist of more information (address and tag, bank details, etc.) depending on the currency type. -
state
stringThe state of this beneficiary. Pending, active or inactive
Get Beneficiary by ID
Example 1: Get Account Beneficiaries by Id
GET https://daxxr.tokamaktech.net/api/v2/xt/account/beneficiaries/{id}
curl -X GET -G \
'https://daxxr.tokamaktech.net/api/v2/xt/account/beneficiaries/{id}'
JSONResponse
{
"id": 255,
"currency": "eth",
"name": "John Doe",
"description": "John Doe",
"data": {
"address": "0x00eec1e95026faf0412d7a29b94d514d31446141"
},
"state": "active"
}
Endpoint Description
Get details about an account withdrawal whitelisted address by ID.
https://daxxr.tokamaktech.net/api/v2/xt/account/beneficiaries/{id}
Method: GET
-
id Required
Beneficiary ID
Type: integer
Example Value:129
Response Codes
-
200Success
-
401Invalid Authentication
-
404id not found
Results
-
id
integerthe exchange id of this beneficiary -
currency
stringthe currency related to this beneficiary -
name
stringthe user supplied name for this beneficiary when the beneficiary was created -
description
stringthe user description supplied when the beneficiary was created -
data
stringa json dictionary of the required details of this withdrawal address. This may be just the address, or might consist of more information (address and tag, bank details, etc.) depending on the currency type. -
state
stringThe state of this beneficiary. Pending, active or inactive
*** Get Currency Deposit Address
Example 1: Get account deposit address by currency
GET https://daxxr.tokamaktech.net/api/v2/xt/account/deposit_address/{currency}
curl -X GET -G \
'https://daxxr.tokamaktech.net/api/v2/xt/account/deposit_address/{currency}'
JSONResponse
{
"currency": "eth",
"address": "0xf0d1e00d046b752c4d0f0a523b3bdb9807a627d0"
}
Endpoint Description
Get Account Deposit Address by currency
https://daxxr.tokamaktech.net/api/v2/xt/account/deposit_address/{currency}
Method: GET
-
currency Required
Currency code
Type: string
Example Value:btc
Query Parameters
Response Codes
-
200Success
-
401Invalid Authentication
-
404currency not found
Results
-
currency
string -
address
string
Get Deposits
Example 1: Get all account deposits
GET https://daxxr.tokamaktech.net/api/v2/xt/account/deposits
curl -X GET -G \
'https://daxxr.tokamaktech.net/api/v2/xt/account/deposits'
JSONResponse
[
{
"id": 200,
"currency": "eth",
"amount": "5.0",
"fee": "0.0",
"txid": "0x785c5164e15bd6068a30f483ead38da20dce7e9a46dadb358a6213ee36c14b4a",
"confirmations": 6045,
"state": "collected",
"created_at": "2020-06-24T20:12:07+02:00",
"completed_at": "2020-06-24T20:12:07+02:00",
"tid": "TIDE024205823"
}
]
Endpoint Description
List Account Deposits
https://daxxr.tokamaktech.net/api/v2/xt/account/deposits/
Method: GET
Query Parameters
-
currency Optional
Currency code
Valid Values: string
-
state Optional
Filter deposits by state
Valid Values: string
-
txid Optional
Filter deposits by txid
Valid Values: string
-
limit Optional
Limit number of deposits returned
Valid Values: integer
Default Value:100 -
page Optional
Page number
Valid Values: integer
Default Value:1 -
time_from Optional
Integer represents seconds elapsed since Unix epoch. Only orders created after the time will be returned
Valid Values: string
-
time_to Optional
Integer represents seconds elapsed since Unix epoch. Only orders created until the time will be returned
Valid Values: string
Response Codes
-
200Success
-
400invalid parameters
-
401Invalid Authentication
Results
-
id
integer -
currency
string -
amount
integer -
fee
integer -
txid
string -
confirmation
integer -
state
string -
created_at
Timestamp -
updated_at
Timestamp -
completed_at
Timestamp -
tid
string
Get Withdraws
Example 1: Get account withdraws
GET https://daxxr.tokamaktech.net/api/v2/xt/account/withdraws
curl -X GET -G \
'https://daxxr.tokamaktech.net/api/v2/xt/account/withdraws'
JSONResponse
[
{
"id": 6,
"currency": "dash",
"type": "coin",
"amount": "20.0",
"fee": "0.00000001",
"blockchain_txid": null,
"rid": "XcibYuVegnxL5rzc7AdypfmAeC38McZFd5",
"state": "accepted",
"confirmations": 0,
"note": null,
"created_at": "2020-08-04T20:05:33+02:00",
"updated_at": "2020-08-04T20:06:03+02:00",
"done_at": null
}
]
Endpoint Description
List Account Withdraws
https://daxxr.tokamaktech.net/api/v2/xt/account/withdraws
Method: GET
Query Parameters
-
currency Optional
Currency code
Valid Values: string
-
limit Optional
Number of withdraws per page
Valid Values: integer
Default Value:100 -
state Optional
Filter withdraws by state
Valid Values: string
-
rid Optional
Wallet address on Blockchain
Valid Values: string
-
page Optional
Page number
Valid Values: integer
Default Value:1 -
time_from Optional
Integer represents seconds elapsed since Unix epoch
Valid Values: integer
-
time_to Optional
Integer represents seconds elapsed since Unix epoch
Valid Values: integer
Response Codes
-
200Success
-
400Invalid parameters
-
401Invalid Authentication
Results
-
id
integer -
currency
string -
type
string -
amount
string -
fee
string -
blockchain_txid
string -
rid
string -
state
string -
confirmations
integer -
note
string -
created_at
string -
updated_at
string -
done_at
string
Create Withdrawal
Example 1: Create new withdraw
GET https://daxxr.tokamaktech.net/api/v2/xt/account/withdraws
curl -X GET -G \
'https://daxxr.tokamaktech.net/api/v2/xt/account/withdraws'
JSONResponse
{
"id":189,
"currency":"eth",
"type":"coin",
"amount":"5.0",
"fee":"0.01",
"blockchain_txid":null,
"rid":"0x5bFB170bcCCFAf0035ecEEdb97E9B5C99D0073e3",
"state":"accepted",
"confirmations":0,
"note":null,
"created_at":"2021-10-01T18:32:20+02:00",
"updated_at":"2021-10-01T18:32:52+02:00",
"done_at":null
}
Endpoint Description
Create a new withdraw
https://daxxr.tokamaktech.net/api/v2/xt/account/withdraws
Method: POST
Query Parameters
-
otp Required
OTP code
Valid Values: integer
-
beneficiary_id Required
ID of Active Beneficiary belonging to user
Valid Values: integer
-
currency Required
Currency code
Valid Values: string
-
amount Required
Amount to withdraw
Valid Values: float
-
note Optional
Optional metadata to append to transaction
Valid Values: string
Response Codes
-
200Success
-
401Invalid Authentication
-
400invalid parameters
Results
-
id
integer -
currency
string -
type
string -
amount
string -
fee
string -
blockchain_txid
string -
rid
string -
state
string -
confirmations
integer -
note
string -
created_at
string -
updated_at
string -
done_at
string
Market Endpoints
*** Get Account Orders by Id
Endpoint Description
Get details of one order
https://daxxr.tokamaktech.net/api/v2/xt/market/order
Method: GET
Restrictions: NOTE: At least one of id or clientId must be specified. If both are specified, id takes priority.
Query Parameters
-
id Required
Order Id
Valid Values: integer (> 0)
-
clientId Required
Client Order Id
Valid Values: string
Response Codes
-
200Success
-
401Invalid Authentication
-
404order id or clientId not found
Results
-
id
stringUnique order id. -
side
stringEither 'sell' or 'buy'. -
ord_type
integerType of order, either 'limit' or 'market'. -
price
integerPrice for each unit. e.g.If you want to sell/buy 1 btc at 3000 usd, the price is '3000.0' -
avg_price
integerAverage execution price, average of price in trades. -
state
stringOne of 'wait', 'done', or 'cancel'.An order in 'wait' is an active order, waiting fulfillment;a 'done' order is an order fulfilled;'cancel' means the order has been canceled. -
market
stringThe market in which the order is placed, e.g. 'btcusd'.All available markets can be found at /api/v2/markets. -
created_at
stringOrder create time in iso8601 format. -
updated_at
stringOrder updated time in iso8601 format. -
origin_volume
UNKNOWN floarThe amount user want to sell/buy.An order could be partially executed,e.g. an order sell 5 btc can be matched with a buy 3 btc order,left 2 btc to be sold; in this case the order's volume would be '5.0',its remaining_volume would be '2.0', its executed volume is '3.0'. -
remaining_volume
floatThe remaining volume, see 'volume'. -
executed_volume
floatThe executed volume, see 'volume'. -
trades_count
integerCount of trades. -
trades
arrayTrades with this order
*** Get Account Orders
Example 1: Get your orders, result is paginated.
GET https://daxxr.tokamaktech.net/api/v2/xt/market/orders
curl -X GET -G \
'https://daxxr.tokamaktech.net/api/v2/xt/market/orders'
JSONResponse
[
{
"id": 370,
"uuid": "0b0cac48-624c-461b-8bb1-51adab5fd7d5",
"side": "sell",
"ord_type": "market",
"client_id": null,
"price": null,
"avg_price": "32559.81",
"state": "done",
"market": "btcpax",
"created_at": "2021-07-13T16:33:31+02:00",
"updated_at": "2021-07-13T16:33:31+02:00",
"origin_volume": "0.1",
"remaining_volume": "0.0",
"executed_volume": "0.1",
"trades_count": 2
}
]
Endpoint Description
List your orders, result is paginated.
https://daxxr.tokamaktech.net/api/v2/xt/market/orders
Method: GET
Query Parameters
-
market Optional
The market in which the order is placed, e.g. 'btcusd'.All available markets can be found at /api/v2/markets.
Valid Values: string
-
state Optional
Filter order by state
Valid Values:- wait
- done
- cancel
-
limit Optional
Limit the number of returned orders, default to 100.
Valid Values: integer (> 0)
-
page Optional
Specify the page of paginated results.
Valid Values: integer (> 0)
-
order_by Optional
If set, returned orders will be sorted in specific order, default to 'desc'.
Valid Values: string
-
order_type Optional
Type of order, either 'limit' or 'market'.
Valid Values: string
-
type Optional
Filter order by type.
Valid Values: string
Response Codes
-
200Success
-
400invalid parameters
-
401Invalid Authentication
Results
-
id
stringUnique order id. -
side
stringEither 'sell' or 'buy'. -
ord_type
integerType of order, either 'limit' or 'market'. -
price
integerPrice for each unit. e.g.If you want to sell/buy 1 btc at 3000 usd, the price is '3000.0' -
avg_price
integerAverage execution price, average of price in trades. -
state
stringOne of 'wait', 'done', or 'cancel'.An order in 'wait' is an active order, waiting fulfillment;a 'done' order is an order fulfilled;'cancel' means the order has been canceled. -
market
stringThe market in which the order is placed, e.g. 'btcusd'.All available markets can be found at /api/v2/markets. -
created_at
stringOrder create time in iso8601 format. -
updated_at
stringOrder updated time in iso8601 format. -
origin_volume
floatThe amount user want to sell/buy.An order could be partially executed,e.g. an order sell 5 btc can be matched with a buy 3 btc order,left 2 btc to be sold; in this case the order's volume would be '5.0',its remaining_volume would be '2.0', its executed volume is '3.0'. -
remaining_volume
floatThe remaining volume, see 'volume'. -
executed_volume
floatThe executed volume, see 'volume'. -
trades_count
integerCount of trades. -
trades
arrayTrades with this order
Get My Trades
Example 1: Get your executed trades. Trades are sorted in reverse creation order
GET https://daxxr.tokamaktech.net/api/v2/xt/market/trades?market={market}
curl -X GET -G \
'https://daxxr.tokamaktech.net/api/v2/xt/market/trades?market={market}'
JSONResponse
[
{
"id": 162389,
"price": "0.3",
"amount": "0.01",
"total": "0.003",
"fee_currency": "eth",
"fee": "0.001",
"fee_amount": "0.00007",
"market": "ethbtc",
"created_at": "2018-12-14T12:00:47+01:00",
"taker_type": "sell",
"side": "sell",
"order_id": 152389
}
]
Endpoint Description
Get your executed trades. Trades are sorted in reverse creation order.
https://daxxr.tokamaktech.net/api/v2/xt/market/trades?market={market}
Method: GET
Query Parameters
-
market Optional
The market in which the order is placed, e.g. 'btcusd'.All available markets can be found at /api/v2/markets.
Valid Values: string
-
limit Optional
Limit the number of returned orders, default to 100.
Valid Values: integer (> 0)
Default Value:100 -
page Optional
Specify the page of paginated results.
Valid Values: integer (> 0)
-
time_from Optional
An integer represents the seconds elapsed since Unix epoch.If set, only trades executed after the time will be returned.
Valid Values: integer
-
time_to Optional
An integer represents the seconds elapsed since Unix epoch.If set, only trades executed after the time will be returned.
Valid Values: integer
Response Codes
-
200Success
-
400Invalid parameters
-
401Invalid Authentication
Results
-
id
stringTrade Id -
price
floatTrade price -
amount
floatTrade amount -
total
floatTrade total (Amount * Price). -
fee_currency
floatCurrency user's fees were charged in. -
fee
floatPercentage of fee user was charged for performed trade. -
fee_amount
floatCurrency user's fees were charged in. -
market
stringTrade market id. -
created_at
stringOrder create time in iso8601 format. -
taker_type
stringTrade taker order type (sell or buy). -
side
stringTrade side -
order_id
stringOrder id
*** Create Order
Example 1: Create a Sell/Buy order
POST https://daxxr.tokamaktech.net/api/v2/xt/market/orders
curl -X POST -G \
'https://daxxr.tokamaktech.net/api/v2/xt/market/orders'
JSONResponse
[
{
"id": 37571110,
"uuid": "c920fc34-fbf1-400a-ba19-56c69f397742",
"side": "sell",
"ord_type": "market",
"client_id": null,
"price": null,
"avg_price": "299181.82",
"state": "done",
"market": "btcbrl",
"created_at": "2021-10-07T18:39:58+02:00",
"updated_at": "2021-10-07T18:39:58+02:00",
"origin_volume": "0.05",
"remaining_volume": "0.0",
"executed_volume": "0.05",
"trades_count": 2
}
]
Endpoint Description
Create a new Sell/Buy order.
https://daxxr.tokamaktech.net/api/v2/xt/market/orders
Method: POST
Query Parameters
-
market Optional
The market in which the order is placed, e.g. 'btcusd'.All available markets can be found at /api/v2/markets.
Valid Values: string
-
side Required
Either 'sell' or 'buy'.
Valid Values:- buy
- sell
-
volume Required
The amount user want to sell/buy.An order could be partially executed,e.g. an order sell 5 btc can be matched with a buy 3 btc order,left 2 btc to be sold; in this case the order's volume would be '5.0',its remaining_volume would be '2.0', its executed volume is '3.0'.
Valid Values: float
-
ord_type Optional
Type of order, either 'limit' or 'market'.
Valid Values:- market
- limit
Default Value:limit -
price Required
Price for each unit. e.g.If you want to sell/buy 1 btc at 3000 usd, the price is '3000.0'
Valid Values: float
-
clientId Optional
An client specified ID that can be used to refer to this order. This value must be unique for this user across all orders.
Valid Values: string
Default Value:
Response Codes
-
201Success
-
400invalid parameters, including unavailable balance if possible to check at this point
-
401Invalid Authentication
Results
-
id
stringUnique order id. -
clientId
stringUnique client specified id, or null if no clientId was specified when creating the order -
side
stringEither 'sell' or 'buy'. -
ord_type
integerType of order, either 'limit' or 'market'. -
price
integerPrice for each unit. e.g.If you want to sell/buy 1 btc at 3000 usd, the price is '3000.0' -
avg_price
integerAverage execution price, average of price in trades. -
state
stringOne of 'wait', 'done', or 'cancel'.An order in 'wait' is an active order, waiting fulfillment;a 'done' order is an order fulfilled;'cancel' means the order has been canceled. -
market
stringThe market in which the order is placed, e.g. 'btcusd'.All available markets can be found at /api/v2/markets. -
created_at
stringOrder create time in iso8601 format. -
updated_at
stringOrder updated time in iso8601 format. -
origin_volume
floatThe amount user want to sell/buy.An order could be partially executed,e.g. an order sell 5 btc can be matched with a buy 3 btc order,left 2 btc to be sold; in this case the order's volume would be '5.0',its remaining_volume would be '2.0', its executed volume is '3.0'. -
remaining_volume
floatThe remaining volume, see 'volume'. -
executed_volume
floatThe executed volume, see 'volume'. -
trades_count
integerCount of trades. -
trades
arrayTrades with this order
*** Cancel Market Order
Example 1: Cancel all my orders.
POST https://daxxr.tokamaktech.net/api/v2/xt/market/orders/cancel
curl -X POST -G \
'https://daxxr.tokamaktech.net/api/v2/xt/market/orders/cancel'
JSONResponse
[
{
"id":37571409,
"uuid":"ba1187db-bf48-479e-b531-8b2c5cc2cdaf",
"side":"sell",
"ord_type":"limit",
"client_id":null,
"price":"300000.97",
"avg_price":"0.0",
"state":"wait",
"market":"btcbrl",
"created_at":"2021-10-07T18:44:45+02:00",
"updated_at":"2021-10-07T18:44:48+02:00",
"origin_volume":"0.05",
"remaining_volume":"0.05",
"executed_volume":"0.0",
"trades_count":0
},
{
"id":37571641,
"uuid":"69b0ae47-f687-40da-a9d8-9739e6d4bff6",
"side":"sell",
"ord_type":"limit",
"client_id":null,
"price":"300000.97",
"avg_price":"0.0",
"state":"wait",
"market":"btcbrl",
"created_at":"2021-10-07T18:48:45+02:00",
"updated_at":"2021-10-07T18:52:09+02:00",
"origin_volume":"0.05",
"remaining_volume":"0.05",
"executed_volume":"0.0",
"trades_count":0
}
]
Endpoint Description
Cancel all orders. Optionally only cancel orders from one market and/or of one type (buy/sell).
https://daxxr.tokamaktech.net/api/v2/xt/market/orders/cancel
Method: POST
Query Parameters
-
market Optional
The market in which the order is placed, e.g. 'btcusd'.All available markets can be found at /api/v2/markets.
Valid Values: string
-
side Optional
Either 'sell' or 'buy'. If not provided, both buy and sell orders will be cancelled.
Valid Values:- buy
- sell
Response Codes
-
204Success
-
400invalid parameters
-
401Invalid Authentication
-
404Market not found
Results
*** Cancel An Order
Example 1: Cancel an order.
POST https://daxxr.tokamaktech.net/api/v2/xt/market/orders/{id}/cancel
curl -X POST -G \
'https://daxxr.tokamaktech.net/api/v2/xt/market/orders/{id}/cancel'
JSONResponse
{
"id":37571409,
"uuid":"ba1187db-bf48-479e-b531-8b2c5cc2cdaf",
"side":"sell",
"ord_type":"limit",
"client_id":null,
"price":"300000.97",
"avg_price":"0.0",
"state":"wait",
"market":"btcbrl",
"created_at":"2021-10-07T18:44:45+02:00",
"updated_at":"2021-10-07T18:44:48+02:00",
"origin_volume":"0.05",
"remaining_volume":"0.05",
"executed_volume":"0.0",
"trades_count":0
}
Endpoint Description
Cancel an order.
https://daxxr.tokamaktech.net/api/v2/xt/market/orders/cancel
Method: POST
Restrictions: NOTE: At least one of id or clientId must be specified. If both are specified, id takes priority.
Query Parameters
-
id Required
Order id of the order to cancel
Valid Values: integer (> 0)
-
clientId Required
Client Order Id
Valid Values: string
Response Codes
-
204Success
-
401Invalid Authentication
-
404Order id or clientId not found
Results
Public Endpoints
Get Currencies
Example 1: Get all markets on exchange
GET https://daxxr.tokamaktech.net/api/v2/xt/public/currencies
curl -X GET -G \
'https://daxxr.tokamaktech.net/api/v2/xt/public/currencies'
JSONResponse
[
{
"id": "bkt",
"name": "Blocktanium",
"symbol": "B",
"explorer_transaction": "https://etherscan.io/tx/#{txid}",
"explorer_address": "https://etherscan.io/address/#{address}",
"type": "coin",
"deposit_enabled": true,
"withdrawal_enabled": true,
"deposit_fee": "0.0",
"min_deposit_amount": "0.0",
"withdraw_fee": "20.0",
"min_withdraw_amount": "1.0",
"withdraw_limit_24h": "100000.0",
"withdraw_limit_72h": "5000000.0",
"base_factor": 1000000000000000000,
"precision": 18,
"position": 1,
"icon_url": "https://daxxr.s3.ca-central-1.amazonaws.com/frontend/crypto_icons/color/bkt.svg",
"min_confirmations": 10
},
...
]
Endpoint Description
Get Currencies
https://daxxr.tokamaktech.net/api/v2/xt/public/currencies
Method: GET
Query Parameters
-
limit Optional
Limit the number of returned currencies
Valid Values: integer
Default Value:100 -
page Optional
Specify the page of paginated results
Valid Values: integer
Default Value:1 -
type Optional
Currency type
Valid Values:- coin
- fiat
-
search Optional
Valid Values: json
Default Value: -
search[code] Optional
Search by currency code using LIKE
Valid Values: string
-
search[name] Optional
Search by currency name using LIKE
Valid Values: string
Response Codes
-
200Success
Results
-
id
stringMarket ID -
name
stringMarket Name -
sumbol
stringUnicode currency symbol -
explorer_transaction
string -
explorer_address
string -
type
- coin
- fiat
-
deposit_enabled
boolean -
withdrawal_enabled
boolean -
deposit_fee
string -
min_deposit_amount
string -
withdraw_fee
string -
min_withdraw_amount
string -
withdraw_limit_24h
string -
withdraw_limit_72h
string -
base_factor
string -
precision
integer -
position
integer -
icon_url
string -
min_confirmations
integer
Get Currencies by ID
Example 1: Get all markets on exchange
GET https://daxxr.tokamaktech.net/api/v2/xt/public/markets
curl -X GET -G \
'https://daxxr.tokamaktech.net/api/v2/xt/public/markets'
JSONResponse
{
"id": "bkt",
"name": "Blocktanium",
"symbol": "B",
"explorer_transaction": "https://etherscan.io/tx/#{txid}",
"explorer_address": "https://etherscan.io/address/#{address}",
"type": "coin",
"deposit_enabled": true,
"withdrawal_enabled": true,
"deposit_fee": "0.0",
"min_deposit_amount": "0.0",
"withdraw_fee": "20.0",
"min_withdraw_amount": "1.0",
"withdraw_limit_24h": "100000.0",
"withdraw_limit_72h": "5000000.0",
"base_factor": 1000000000000000000,
"precision": 18,
"position": 1,
"icon_url": "https://daxxr.s3.ca-central-1.amazonaws.com/frontend/crypto_icons/color/bkt.svg",
"min_confirmations": 10
},
Endpoint Description
Get Currencies by ID
https://daxxr.tokamaktech.net/api/v2/xt/public/currencies/{id}
Method: GET
Query Parameters
-
id Required
Currency ID to fetch (see Get Currencies)
Valid Values: integer
Response Codes
-
200Success
Results
-
id
stringMarket ID -
name
stringMarket Name -
sumbol
stringUnicode currency symbol -
explorer_transaction
string -
explorer_address
string -
type
- coin
- fiat
-
deposit_enabled
boolean -
withdrawal_enabled
boolean -
deposit_fee
string -
min_deposit_amount
string -
withdraw_fee
string -
min_withdraw_amount
string -
withdraw_limit_24h
string -
withdraw_limit_72h
string -
base_factor
string -
precision
integer -
position
integer -
icon_url
string -
min_confirmations
integer
*** Get Orderbook Snapshot
Example 1: Get depth for a given market
GET https://daxxr.tokamaktech.net/api/v2/xt/public/markets/{market_id}/depth
curl -X GET -G \
'https://daxxr.tokamaktech.net/api/v2/xt/public/markets/{market_id}/depth'
JSONResponse
{
"timestamp": 1631817663,
"asks": [
[
"0.0312",
"911.1077"
],
[
"0.0319",
"1000.0"
],
],
"bids": [
[
"0.0237",
"8.276"
],
[
"0.0236",
"10.0"
]
]
}
Endpoint Description
Get an orderbook snapshot
https://daxxr.tokamaktech.net/api/v2/xt/public/markets/{market_id}/depth
Method: GET
Query Parameters
-
market_id Required
Market ID to fetch depth for
Valid Values: string
-
limit Optional
Limit the number of returned levels per side
Valid Values: integer
Default Value:100
Response Codes
-
200Success
Results
-
timestamp
Timestamp -
asks
array(integer) -
bids
array(integer)
Get Market Trades
Example 1: Get trades for a given market
GET https://daxxr.tokamaktech.net/api/v2/xt/public/markets/{market_id}/trades
curl -X GET -G \
'https://daxxr.tokamaktech.net/api/v2/xt/public/markets/{market_id}/trades'
JSONResponse
[
{
"id": 180627,
"price": 0.0237,
"amount": 1.724,
"total": 0.0408588,
"market": "bktusdc",
"created_at": 1631801268,
"taker_type": "sell"
},
{
"id": 180626,
"price": 0.0238,
"amount": 5.2104,
"total": 0.12400752,
"market": "bktusdc",
"created_at": 1631801268,
"taker_type": "sell"
},
]
Endpoint Description
Get market trades
https://daxxr.tokamaktech.net/api/v2/xt/public/markets/{market_id}/trades
Method: GET
Query Parameters
-
market_id Required
Market ID to fetch trades for
Valid Values: string
-
limit Optional
Limit the number of returned paginations
Valid Values: integer
Default Value:100 -
timestamp Optional
An integer representing the seconds elapsed since Unix epoch. If set, only trades executed before the time will be returned.
Valid Values: integer
-
order_by Optional
If set, returned trades will be sorted in a specific order
Valid Values:- asc
- desc
Default Value:desc
Response Codes
-
200Success
Results
-
id
integer -
price
integer -
amount
integer -
total
integer -
market
string -
created_at
integer -
taker_type
string
Get All Markets
Example 1: Get all markets on exchange
GET https://daxxr.tokamaktech.net/api/v2/xt/public/markets
curl -X GET -G \
'https://daxxr.tokamaktech.net/api/v2/xt/public/markets'
JSONResponse
[
{
"id": "bktusdt",
"name": "BKT/USDT",
"base_unit": "bkt",
"quote_unit": "usdt",
"min_price": "0.0001",
"max_price": "1000000.0",
"min_amount": "0.001",
"amount_precision": 4,
"price_precision": 4,
"state": "enabled"
},
...
]
Endpoint Description
Get Markets
https://daxxr.tokamaktech.net/api/v2/xt/public/markets
Method: GET
Query Parameters
-
limit Optional
Limit the number of returned paginations
Valid Values: integer
Default Value:100 -
page Optional
Specify the page of paginated results
Valid Values: integer
Default Value:1 -
ordering Optional
If set, returned values will be sorted in the specified order
Valid Values:- asc
- desc
Default Value:asc -
order_by Optional
Field name to order by
Valid Values:- id
- position
Default Value:position -
base_unit Optional
Strict filter for base unit
Valid Values: string
-
quote_unit Optional
Strict filter for quote unit
Valid Values: string
-
search Optional
Strict filter for quote unit
Valid Values: json
-
search[base_code] Optional
Search base currency code using LIKE
Valid Values: string
-
search[base_name] Optional
Search base currency name using LIKE
Valid Values: string
-
search[quote_code] Optional
Search quote currency code using LIKE
Valid Values: string
-
search[quote_name] Optional
Search quote currency name using LIKE
Valid Values: string
Response Codes
-
200Success
Results
-
id
stringMarket ID -
name
stringMarket Name -
base_unit
string -
quote_unit
string -
min_price
string -
max_price
string -
min_amount
string -
amount_precision
integer -
price_precision
integer -
state
- enabled
- disabled
Get Exchange Server Timestamp
Example 1: Get current server timestamp
GET https://daxxr.tokamaktech.net/api/v2/xt/public/timestamp
curl -X GET -G \
'https://daxxr.tokamaktech.net/api/v2/xt/public/timestamp'
Response
"2021-09-16T18:02:11+00:00"
Endpoint Description
Get exchange server timestamp
https://daxxr.tokamaktech.net/api/v2/xt/public/timestamp
Method: GET
Query Parameters
Response Codes
-
200Success
Results
-
timestamp
TimestampCurrent exchange server time
Websockets
Base URL: wss://daxxr.tokamaktech.net/api/v2/ws
There are two websocket connections available, a public connection that provides access to anyone, and a private connection that is only accessible with user authentication. Each has it’s own base URL and channels.
Base URL for Public Websocket: wss://daxxr.tokamaktech.net/api/v2/ws/public
Base URL for Private Websocket: wss://daxxr.tokamaktech.net/api/v2/ws/private
Subscribing to Channels
There are two options to manage subscriptions to channels.
During connection
During the initial connection process, the URL parameter ?stream=
Example:
wss://daxxr.tokamaktech.net/api/v2/ws/private?stream=balance&stream=orders&stream=trades
After connecting
Once connected, the set of subscribed channels can be controlled by sending the following event messages:
The subscribe event will subscribe you to the list of streams provided:
{"event":"subscribe","streams":["trades","balances"]}
The server response message will confirm the subscription to each channel:
{"success":{"message":"subscribed","streams":["trades","balances"]}}
The unsubscribe event will unsubscribe you to the list of streams provided:
{"event":"unsubscribe","streams":["trades"]}
The server response will confirm that the stream has been unsubscribed from each channel:
{"success":{"message":"unsubscribed","streams":["trades"]}}
Private Socket Authentication
Sample Python code for authenticated websocket requests
class DaxxrAuth:
def __init__(self, api_key: str, secret_key: str):
self.api_key = api_key
self.secret_key = secret_key
def generate_auth_dict(self) -> dict:
"""
Returns headers for authenticated api request.
"""
nonce = self.make_nonce()
signature = self.auth_sig(nonce)
payload = {
"X-Auth-Apikey": self.api_key,
"X-Auth-Nonce": nonce,
"X-Auth-Signature": signature,
"Content-Type": "application/json"
}
return payload
def make_nonce(self) -> str:
return str(round(time.time() * 1000))
def auth_sig(self, nonce: str) -> str:
sig = hmac.new(
self.secret_key.encode('utf8'),
'{}{}'.format(nonce, self.api_key).encode('utf8'),
hashlib.sha256
).hexdigest()
return sig
Socket URL: wss://daxxr.tokamaktech.net/api/v2/ws/private
Authentication requires that the following headers be added to private websocket connection requests:
X-Auth-Apikey: <api_key>
X-Auth-Nonce: <nonce>
X-Auth-Signature: <signature>
Where
api_key is the user’s public API key
nonce is the current number of milliseconds from the UNIX epoch
signature is the result of applying HMAC-SHA256 to a utf8 encoded string of the concatenation of
Public: Trades
Example Trades message
{
"btcusdc.trades": {
"trades": [
{
"amount": "0.00913571",
"date": 1612988512,
"price": "243484.36",
"taker_type": "sell",
"tid": 13914
}
]
}
}
Base URL: wss://daxxr.tokamaktech.net/api/v2/ws/public
name: <market>.trades
example subscription: {"event":"subscribe","streams":["btcusdc.trades"]}
Each
amount
The amount of base traded
date
The UNIX timestamp of the trade
price
The price of the trade
taker_type
The side of the taker order
tid
The exchange id of this trade
Public: *** Orderbook
// Example snap message
{
"btcusdc.orderbook": {
"type": "snap",
"asks": [
["245563.07", "0.0361"],
["245623.36", "0.021"]
],
"bids": [
["241997.81", "0.0002"],
["241888.34", "0.01046865"]
],
"sequence": 296428
}
}
// Example inc message
{
"btcusdc.orderbook": {
"type": "inc",
"asks": [
["245563.07", ""],
["245624.00", "0.031"]
],
"bids": [
["241997.81", ""],
["241888.34", ""]
],
"sequence": 296429
}
}
Base URL: wss://daxxr.tokamaktech.net/api/v2/ws/public
name: <market>.orderbook
example subscription: {"event":"subscribe","streams":["btcusdc.orderbook"]}
Upon subscribing to the <market>.orderbook channel, a single "snap" message will be sent with the following object structure:
type
"snap"
asks
An array of levels representing the current orderbook’s asks
bids
An array of levels representing the current orderbook’s bids
sequence
A sequence number indicating the ordering of this message relative to other orderbook related messages
Each level is represented as an array of price, amount where price is the price of the level and amount is the amount of base at the level.
Further "snap" messages are sent periodically.
Orderbook updates after the initial snapshot message will then be sent as "inc" message with the following structure:
type
"inc"
(optional) asks
An array containing updates to the ask levels
(optional) bids
An array containing updates to the bid levels
sequence
A sequence number indicating the ordering of this message relative to other orderbook related messages
Each level is represented as an array of price, amount where price is the price of the level and amount is the amount of base at the level. If the level amount is blank (““) then that price level no longer exists and should be removed.
Private: *** User Wallet Balances
Sample balance update message
{
"balance": [
{
"totalBalance": "1063102.02",
"availableBalance": "1000102.00",
"currency": "usdc"
}
]
}
Base URL: wss://daxxr.tokamaktech.net/api/v2/ws/private
name: balance
example subscription: {"event":"subscribe","streams":["balance"]}
Each balance message will contain a list of updates to the user’s balance. Each update is represented as an object with the following keys:
availableBalance
The user’s current available balance
currency
The currency that this update represents
totalBalance
The amount of the user’s total balance
Private: User Trades
Example trades message
{
"trade": {
"amount": "0.001",
"created_at": 1613001890,
"id": 216828,
"market": "btcbrl",
"order_id": 21473526,
"price": "243428.18",
"side": "buy",
"taker_type": "buy",
"total": "243.42818"
}
}
Base URL: wss://daxxr.tokamaktech.net/api/v2/ws/private
name: trades
example subscription: {"event":"subscribe","streams":["trades"]}
Each trades message will contain a trade object with the following keys:
amount
The amount of base traded
created_at
The time this trade occurred
id
Unique id of this trade on the exchange
market
The market on which the trade took place
order_id
The exchange id of the user’s order from this trade
price
The price of the trade
side
The side of the order owned by this user that caused this trade
taker_type
The side of taker order in this trade
total
The amount of quote traded (volume * price)
Private: *** User Orders
Example orders message
{
"order": {
"at": 1612991739,
"avg_price": "0.0",
"client_id": "21612991737",
"created_at": 1612991739,
"executed_volume": "0.0",
"id": 21459359,
"kind": "ask",
"market": "btcbrl",
"ord_type": "limit",
"origin_volume": "0.00061166",
"price": "241440.78",
"remaining_volume": "0.00061166",
"side": "sell",
"state": "wait",
"trades_count": 0,
"updated_at": 1612991739
}
}
Base URL: wss://daxxr.tokamaktech.net/api/v2/ws/private
name: orders
example subscription: {"event":"subscribe","streams":["orders"]}
Each orders message will contain an object with an order update containing the following keys:
at
The UNIX timestamp of this update event
avg_price
The average price of execution of this order. “0.0” if no trades have executed involving this order.
client_id
The client specified order id
created_at
The UNIX timestamp at which this order was created
executed_volume
The amount of base that has been traded from this order
id
The exchange id of this order
kind
Either “bid” or “ask”
market
The market on which this order was placed
ord_type
One of [“limit”, “market”]
origin_volume
The original amount of base that this order represented
price
The original price of this order (if this is a limit order)
remaining_volume
The amount of base that remains untraded in this order
side
Either “buy” or “sell”
state
One of [“pending”, “unmatched”, “wait”, “done”, “cancel”, “reject”’]
pending - order has not yet been added to the order book
wait - order is active on the orderbook
done - order has been completely filled
cancel - order has been cancelled
reject - order has been rejected by the exchange
trades_count
The number of trades that have involved this order
updated_at
The UNIX timestamp of the last update to this order