NAV
bash javascript

Info

Welcome to the generated API reference. Get Postman Collection

Authentication

Authentication using JSON Web Tokens.

Get a JWT via given credentials.

Example request:

curl -X GET -G "/api/auth/jwt/token" \
    -H "Authorization: Basic {Base64Encoded(email:password)}"
const url = new URL("/api/auth/jwt/token");

let headers = {
    "Authorization": "Basic {Base64Encoded(email:password)}",
    "Accept": "application/json",
    "Content-Type": "application/json",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "data": {
        "jwt": "eyJ0eXAiOiJKV1QiLCJhbGciOiJI.......ElbeYRhQoj46geVZMTnrFom22aSqWQJ63A",
        "tokenType": "bearer",
        "expiresIn": 60
    }
}

Example response (401):

{
    "message": "Unauthorized login",
    "statusCode": "401"
}

Example response (500):

{
    "message": "Invalid input",
    "statusCode": "500"
}

HTTP Request

GET /api/auth/jwt/token

Refreshes a jwt (ie. extends it's TTL)

Example request:

curl -X GET -G "/api/auth/jwt/refresh" \
    -H "Authorization: Bearer {JWT token}"
const url = new URL("/api/auth/jwt/refresh");

let headers = {
    "Authorization": "Bearer {JWT token}",
    "Accept": "application/json",
    "Content-Type": "application/json",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "data": {
        "jwt": "eyJ0eXAiOiJKV1QiLCJhbGciOiJI.......ElbeYRhQoj46geVZMTnrFom22aSqWQJ63A",
        "tokenType": "bearer",
        "expiresIn": 60
    }
}

Example response (401):

{
    "message": "Unauthorized login",
    "statusCode": "401"
}

Example response (500):

{
    "message": "Invalid input",
    "statusCode": "500"
}

HTTP Request

GET /api/auth/jwt/refresh

Log the user out (Invalidate the token).

Example request:

curl -X DELETE "/api/auth/jwt/token" \
    -H "Authorization: Bearer {JWT token}"
const url = new URL("/api/auth/jwt/token");

let headers = {
    "Authorization": "Bearer {JWT token}",
    "Accept": "application/json",
    "Content-Type": "application/json",
}

fetch(url, {
    method: "DELETE",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

[]

Example response (401):

{
    "message": "Unauthorized login",
    "statusCode": 401
}

Example response (500):

{
    "message": "Invalid input",
    "statusCode": "500"
}

HTTP Request

DELETE /api/auth/jwt/token

Transactions

Create, fetch, and get minimum amounts for transactions.

Create a transaction


Requires authentication

Example request:

curl -X POST "/api/auth/transactions/create" \
    -H "Authorization: Bearer {JWT token}" \
    -H "Content-Type: application/json" \
    -d '{"from":"BTC","to":"ETH","amount":"0.5","address":"0xdb34bdBC8937b137e3b78DbC20De23b560DB7376"}'
const url = new URL("/api/auth/transactions/create");

let headers = {
    "Authorization": "Bearer {JWT token}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = {
    "from": "BTC",
    "to": "ETH",
    "amount": "0.5",
    "address": "0xdb34bdBC8937b137e3b78DbC20De23b560DB7376"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "data": {
        "id": "f90a986d-eca5-4946-9a6e-05d56369b73c",
        "from": "BTC",
        "to": "ETH",
        "amount": "0.5",
        "depositAddress": "34x88QaHKm8v3UUd8tnX2igTkJWMgAeLFG",
        "withdrawAddress": "0xdb34bdBC8937b137e3b78DbC20De23b560DB7376",
        "status": "new"
    }
}

Example response (401):

{
    "message": "Unauthorized login",
    "statusCode": "401"
}

Example response (500):

{
    "message": "Invalid input",
    "statusCode": "500"
}

HTTP Request

POST /api/auth/transactions/create

Body Parameters

Parameter Type Status Description
from string required The cryptocurrency you want to exchange from.
to string required The cryptocurrency you want to exchange to.
amount string required The amount of coins you want to exchange.
address string required The address you want to withdraw to.

Fetch a transaction


Requires authentication

Example request:

curl -X GET -G "/api/auth/transactions/fetch" \
    -H "Authorization: Bearer {JWT token}" \
    -H "Content-Type: application/json" \
    -d '{"id":"55d09719-7999-4aae-ad5f-c35e7017dbb1"}'
const url = new URL("/api/auth/transactions/fetch");

let headers = {
    "Authorization": "Bearer {JWT token}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = {
    "id": "55d09719-7999-4aae-ad5f-c35e7017dbb1"
}

fetch(url, {
    method: "GET",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "data": {
        "id": "55d09719-7999-4aae-ad5f-c35e7017dbb1",
        "depositCurrency": "BTC",
        "depositAmount": "0.5",
        "depositAddress": "34x88QaHKm8v3UUd8tnX2igTkJWMgAeLFG",
        "depositTxid": "720123794c0f87c256643970b677bbd75c5b9bce0190cd6ea8aac3cdb14ff11c",
        "withdrawCurrency": "ETH",
        "withdrawAmount": "26.8394",
        "withdrawAddress": "0xdb34bdBC8937b137e3b78DbC20De23b560DB7376",
        "withdrawTxid": "0x894f505582c723045161b23efb7c8eb553f1f685a952dc5577445229d4c98099",
        "status": "complete"
    }
}

Example response (404):

{
    "message": "Not found",
    "statuscode": "404"
}

HTTP Request

GET /api/auth/transactions/fetch

Body Parameters

Parameter Type Status Description
id string required The transaction id of the transaction you want to fetch.

Get the minimum amount to exchange


Requires authentication

Example request:

curl -X GET -G "/api/auth/transactions/min_amount" \
    -H "Authorization: Bearer {JWT token}" \
    -H "Content-Type: application/json" \
    -d '{"from":"BTC","to":"ETH"}'
const url = new URL("/api/auth/transactions/min_amount");

let headers = {
    "Authorization": "Bearer {JWT token}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = {
    "from": "BTC",
    "to": "ETH"
}

fetch(url, {
    method: "GET",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "depositCurrency": "BTC",
    "withdrawCurrency": "ETH",
    "minimumAmount": "0.00075423"
}

Example response (404):

{
    "message": "From-to currency pair not supported. Please try again.",
    "statuscode": "404"
}

HTTP Request

GET /api/auth/transactions/min_amount

Body Parameters

Parameter Type Status Description
from string required The currency you want to convert from.
to string required The currency you want to convert to.