NAV

API DOCUMENTATION

Javascript

Overview

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

The purpose of this application is to provide a means for our frontend and API users to communicate with the backend system

Base URLs:

API Key Authentication

Some of the endpoints require authentication through API keys.

Generating an API Key

To generate an API Key

  1. Sign into your account with a web browser
  2. Click on your address in the upper right corner
  3. Click "API Keys"
  4. Click Add New API Key
  5. Name the key
  6. Select the correct permissions
  7. Click "Create API Key"
  8. Record the secret key

Important: The secret key should be treated the same way as your password and not stored in an unencrypted manner. Please store this information in a password manager or key vault.

Making an authenticated REST request

Authenticated REST requests need the following headers:

Example in Go:

package main
import (
  "crypto/hmac"
  "crypto/sha256"
  "encoding/hex"
  "fmt"
  "io"
  "net/http"
  "strings"
  "time"
)
func main() {
  keyId := "enclaveKeyId_7bae69d2993b0512bf33ec4e2f9b7d4d"
  apiSecret := "enclaveApiSecret_6584f43118e921424c1fd58fc24259d6a098dec0339f8a434178c77c6b8c2102"
  method := "GET"
  base := "https://api.enclave.market"
  path := "/v0/wallet/balances"
  body := ""
  req, _ := http.NewRequest("GET", base+path, strings.NewReader(body))
  timestamp := fmt.Sprintf("%d", time.Now().UnixMilli())
  concattedString := timestamp + method + path + body
  mac := hmac.New(sha256.New, []byte(apiSecret))
  mac.Write([]byte(concattedString))
  sig := mac.Sum(nil)
  req.Header.Set("ENCLAVE-KEY-ID", keyId)
  req.Header.Set("ENCLAVE-TIMESTAMP", timestamp)
  req.Header.Set("ENCLAVE-SIGN", hex.EncodeToString(sig))
  res, err := http.DefaultClient.Do(req)
  if err != nil {
    fmt.Printf("http err: %s", err)
    return
  }
  data, _ := io.ReadAll(res.Body)
  fmt.Printf("Status: %s, Body: %s", res.Status, data)
}

WebSocket API

Enclave Cross’ streaming WebSocket API to get public price updates and an account’s fill and order status updates.

Production URL: wss://api.enclave.market/ws

Connection Lifecycle

Websocket connections go through the following example lifecycle:

  1. Connect to the API at wss://api.enclave.market/ws
  2. For private channels (orders and fills), authentication is required here. {"op": "login", "args": {"key": <api_key_id>, "sign": <signature>, "time": <ts>}}
  3. Ping at a regular interval (every 15 seconds) with: {"op": "ping"}
  4. Receive a pong response: {"type": "pong"}
  5. Subscribe to a channel with: {"op": "subscribe", "channel": <channel_name>}
  6. Receive subscription response: {"type": "subscribed", "channel": <channel_name>}
  7. Receive an update (public prices channel example): {"type":"update","channel":"prices","data":{"pair":{"base":"AVAX","quote":"USDC"},"price":"13.879000015258789","time":"2022-11-15T16:18:12.049289984Z"}}
  8. (Optional) Unsubscribe from a channel to stop receiving messages: {"op": "unsubscribe", "channel": <channel_name>}
  9. Receive unsubscription response: {"type": "unsubscribed", "channel": <channel_name>}

Public Channels

These channels can be subscribed to without authenticating.

Prices channel

Example price update message: 

{
  "type": "update",
  "channel": "prices",
  "data": {
    "pair": {
      "base": "AVAX",
      "quote": "USDC"
    },
    "price": "13.879000015258789",
    "time": "2022-11-15T16:18:12.049289984Z"
  }
}

The latest prices for supported price pairs. All messages will have the update type. The data field will contain the following:

Private Channels

These channels require the user to first authenticate with an API key.

Authentication

Example Request

{
  "op": "login",
  "args": {
    "key": "<api_key_id>",
    "time": "<timestamp>",
    "sign": "<signature>"
  }
}


Success response: 

{"type":"loggedIn"}

You can generate an API key by following the steps here https://docs.enclave.market/#generating-an-api-key

Authentication via API key:

Orders Channel

Example response:

{
  "type": "update",
  "channel": "orders",
  "data": {
    "accountId": "99627194178829804007",
    "orderCategory": "CN",
    "customerOrderId": "8649352166794",
    "internalOrderId": "1",
    "pair": {
      "base": "AVAX",
      "quote": "USDC"
    },
    "side": "SELL",
    "isCancelled": false,
    "isFilled": false,
    "size": "0.1",
    "filledSize": "0",
    "remainingSize": "0.1",
    "exchangedSize": "0",
    "updatedAt": "2022-11-15T19:58:21.810627137Z",
  }
}

The order channel streams order status changes for your account. You can subscribe with the following message after logging in:

{"op": "subscribe", "channel": "orders"}

You can expect a message to be sent when the following occur:

Fills Channel

Example response:

{
  "type": "update",
  "channel": "fills",
  "data": {
    "id": "a58157897e9a4e4933c546f85d938808",
    "market": "AVAX/USDC",
    "baseCurrency": "AVAX",
    "quoteCurrency": "USDC",
    "orderId": "2",
    "price": "17.5",
    "side": "sell",
    "baseSize": "1",
    "baseFee": null,
    "quoteSize": "17.5",
    "quoteFee": "0.175",
    "time": "2022-11-15T19:58:21.810627137Z",
    "type": "CN",
    "fillOrder": 0
  }
}

The fills channel streams order fills for your account. You can subscribe with the following message after logging in:

{"op": "subscribe", "channel": "fills"}

All fills for your orders will show up here, including partial fills.

REST API

add_order

POST /v0/add_order

Adds an order

Body parameter

{
  "type": "object",
  "required": [
    "orderCategory",
    "pair",
    "side",
    "size"
  ],
  "properties": {
    "cancelAbove": {
      "description": "max price at which the order should be filled, will be canceled if oracle price exceeds this",
      "type": "string",
      "example": "22000"
    },
    "cancelBelow": {
      "description": "min price at which the order should be filled, will be canceled if oracle price goes lower than this",
      "type": "string",
      "example": "18000"
    },
    "expirationUnix": {
      "description": "when the placed order will expire and be automatically cancelled, in seconds from the unix epoch. Must be less than a year in the future.",
      "type": "integer",
      "format": "int64",
      "example": 1665515317
    },
    "orderCategory": {
      "description": "the order category",
      "type": "string",
      "example": "CN"
    },
    "pair": {
      "type": "object",
      "required": [
        "base",
        "quote"
      ],
      "properties": {
        "base": {
          "description": "the base coin of the currency pair",
          "type": "string",
          "example": "AVAX"
        },
        "quote": {
          "description": "the quote coin of the currency pair",
          "type": "string",
          "example": "ETH"
        }
      }
    },
    "side": {
      "description": "the type of order the customer would like to place",
      "type": "string",
      "example": "SELL"
    },
    "size": {
      "description": "the size of the order the customer would like to place",
      "type": "string",
      "example": "0.1"
    }
  }
}

Parameters

Name In Type Required Description
body body object false This json object is passed to the endpoint
» cancelAbove body string false max price at which the order should be filled, will be canceled if oracle price exceeds this
» cancelBelow body string false min price at which the order should be filled, will be canceled if oracle price goes lower than this
» expirationUnix body integer(int64) false when the placed order will expire and be automatically cancelled, in seconds from the unix epoch. Must be less than a year in the future.
» orderCategory body string true the order category
» pair body object true none
»» base body string true the base coin of the currency pair
»» quote body string true the quote coin of the currency pair
» side body string true the type of order the customer would like to place
» size body string true the size of the order the customer would like to place

Example responses

200 Response

{
  "type": "object",
  "required": [
    "success"
  ],
  "properties": {
    "error": {
      "description": "explanation if the request was not successful",
      "type": "string",
      "example": "Resource not found"
    },
    "error_code": {
      "description": "HTTP error code",
      "type": "string",
      "example": "404"
    },
    "result": {
      "type": "object",
      "required": [
        "accountId",
        "orderCategory",
        "internalOrderId",
        "pair",
        "side",
        "isCancelled",
        "isFilled",
        "size",
        "filledSize",
        "remainingSize",
        "exchangedSize",
        "updatedAt"
      ],
      "properties": {
        "accountId": {
          "description": "the ID associated with the customer account",
          "type": "string",
          "example": "5577006791947779410"
        },
        "exchangedSize": {
          "description": "the opposite size after fees in the fills",
          "type": "string",
          "example": "3"
        },
        "filledSize": {
          "description": "the filled size of the order",
          "type": "string",
          "example": "7.5"
        },
        "internalOrderId": {
          "description": "the internal id of the order",
          "type": "string",
          "example": "1436105356947779827"
        },
        "isCancelled": {
          "description": "whether the order has been manually canceled, price has gone outside allowed range, or order has expired",
          "type": "boolean",
          "example": false
        },
        "isFilled": {
          "description": "whether the order has been fully filled",
          "type": "boolean",
          "example": false
        },
        "orderCategory": {
          "description": "the category of the order [CN]",
          "type": "string",
          "example": "CN"
        },
        "pair": {
          "type": "object",
          "required": [
            "base",
            "quote"
          ],
          "properties": {
            "base": {
              "description": "the base coin of the currency pair",
              "type": "string",
              "example": "AVAX"
            },
            "quote": {
              "description": "the quote coin of the currency pair",
              "type": "string",
              "example": "ETH"
            }
          }
        },
        "remainingSize": {
          "description": "the remaining size of the order to fill",
          "type": "string",
          "example": "2.5"
        },
        "side": {
          "description": "the type of the order [BUY, SELL]",
          "type": "string",
          "example": "SELL"
        },
        "size": {
          "description": "the size of the order",
          "type": "string",
          "example": "10"
        },
        "updatedAt": {
          "description": "the lastest time the order was updated",
          "type": "string",
          "format": "date-time",
          "example": "2022-11-15T16:18:12.049289984Z"
        }
      }
    },
    "success": {
      "description": "whether the request was successful",
      "type": "boolean",
      "example": true
    }
  }
}

Responses

Status Meaning Description Schema
200 OK This json object is sent back to a good request Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» error string false none explanation if the request was not successful
» error_code string false none HTTP error code
» result object false none none
»» accountId string true none the ID associated with the customer account
»» exchangedSize string true none the opposite size after fees in the fills
»» filledSize string true none the filled size of the order
»» internalOrderId string true none the internal id of the order
»» isCancelled boolean true none whether the order has been manually canceled, price has gone outside allowed range, or order has expired
»» isFilled boolean true none whether the order has been fully filled
»» orderCategory string true none the category of the order [CN]
»» pair object true none none
»»» base string true none the base coin of the currency pair
»»» quote string true none the quote coin of the currency pair
»» remainingSize string true none the remaining size of the order to fill
»» side string true none the type of the order [BUY, SELL]
»» size string true none the size of the order
»» updatedAt string(date-time) true none the lastest time the order was updated
» success boolean true none whether the request was successful

auth_complete_challenge

POST /v0/auth/complete_challenge

Completes the auth challenge as proof of ownership of an address

Body parameter

{
  "type": "object",
  "required": [
    "id",
    "signature"
  ],
  "properties": {
    "id": {
      "description": "the ID of the challenge given",
      "type": "string",
      "example": "ub6EabCuCiw9HvYyhsZhWzv8mntMgZ-vDGzZKvvCi_o="
    },
    "signature": {
      "description": "the signed data proving ownership of the specific address",
      "type": "string",
      "example": "8650fc18ca35d1e3c358b566ff786783978dc16519c055ba2085a2345bed89f46719876e3e01cf3bbf94c50f6b5524c3df3d9881386f11910ddb3a15bfade5f21c"
    }
  }
}

Parameters

Name In Type Required Description
body body object false This json object is passed to the endpoint
» id body string true the ID of the challenge given
» signature body string true the signed data proving ownership of the specific address

Example responses

200 Response

{
  "type": "object",
  "required": [
    "success"
  ],
  "properties": {
    "error": {
      "description": "explanation if the request was not successful",
      "type": "string",
      "example": "Resource not found"
    },
    "error_code": {
      "description": "HTTP error code",
      "type": "string",
      "example": "404"
    },
    "result": {
      "type": "object",
      "properties": {
        "accountId": {
          "type": "string"
        },
        "expirationSecs": {
          "type": "integer",
          "format": "int64"
        },
        "issuedAtSecs": {
          "type": "integer",
          "format": "int64"
        },
        "token": {
          "type": "string"
        },
        "walletAddress": {
          "type": "string"
        }
      }
    },
    "success": {
      "description": "whether the request was successful",
      "type": "boolean",
      "example": true
    }
  }
}

Responses

Status Meaning Description Schema
200 OK This json object is sent back to a good request Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» error string false none explanation if the request was not successful
» error_code string false none HTTP error code
» result object false none none
»» accountId string false none none
»» expirationSecs integer(int64) false none none
»» issuedAtSecs integer(int64) false none none
»» token string false none none
»» walletAddress string false none none
» success boolean true none whether the request was successful

auth_get_challenge

POST /v0/auth/get_challenge

Gets a challenge to sign as confirmation that you own a specific wallet address

Body parameter

{
  "type": "object",
  "properties": {
    "walletAddress": {
      "type": "string"
    }
  }
}

Parameters

Name In Type Required Description
body body object false This json object is passed to the endpoint
» walletAddress body string false none

Example responses

200 Response

{
  "type": "object",
  "required": [
    "success"
  ],
  "properties": {
    "error": {
      "description": "explanation if the request was not successful",
      "type": "string",
      "example": "Resource not found"
    },
    "error_code": {
      "description": "HTTP error code",
      "type": "string",
      "example": "404"
    },
    "result": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "signerData": {
          "description": "TypedData is a type to encapsulate EIP-712 typed messages",
          "type": "object",
          "properties": {
            "domain": {
              "type": "object",
              "title": "TypedDataDomain represents the domain part of an EIP-712 message.",
              "properties": {
                "chainId": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "salt": {
                  "type": "string"
                },
                "verifyingContract": {
                  "type": "string"
                },
                "version": {
                  "type": "string"
                }
              }
            },
            "message": {
              "type": "object",
              "additionalProperties": false
            },
            "primaryType": {
              "type": "string"
            },
            "types": {
              "type": "object",
              "additionalProperties": {
                "type": "array",
                "items": {
                  "description": "Type is the inner type of an EIP-712 message",
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "success": {
      "description": "whether the request was successful",
      "type": "boolean",
      "example": true
    }
  }
}

Responses

Status Meaning Description Schema
200 OK This json object is sent back to a good request Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» error string false none explanation if the request was not successful
» error_code string false none HTTP error code
» result object false none none
»» id string false none none
»» signerData object false none TypedData is a type to encapsulate EIP-712 typed messages
»»» domain object false none none
»»»» chainId string false none none
»»»» name string false none none
»»»» salt string false none none
»»»» verifyingContract string false none none
»»»» version string false none none
»»» message object false none none
»»» primaryType string false none none
»»» types object false none none
»»»» additionalProperties [object] false none none
»»»»» name string false none none
»»»»» type string false none none
» success boolean true none whether the request was successful

cancel_order

POST /v0/cancel_order

Cancels an order

Body parameter

{
  "type": "object",
  "properties": {
    "internalOrderId": {
      "description": "the order id returned on order creation",
      "type": "string",
      "example": "5577006791947779410"
    }
  }
}

Parameters

Name In Type Required Description
body body object false This json object is passed to the endpoint
» internalOrderId body string false the order id returned on order creation

Example responses

200 Response

{
  "type": "object",
  "required": [
    "success"
  ],
  "properties": {
    "error": {
      "description": "explanation if the request was not successful",
      "type": "string",
      "example": "Resource not found"
    },
    "error_code": {
      "description": "HTTP error code",
      "type": "string",
      "example": "404"
    },
    "result": {
      "type": "object",
      "required": [
        "accountId",
        "orderCategory",
        "internalOrderId",
        "pair",
        "side",
        "isCancelled",
        "isFilled",
        "size",
        "filledSize",
        "remainingSize",
        "exchangedSize",
        "updatedAt"
      ],
      "properties": {
        "accountId": {
          "description": "the ID associated with the customer account",
          "type": "string",
          "example": "5577006791947779410"
        },
        "exchangedSize": {
          "description": "the opposite size after fees in the fills",
          "type": "string",
          "example": "3"
        },
        "filledSize": {
          "description": "the filled size of the order",
          "type": "string",
          "example": "7.5"
        },
        "internalOrderId": {
          "description": "the internal id of the order",
          "type": "string",
          "example": "1436105356947779827"
        },
        "isCancelled": {
          "description": "whether the order has been manually canceled, price has gone outside allowed range, or order has expired",
          "type": "boolean",
          "example": false
        },
        "isFilled": {
          "description": "whether the order has been fully filled",
          "type": "boolean",
          "example": false
        },
        "orderCategory": {
          "description": "the category of the order [CN]",
          "type": "string",
          "example": "CN"
        },
        "pair": {
          "type": "object",
          "required": [
            "base",
            "quote"
          ],
          "properties": {
            "base": {
              "description": "the base coin of the currency pair",
              "type": "string",
              "example": "AVAX"
            },
            "quote": {
              "description": "the quote coin of the currency pair",
              "type": "string",
              "example": "ETH"
            }
          }
        },
        "remainingSize": {
          "description": "the remaining size of the order to fill",
          "type": "string",
          "example": "2.5"
        },
        "side": {
          "description": "the type of the order [BUY, SELL]",
          "type": "string",
          "example": "SELL"
        },
        "size": {
          "description": "the size of the order",
          "type": "string",
          "example": "10"
        },
        "updatedAt": {
          "description": "the lastest time the order was updated",
          "type": "string",
          "format": "date-time",
          "example": "2022-11-15T16:18:12.049289984Z"
        }
      }
    },
    "success": {
      "description": "whether the request was successful",
      "type": "boolean",
      "example": true
    }
  }
}

Responses

Status Meaning Description Schema
200 OK This json object is sent back to a good request Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» error string false none explanation if the request was not successful
» error_code string false none HTTP error code
» result object false none none
»» accountId string true none the ID associated with the customer account
»» exchangedSize string true none the opposite size after fees in the fills
»» filledSize string true none the filled size of the order
»» internalOrderId string true none the internal id of the order
»» isCancelled boolean true none whether the order has been manually canceled, price has gone outside allowed range, or order has expired
»» isFilled boolean true none whether the order has been fully filled
»» orderCategory string true none the category of the order [CN]
»» pair object true none none
»»» base string true none the base coin of the currency pair
»»» quote string true none the quote coin of the currency pair
»» remainingSize string true none the remaining size of the order to fill
»» side string true none the type of the order [BUY, SELL]
»» size string true none the size of the order
»» updatedAt string(date-time) true none the lastest time the order was updated
» success boolean true none whether the request was successful

fills

GET /v0/fills

Returns all fills for an account

Example responses

200 Response

{
  "type": "object",
  "required": [
    "success"
  ],
  "properties": {
    "error": {
      "description": "explanation if the request was not successful",
      "type": "string",
      "example": "Resource not found"
    },
    "error_code": {
      "description": "HTTP error code",
      "type": "string",
      "example": "404"
    },
    "result": {
      "description": "the result of the request, if it was successful",
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "market",
          "baseCurrency",
          "quoteCurrency",
          "orderId",
          "price",
          "side",
          "baseSize",
          "quoteSize",
          "quoteFee",
          "time",
          "type",
          "fillOrder"
        ],
        "properties": {
          "baseCurrency": {
            "description": "the base currency of the fill",
            "type": "string",
            "example": "AVAX"
          },
          "baseFee": {
            "description": "the fee on the base fill",
            "type": "string",
            "example": "0.001"
          },
          "baseSize": {
            "description": "size of the base currency that was filled",
            "type": "string",
            "example": "1"
          },
          "fillOrder": {
            "description": "the order the fill occurred for a specific order, if there are multiple fills for an order",
            "type": "integer",
            "format": "int64",
            "example": 0
          },
          "id": {
            "description": "fill ID",
            "type": "string",
            "example": "1436105356947779827"
          },
          "market": {
            "description": "a string composed of BASE/QUOTE representing the trading pair",
            "type": "string",
            "example": "AVAX/ETH"
          },
          "orderId": {
            "description": "the internal ID of the order that this fill is associated with",
            "type": "string",
            "example": "5577006791947779410"
          },
          "price": {
            "description": "the price at which the order was filled",
            "type": "string",
            "example": "0.0125"
          },
          "quoteCurrency": {
            "description": "the quote currency of the fill",
            "type": "string",
            "example": "ETH"
          },
          "quoteFee": {
            "description": "the fee on the quote fill",
            "type": "string",
            "example": "0.000125"
          },
          "quoteSize": {
            "description": "size of the quote currency that was filled",
            "type": "string",
            "example": "0.0125"
          },
          "side": {
            "description": "the type of the order [BUY, SELL]",
            "type": "string",
            "example": "SELL"
          },
          "time": {
            "description": "the time at which the fill occurred, represented as a string",
            "type": "string",
            "format": "date-time",
            "example": "2022-08-31T22:37:38.990882912Z"
          },
          "type": {
            "description": "the type of the order that was filled [CN]",
            "type": "string",
            "example": "CN"
          }
        }
      }
    },
    "success": {
      "description": "whether the request was successful",
      "type": "boolean",
      "example": true
    }
  }
}

Responses

Status Meaning Description Schema
200 OK This json object is sent back to a good request Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» error string false none explanation if the request was not successful
» error_code string false none HTTP error code
» result [object] false none the result of the request, if it was successful
»» baseCurrency string true none the base currency of the fill
»» baseFee string false none the fee on the base fill
»» baseSize string true none size of the base currency that was filled
»» fillOrder integer(int64) true none the order the fill occurred for a specific order, if there are multiple fills for an order
»» id string true none fill ID
»» market string true none a string composed of BASE/QUOTE representing the trading pair
»» orderId string true none the internal ID of the order that this fill is associated with
»» price string true none the price at which the order was filled
»» quoteCurrency string true none the quote currency of the fill
»» quoteFee string true none the fee on the quote fill
»» quoteSize string true none size of the quote currency that was filled
»» side string true none the type of the order [BUY, SELL]
»» time string(date-time) true none the time at which the fill occurred, represented as a string
»» type string true none the type of the order that was filled [CN]
» success boolean true none whether the request was successful

fills_csv

POST /v0/fills/csv

Gets fills for an account within the start and end times

Body parameter

{
  "type": "object",
  "properties": {
    "end_time": {
      "description": "End time in Unix time seconds to filter results",
      "type": "integer",
      "format": "int64",
      "example": 1666209371
    },
    "start_time": {
      "description": "Start time in Unix time seconds to filter results",
      "type": "integer",
      "format": "int64",
      "example": 1666203390
    }
  }
}

Parameters

Name In Type Required Description
body body object false This json object is passed to the endpoint
» end_time body integer(int64) false End time in Unix time seconds to filter results
» start_time body integer(int64) false Start time in Unix time seconds to filter results

Responses

Status Meaning Description Schema
200 OK CSV formatted text None

get_balance

POST /v0/get_balance

Gets balance of a specific asset

Body parameter

{
  "type": "object",
  "required": [
    "symbol"
  ],
  "properties": {
    "symbol": {
      "type": "string"
    }
  }
}

Parameters

Name In Type Required Description
body body object false This json object is passed to the endpoint
» symbol body string true none

Example responses

200 Response

{
  "type": "object",
  "required": [
    "success"
  ],
  "properties": {
    "error": {
      "description": "explanation if the request was not successful",
      "type": "string",
      "example": "Resource not found"
    },
    "error_code": {
      "description": "HTTP error code",
      "type": "string",
      "example": "404"
    },
    "result": {
      "type": "object",
      "required": [
        "accountId",
        "symbol",
        "totalBalance",
        "reservedBalance",
        "freeBalance"
      ],
      "properties": {
        "accountId": {
          "description": "the account ID of the user that made the request",
          "type": "string",
          "example": "5577006791947779410"
        },
        "freeBalance": {
          "description": "the free balance of the coin",
          "type": "string",
          "example": "3000"
        },
        "reservedBalance": {
          "description": "the reserved balance of the coin, held in open orders",
          "type": "string",
          "example": "7000"
        },
        "symbol": {
          "type": "string"
        },
        "totalBalance": {
          "description": "the total balance of the coin",
          "type": "string",
          "example": "10000"
        }
      }
    },
    "success": {
      "description": "whether the request was successful",
      "type": "boolean",
      "example": true
    }
  }
}

Responses

Status Meaning Description Schema
200 OK This json object is sent back to a good request Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» error string false none explanation if the request was not successful
» error_code string false none HTTP error code
» result object false none none
»» accountId string true none the account ID of the user that made the request
»» freeBalance string true none the free balance of the coin
»» reservedBalance string true none the reserved balance of the coin, held in open orders
»» symbol string true none none
»» totalBalance string true none the total balance of the coin
» success boolean true none whether the request was successful

get_markets

POST /v0/get_markets

Gets the current trading pairs and coin information for a specific market category

Body parameter

{
  "type": "object",
  "required": [
    "marketCategory"
  ],
  "properties": {
    "marketCategory": {
      "description": "the category of the market for which the customer wishes to get info [CN]",
      "type": "string",
      "example": "CN"
    }
  }
}

Parameters

Name In Type Required Description
body body object false This json object is passed to the endpoint
» marketCategory body string true the category of the market for which the customer wishes to get info [CN]

Example responses

200 Response

{
  "type": "object",
  "required": [
    "success"
  ],
  "properties": {
    "error": {
      "description": "explanation if the request was not successful",
      "type": "string",
      "example": "Resource not found"
    },
    "result": {
      "type": "object",
      "required": [
        "marketCategory",
        "tradingPairs",
        "minOrderSizes",
        "maxOrderSizes"
      ],
      "properties": {
        "marketCategory": {
          "description": "the category of the market for which the customer wanted to get info [CN]",
          "type": "string",
          "example": "CN"
        },
        "maxOrderSizes": {
          "description": "the maximum order sizes of the target market",
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "minOrderSizes": {
          "description": "the minium order sizes of the target market",
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "tradingPairs": {
          "description": "the current trading pairs of the target market",
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "pair",
              "decimalPlaces"
            ],
            "properties": {
              "decimalPlaces": {
                "description": "the number of decimals of precision associated with that pair",
                "type": "integer",
                "format": "int32",
                "example": 6
              },
              "pair": {
                "type": "object",
                "required": [
                  "base",
                  "quote"
                ],
                "properties": {
                  "base": {
                    "description": "the base coin of the currency pair",
                    "type": "string",
                    "example": "AVAX"
                  },
                  "quote": {
                    "description": "the quote coin of the currency pair",
                    "type": "string",
                    "example": "ETH"
                  }
                }
              }
            }
          }
        }
      }
    },
    "success": {
      "description": "whether the request was successful",
      "type": "boolean",
      "example": true
    }
  }
}

Responses

Status Meaning Description Schema
200 OK This json object is sent back to a good request Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» error string false none explanation if the request was not successful
» result object false none none
»» marketCategory string true none the category of the market for which the customer wanted to get info [CN]
»» maxOrderSizes object true none the maximum order sizes of the target market
»»» additionalProperties string false none none
»» minOrderSizes object true none the minium order sizes of the target market
»»» additionalProperties string false none none
»» tradingPairs [object] true none the current trading pairs of the target market
»»» decimalPlaces integer(int32) true none the number of decimals of precision associated with that pair
»»» pair object true none none
»»»» base string true none the base coin of the currency pair
»»»» quote string true none the quote coin of the currency pair
» success boolean true none whether the request was successful

get_order_status

POST /v0/get_order_status

Gets the status of a placed order

Body parameter

{
  "type": "object",
  "properties": {
    "internalOrderId": {
      "description": "the order ID returned on order creation",
      "type": "string",
      "example": "5577006791947779410"
    }
  }
}

Parameters

Name In Type Required Description
body body object false This json object is passed to the endpoint
» internalOrderId body string false the order ID returned on order creation

Example responses

200 Response

{
  "type": "object",
  "required": [
    "success"
  ],
  "properties": {
    "error": {
      "description": "explanation if the request was not successful",
      "type": "string",
      "example": "Resource not found"
    },
    "error_code": {
      "description": "HTTP error code",
      "type": "string",
      "example": "404"
    },
    "result": {
      "type": "object",
      "required": [
        "accountId",
        "orderCategory",
        "internalOrderId",
        "pair",
        "side",
        "isCancelled",
        "isFilled",
        "size",
        "filledSize",
        "remainingSize",
        "exchangedSize",
        "updatedAt"
      ],
      "properties": {
        "accountId": {
          "description": "the ID associated with the customer account",
          "type": "string",
          "example": "5577006791947779410"
        },
        "exchangedSize": {
          "description": "the opposite size after fees in the fills",
          "type": "string",
          "example": "3"
        },
        "filledSize": {
          "description": "the filled size of the order",
          "type": "string",
          "example": "7.5"
        },
        "internalOrderId": {
          "description": "the internal id of the order",
          "type": "string",
          "example": "1436105356947779827"
        },
        "isCancelled": {
          "description": "whether the order has been manually canceled, price has gone outside allowed range, or order has expired",
          "type": "boolean",
          "example": false
        },
        "isFilled": {
          "description": "whether the order has been fully filled",
          "type": "boolean",
          "example": false
        },
        "orderCategory": {
          "description": "the category of the order [CN]",
          "type": "string",
          "example": "CN"
        },
        "pair": {
          "type": "object",
          "required": [
            "base",
            "quote"
          ],
          "properties": {
            "base": {
              "description": "the base coin of the currency pair",
              "type": "string",
              "example": "AVAX"
            },
            "quote": {
              "description": "the quote coin of the currency pair",
              "type": "string",
              "example": "ETH"
            }
          }
        },
        "remainingSize": {
          "description": "the remaining size of the order to fill",
          "type": "string",
          "example": "2.5"
        },
        "side": {
          "description": "the type of the order [BUY, SELL]",
          "type": "string",
          "example": "SELL"
        },
        "size": {
          "description": "the size of the order",
          "type": "string",
          "example": "10"
        },
        "updatedAt": {
          "description": "the lastest time the order was updated",
          "type": "string",
          "format": "date-time",
          "example": "2022-11-15T16:18:12.049289984Z"
        }
      }
    },
    "success": {
      "description": "whether the request was successful",
      "type": "boolean",
      "example": true
    }
  }
}

Responses

Status Meaning Description Schema
200 OK This json object is sent back to a good request Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» error string false none explanation if the request was not successful
» error_code string false none HTTP error code
» result object false none none
»» accountId string true none the ID associated with the customer account
»» exchangedSize string true none the opposite size after fees in the fills
»» filledSize string true none the filled size of the order
»» internalOrderId string true none the internal id of the order
»» isCancelled boolean true none whether the order has been manually canceled, price has gone outside allowed range, or order has expired
»» isFilled boolean true none whether the order has been fully filled
»» orderCategory string true none the category of the order [CN]
»» pair object true none none
»»» base string true none the base coin of the currency pair
»»» quote string true none the quote coin of the currency pair
»» remainingSize string true none the remaining size of the order to fill
»» side string true none the type of the order [BUY, SELL]
»» size string true none the size of the order
»» updatedAt string(date-time) true none the lastest time the order was updated
» success boolean true none whether the request was successful

get_withdrawal_status

POST /v0/get_withdrawal_status

Gets withdrawal status

Body parameter

{
  "type": "object",
  "required": [
    "withdrawal_id"
  ],
  "properties": {
    "withdrawal_id": {
      "description": "the ID of the withdrawal of which the customer wants to get status",
      "type": "string",
      "example": "06638d16869699138ec9d9fa57a6ac4d21068bfafc4211305d636f80b77a2101"
    }
  }
}

Parameters

Name In Type Required Description
body body object false This json object is passed to the endpoint
» withdrawal_id body string true the ID of the withdrawal of which the customer wants to get status

Example responses

200 Response

{
  "type": "object",
  "required": [
    "success"
  ],
  "properties": {
    "error": {
      "description": "explanation if the request was not successful",
      "type": "string",
      "example": "Resource not found"
    },
    "error_code": {
      "description": "HTTP error code",
      "type": "string",
      "example": "404"
    },
    "result": {
      "type": "object",
      "required": [
        "original_request",
        "withdrawal_id",
        "withdrawal_status"
      ],
      "properties": {
        "confirmation_number": {
          "description": "the confirmation number when status is pending",
          "type": "integer",
          "format": "int64",
          "example": 1
        },
        "original_request": {
          "type": "object",
          "required": [
            "account_id",
            "symbol",
            "amount",
            "address"
          ],
          "properties": {
            "account_id": {
              "description": "the internal ID associated with the account that made the request",
              "type": "string",
              "example": "5577006791947779410"
            },
            "address": {
              "description": "the address to initiate withdrawal to",
              "type": "string",
              "example": "0x29b97b7819c7d8b593a599a3d3c237cac5520f62"
            },
            "amount": {
              "description": "the amount of the target coin to withdraw",
              "type": "string",
              "example": "10"
            },
            "symbol": {
              "type": "string"
            }
          }
        },
        "transaction_id": {
          "description": "the blockchain transaction ID",
          "type": "string",
          "example": "c06638d16869699138ec9d9fa57a6ac4d21068bfafc4211305d636f80b77a2101"
        },
        "withdrawal_id": {
          "description": "the ID of the withdrawal of which the customer wants to get status",
          "type": "string",
          "example": "06638d16869699138ec9d9fa57a6ac4d21068bfafc4211305d636f80b77a2101"
        },
        "withdrawal_status": {
          "description": "the status of the withdrawal",
          "type": "string",
          "example": "WITHDRAWAL_PENDING"
        }
      }
    },
    "success": {
      "description": "whether the request was successful",
      "type": "boolean",
      "example": true
    }
  }
}

Responses

Status Meaning Description Schema
200 OK This json object is sent back to a good request Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» error string false none explanation if the request was not successful
» error_code string false none HTTP error code
» result object false none none
»» confirmation_number integer(int64) false none the confirmation number when status is pending
»» original_request object true none none
»»» account_id string true none the internal ID associated with the account that made the request
»»» address string true none the address to initiate withdrawal to
»»» amount string true none the amount of the target coin to withdraw
»»» symbol string true none none
»» transaction_id string false none the blockchain transaction ID
»» withdrawal_id string true none the ID of the withdrawal of which the customer wants to get status
»» withdrawal_status string true none the status of the withdrawal
» success boolean true none whether the request was successful

orders

GET /v0/orders

Returns all open orders for an account

Example responses

200 Response

{
  "type": "object",
  "required": [
    "success"
  ],
  "properties": {
    "error": {
      "description": "explanation if the request was not successful",
      "type": "string",
      "example": "Resource not found"
    },
    "error_code": {
      "description": "HTTP error code",
      "type": "string",
      "example": "404"
    },
    "result": {
      "description": "the result of the request, if it was successful",
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "market",
          "type",
          "side",
          "size",
          "filledSize",
          "remainingSize",
          "exchangedSize",
          "status",
          "createdAt",
          "clientId",
          "priceAtPlacement"
        ],
        "properties": {
          "cancelAbove": {
            "description": "max price at which the order should be filled, will be canceled if oracle price exceeds this",
            "type": "string",
            "example": "0.0125"
          },
          "cancelBelow": {
            "description": "min price at which the order should be filled, will be canceled if oracle price goes lower than this",
            "type": "string",
            "example": "0.0120"
          },
          "clientId": {
            "description": "the internal ID associated with the customer that placed the order",
            "type": "string",
            "example": "1665515317"
          },
          "createdAt": {
            "description": "the time the order was created",
            "type": "string",
            "format": "date-time",
            "example": "2022-08-31T21:55:09.552977086Z"
          },
          "exchangedSize": {
            "description": "the opposite size after fees in the fills",
            "type": "string",
            "example": "3"
          },
          "expiration": {
            "description": "when the placed order will expire and be automatically cancelled, in seconds from the unix epoch",
            "type": "string",
            "format": "date-time",
            "example": "1665686173"
          },
          "filledSize": {
            "description": "the filled size of the order",
            "type": "string",
            "example": "7.5"
          },
          "id": {
            "description": "the internal ID associated with the order",
            "type": "string",
            "example": "1436105356947779827"
          },
          "market": {
            "description": "a string composed of BASE/QUOTE representing the trading pair",
            "type": "string",
            "example": "AVAX/ETH"
          },
          "priceAtPlacement": {
            "description": "price at placement",
            "type": "string",
            "example": "0.0127"
          },
          "remainingSize": {
            "description": "the remaining size of the order to fill",
            "type": "string",
            "example": "2.5"
          },
          "side": {
            "description": "the type of the order [BUY, SELL]",
            "type": "string",
            "example": "SELL"
          },
          "size": {
            "description": "the size of the order",
            "type": "string",
            "example": "10"
          },
          "status": {
            "description": "current status of the order [open, closed]",
            "type": "string",
            "example": "open"
          },
          "type": {
            "description": "the category of the order [CN]",
            "type": "string",
            "example": "CN"
          }
        }
      }
    },
    "success": {
      "description": "whether the request was successful",
      "type": "boolean",
      "example": true
    }
  }
}

Responses

Status Meaning Description Schema
200 OK This json object is sent back to a good request Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» error string false none explanation if the request was not successful
» error_code string false none HTTP error code
» result [object] false none the result of the request, if it was successful
»» cancelAbove string false none max price at which the order should be filled, will be canceled if oracle price exceeds this
»» cancelBelow string false none min price at which the order should be filled, will be canceled if oracle price goes lower than this
»» clientId string true none the internal ID associated with the customer that placed the order
»» createdAt string(date-time) true none the time the order was created
»» exchangedSize string true none the opposite size after fees in the fills
»» expiration string(date-time) false none when the placed order will expire and be automatically cancelled, in seconds from the unix epoch
»» filledSize string true none the filled size of the order
»» id string true none the internal ID associated with the order
»» market string true none a string composed of BASE/QUOTE representing the trading pair
»» priceAtPlacement string true none price at placement
»» remainingSize string true none the remaining size of the order to fill
»» side string true none the type of the order [BUY, SELL]
»» size string true none the size of the order
»» status string true none current status of the order [open, closed]
»» type string true none the category of the order [CN]
» success boolean true none whether the request was successful

orders_history

GET /v0/orders/history

Returns all open, closed, and filled orders for an account

Example responses

200 Response

{
  "type": "object",
  "required": [
    "success"
  ],
  "properties": {
    "error": {
      "description": "explanation if the request was not successful",
      "type": "string",
      "example": "Resource not found"
    },
    "error_code": {
      "description": "HTTP error code",
      "type": "string",
      "example": "404"
    },
    "result": {
      "description": "the result of the request, if it was successful",
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "market",
          "type",
          "side",
          "size",
          "filledSize",
          "remainingSize",
          "exchangedSize",
          "status",
          "createdAt",
          "clientId",
          "priceAtPlacement"
        ],
        "properties": {
          "cancelAbove": {
            "description": "max price at which the order should be filled, will be canceled if oracle price exceeds this",
            "type": "string",
            "example": "0.0125"
          },
          "cancelBelow": {
            "description": "min price at which the order should be filled, will be canceled if oracle price goes lower than this",
            "type": "string",
            "example": "0.0120"
          },
          "clientId": {
            "description": "the internal ID associated with the customer that placed the order",
            "type": "string",
            "example": "1665515317"
          },
          "createdAt": {
            "description": "the time the order was created",
            "type": "string",
            "format": "date-time",
            "example": "2022-08-31T21:55:09.552977086Z"
          },
          "exchangedSize": {
            "description": "the opposite size after fees in the fills",
            "type": "string",
            "example": "3"
          },
          "expiration": {
            "description": "when the placed order will expire and be automatically cancelled, in seconds from the unix epoch",
            "type": "string",
            "format": "date-time",
            "example": "1665686173"
          },
          "filledSize": {
            "description": "the filled size of the order",
            "type": "string",
            "example": "7.5"
          },
          "id": {
            "description": "the internal ID associated with the order",
            "type": "string",
            "example": "1436105356947779827"
          },
          "market": {
            "description": "a string composed of BASE/QUOTE representing the trading pair",
            "type": "string",
            "example": "AVAX/ETH"
          },
          "priceAtPlacement": {
            "description": "price at placement",
            "type": "string",
            "example": "0.0127"
          },
          "remainingSize": {
            "description": "the remaining size of the order to fill",
            "type": "string",
            "example": "2.5"
          },
          "side": {
            "description": "the type of the order [BUY, SELL]",
            "type": "string",
            "example": "SELL"
          },
          "size": {
            "description": "the size of the order",
            "type": "string",
            "example": "10"
          },
          "status": {
            "description": "current status of the order [open, closed]",
            "type": "string",
            "example": "open"
          },
          "type": {
            "description": "the category of the order [CN]",
            "type": "string",
            "example": "CN"
          }
        }
      }
    },
    "success": {
      "description": "whether the request was successful",
      "type": "boolean",
      "example": true
    }
  }
}

Responses

Status Meaning Description Schema
200 OK This json object is sent back to a good request Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» error string false none explanation if the request was not successful
» error_code string false none HTTP error code
» result [object] false none the result of the request, if it was successful
»» cancelAbove string false none max price at which the order should be filled, will be canceled if oracle price exceeds this
»» cancelBelow string false none min price at which the order should be filled, will be canceled if oracle price goes lower than this
»» clientId string true none the internal ID associated with the customer that placed the order
»» createdAt string(date-time) true none the time the order was created
»» exchangedSize string true none the opposite size after fees in the fills
»» expiration string(date-time) false none when the placed order will expire and be automatically cancelled, in seconds from the unix epoch
»» filledSize string true none the filled size of the order
»» id string true none the internal ID associated with the order
»» market string true none a string composed of BASE/QUOTE representing the trading pair
»» priceAtPlacement string true none price at placement
»» remainingSize string true none the remaining size of the order to fill
»» side string true none the type of the order [BUY, SELL]
»» size string true none the size of the order
»» status string true none current status of the order [open, closed]
»» type string true none the category of the order [CN]
» success boolean true none whether the request was successful

price

POST /v0/price

Gets the price of a specific trading pair

Body parameter

{
  "type": "object",
  "required": [
    "pair"
  ],
  "properties": {
    "pair": {
      "type": "object",
      "required": [
        "base",
        "quote"
      ],
      "properties": {
        "base": {
          "description": "the base coin of the currency pair",
          "type": "string",
          "example": "AVAX"
        },
        "quote": {
          "description": "the quote coin of the currency pair",
          "type": "string",
          "example": "ETH"
        }
      }
    }
  }
}

Parameters

Name In Type Required Description
body body object false This json object is passed to the endpoint
» pair body object true none
»» base body string true the base coin of the currency pair
»» quote body string true the quote coin of the currency pair

Example responses

200 Response

{
  "type": "object",
  "required": [
    "success"
  ],
  "properties": {
    "error": {
      "description": "explanation if the request was not successful",
      "type": "string",
      "example": "Resource not found"
    },
    "result": {
      "type": "object",
      "required": [
        "pair",
        "available",
        "price",
        "quotedAt"
      ],
      "properties": {
        "available": {
          "description": "whether the target pair is available",
          "type": "boolean",
          "example": true
        },
        "pair": {
          "type": "object",
          "required": [
            "base",
            "quote"
          ],
          "properties": {
            "base": {
              "description": "the base coin of the currency pair",
              "type": "string",
              "example": "AVAX"
            },
            "quote": {
              "description": "the quote coin of the currency pair",
              "type": "string",
              "example": "ETH"
            }
          }
        },
        "price": {
          "description": "the price of the target pair",
          "type": "string",
          "example": "0.0125"
        },
        "quotedAt": {
          "description": "the time at which the returned price was quoted",
          "type": "string",
          "example": "2022-08-31T21:30:57Z"
        }
      }
    },
    "success": {
      "description": "whether the request was successful",
      "type": "boolean",
      "example": true
    }
  }
}

Responses

Status Meaning Description Schema
200 OK This json object is sent back to a good request Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» error string false none explanation if the request was not successful
» result object false none none
»» available boolean true none whether the target pair is available
»» pair object true none none
»»» base string true none the base coin of the currency pair
»»» quote string true none the quote coin of the currency pair
»» price string true none the price of the target pair
»» quotedAt string true none the time at which the returned price was quoted
» success boolean true none whether the request was successful

prices

GET /v0/prices

Gets the price of all trading pairs

Example responses

200 Response

{
  "type": "object",
  "required": [
    "success"
  ],
  "properties": {
    "error": {
      "description": "explanation if the request was not successful",
      "type": "string",
      "example": "Resource not found"
    },
    "error_code": {
      "description": "HTTP error code",
      "type": "string",
      "example": "404"
    },
    "result": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "pair",
          "available",
          "price",
          "quotedAt"
        ],
        "properties": {
          "available": {
            "description": "whether the target pair is available",
            "type": "boolean",
            "example": true
          },
          "pair": {
            "type": "object",
            "required": [
              "base",
              "quote"
            ],
            "properties": {
              "base": {
                "description": "the base coin of the currency pair",
                "type": "string",
                "example": "AVAX"
              },
              "quote": {
                "description": "the quote coin of the currency pair",
                "type": "string",
                "example": "ETH"
              }
            }
          },
          "price": {
            "description": "the price of the target pair",
            "type": "string",
            "example": "0.0125"
          },
          "quotedAt": {
            "description": "the time at which the returned price was quoted",
            "type": "string",
            "example": "2022-08-31T21:30:57Z"
          }
        }
      }
    },
    "success": {
      "description": "whether the request was successful",
      "type": "boolean",
      "example": true
    }
  }
}

Responses

Status Meaning Description Schema
200 OK This json object is sent back to a good request Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» error string false none explanation if the request was not successful
» error_code string false none HTTP error code
» result [object] false none none
»» available boolean true none whether the target pair is available
»» pair object true none none
»»» base string true none the base coin of the currency pair
»»» quote string true none the quote coin of the currency pair
»» price string true none the price of the target pair
»» quotedAt string true none the time at which the returned price was quoted
» success boolean true none whether the request was successful

provision_address

POST /v0/provision_address

Provisions an address for deposit of an asset

Body parameter

{
  "type": "object",
  "required": [
    "symbol"
  ],
  "properties": {
    "symbol": {
      "type": "string"
    }
  }
}

Parameters

Name In Type Required Description
body body object false This json object is passed to the endpoint
» symbol body string true none

Example responses

200 Response

{
  "type": "object",
  "required": [
    "success"
  ],
  "properties": {
    "error": {
      "description": "explanation if the request was not successful",
      "type": "string",
      "example": "Resource not found"
    },
    "error_code": {
      "description": "HTTP error code",
      "type": "string",
      "example": "404"
    },
    "result": {
      "type": "object",
      "required": [
        "accountId",
        "symbol",
        "address"
      ],
      "properties": {
        "accountId": {
          "description": "the internal ID associated with the account that made the request",
          "type": "string",
          "example": "5577006791947779410"
        },
        "address": {
          "description": "the address provisioned for deposit",
          "type": "string",
          "example": "0xf684578b5da6ad084af1fc841bf24f67b4186257"
        },
        "symbol": {
          "type": "string"
        }
      }
    },
    "success": {
      "description": "whether the request was successful",
      "type": "boolean",
      "example": true
    }
  }
}

Responses

Status Meaning Description Schema
200 OK This json object is sent back to a good request Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» error string false none explanation if the request was not successful
» error_code string false none HTTP error code
» result object false none none
»» accountId string true none the internal ID associated with the account that made the request
»» address string true none the address provisioned for deposit
»» symbol string true none none
» success boolean true none whether the request was successful

wallet_balances

GET /v0/wallet/balances

Gets balances of all assets in wallet

Example responses

200 Response

{
  "type": "object",
  "required": [
    "success"
  ],
  "properties": {
    "error": {
      "description": "explanation if the request was not successful",
      "type": "string",
      "example": "Resource not found"
    },
    "error_code": {
      "description": "HTTP error code",
      "type": "string",
      "example": "404"
    },
    "result": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "coin",
          "total",
          "reserved",
          "free",
          "usdValue"
        ],
        "properties": {
          "coin": {
            "description": "the coin for which the customer requested balance",
            "type": "string",
            "example": "AVAX"
          },
          "free": {
            "description": "the free balance of the coin",
            "type": "string",
            "example": "3000"
          },
          "reserved": {
            "description": "the reserved balance of the coin, held in open orders",
            "type": "string",
            "example": "7000"
          },
          "total": {
            "description": "the total balance of the coin",
            "type": "string",
            "example": "10000"
          },
          "usdValue": {
            "description": "the approximate USD value of the currency",
            "type": "string",
            "example": "150000"
          }
        }
      }
    },
    "success": {
      "description": "whether the request was successful",
      "type": "boolean",
      "example": true
    }
  }
}

Responses

Status Meaning Description Schema
200 OK This json object is sent back to a good request Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» error string false none explanation if the request was not successful
» error_code string false none HTTP error code
» result [object] false none none
»» coin string true none the coin for which the customer requested balance
»» free string true none the free balance of the coin
»» reserved string true none the reserved balance of the coin, held in open orders
»» total string true none the total balance of the coin
»» usdValue string true none the approximate USD value of the currency
» success boolean true none whether the request was successful

wallet_deposit_address_list

POST /v0/wallet/deposit_address/list

Returns all addresses which have made deposits to a specific account

Body parameter

{
  "type": "object",
  "required": [
    "coins"
  ],
  "properties": {
    "coins": {
      "description": "a list of strings for which a customer wants to retrieve deposit addresses",
      "type": "array",
      "items": {
        "type": "string"
      },
      "example": [
        "AVAX",
        "ETH"
      ]
    }
  }
}

Parameters

Name In Type Required Description
body body object false This json object is passed to the endpoint
» coins body [string] true a list of strings for which a customer wants to retrieve deposit addresses

Example responses

200 Response

{
  "type": "object",
  "required": [
    "success"
  ],
  "properties": {
    "error": {
      "description": "explanation if the request was not successful",
      "type": "string",
      "example": "Resource not found"
    },
    "error_code": {
      "description": "HTTP error code",
      "type": "string",
      "example": "404"
    },
    "result": {
      "description": "the result of the request, if it was successful",
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "coin",
          "address"
        ],
        "properties": {
          "address": {
            "description": "the address provisioned for a specific coin",
            "type": "string",
            "example": "29b97b7819c7d8b593a599a3d3c237cac5520f62"
          },
          "coin": {
            "description": "the coin for which the customer provisioned an address",
            "type": "string",
            "example": "AVAX"
          }
        }
      }
    },
    "success": {
      "description": "whether the request was successful",
      "type": "boolean",
      "example": true
    }
  }
}

Responses

Status Meaning Description Schema
200 OK This json object is sent back to a good request Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» error string false none explanation if the request was not successful
» error_code string false none HTTP error code
» result [object] false none the result of the request, if it was successful
»» address string true none the address provisioned for a specific coin
»» coin string true none the coin for which the customer provisioned an address
» success boolean true none whether the request was successful

wallet_deposits

GET /v0/wallet/deposits

Returns all deposits to an account's wallet

Example responses

200 Response

{
  "type": "object",
  "required": [
    "success"
  ],
  "properties": {
    "error": {
      "description": "explanation if the request was not successful",
      "type": "string",
      "example": "Resource not found"
    },
    "error_code": {
      "description": "HTTP error code",
      "type": "string",
      "example": "404"
    },
    "result": {
      "type": "object",
      "required": [
        "coin",
        "size",
        "status",
        "txid",
        "time"
      ],
      "properties": {
        "coin": {
          "description": "the coin which was deposited",
          "type": "string",
          "example": "AVAX"
        },
        "currentConfirmations": {
          "description": "the current number of confirmations for a deposit, if it is pending",
          "type": "integer",
          "format": "int64",
          "example": 25
        },
        "requiredConfirmations": {
          "description": "the current number of confirmations required for a pending deposit to be confirmed",
          "type": "integer",
          "format": "int64",
          "example": 25
        },
        "size": {
          "description": "the amount of the coin deposited",
          "type": "string",
          "example": "10000"
        },
        "status": {
          "description": "the status of the deposit",
          "type": "string",
          "example": "confirmed"
        },
        "time": {
          "description": "the time the deposit was made",
          "type": "string",
          "format": "date-time",
          "example": "2019-03-05T09:56:55.728933+00:00"
        },
        "txid": {
          "description": "the transaction ID of the deposit",
          "type": "string",
          "example": "0x8078356ae4b06a036d64747546c274af19581f1c78c510b60505798a7ffcaf1"
        }
      }
    },
    "success": {
      "description": "whether the request was successful",
      "type": "boolean",
      "example": true
    }
  }
}

Responses

Status Meaning Description Schema
200 OK This json object is sent back to a good request Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» error string false none explanation if the request was not successful
» error_code string false none HTTP error code
» result object false none none
»» coin string true none the coin which was deposited
»» currentConfirmations integer(int64) false none the current number of confirmations for a deposit, if it is pending
»» requiredConfirmations integer(int64) false none the current number of confirmations required for a pending deposit to be confirmed
»» size string true none the amount of the coin deposited
»» status string true none the status of the deposit
»» time string(date-time) true none the time the deposit was made
»» txid string true none the transaction ID of the deposit
» success boolean true none whether the request was successful

wallet_deposits_csv

POST /v0/wallet/deposits/csv

Gets deposits for an account within the start and end times

Body parameter

{
  "type": "object",
  "properties": {
    "end_time": {
      "description": "End time in Unix time seconds to filter results",
      "type": "integer",
      "format": "int64",
      "example": 1666209371
    },
    "start_time": {
      "description": "Start time in Unix time seconds to filter results",
      "type": "integer",
      "format": "int64",
      "example": 1666203390
    }
  }
}

Parameters

Name In Type Required Description
body body object false This json object is passed to the endpoint
» end_time body integer(int64) false End time in Unix time seconds to filter results
» start_time body integer(int64) false Start time in Unix time seconds to filter results

Responses

Status Meaning Description Schema
200 OK CSV formatted text None

wallet_withdrawals

GET /v0/wallet/withdrawals

Returns all withdrawals from an account's wallet

Example responses

200 Response

{
  "type": "object",
  "required": [
    "success"
  ],
  "properties": {
    "error": {
      "description": "explanation if the request was not successful",
      "type": "string",
      "example": "Resource not found"
    },
    "error_code": {
      "description": "HTTP error code",
      "type": "string",
      "example": "404"
    },
    "result": {
      "type": "object",
      "required": [
        "coin",
        "size",
        "status",
        "address",
        "withdrawal_id",
        "time"
      ],
      "properties": {
        "address": {
          "description": "the address to which withdrawal was initiated",
          "type": "string",
          "example": "0x5a694a5Dd579636aC79C39A144940c335460931F"
        },
        "coin": {
          "description": "the coin which was withdrawn",
          "type": "string",
          "example": "AVAX"
        },
        "size": {
          "description": "the amount of the coin withdrawn",
          "type": "string",
          "example": "10000"
        },
        "status": {
          "description": "the status of the withdrawal",
          "type": "string",
          "example": "WITHDRAWAL_CONFIRMED"
        },
        "time": {
          "description": "the time that withdrawal was initiated",
          "type": "string",
          "format": "date-time",
          "example": "2019-03-05T09:56:55.728933+00:00"
        },
        "transaction_id": {
          "description": "the blockchain transaction ID",
          "type": "string",
          "example": "blah"
        },
        "withdrawal_id": {
          "description": "system-assigned unique withdrawal ID",
          "type": "string",
          "example": "d8f27783bd37ab94a9fd1d5acfc65e426668a913850829fb40b2646946b0f332"
        }
      }
    },
    "success": {
      "description": "whether the request was successful",
      "type": "boolean",
      "example": true
    }
  }
}

Responses

Status Meaning Description Schema
200 OK This json object is sent back to a good request Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» error string false none explanation if the request was not successful
» error_code string false none HTTP error code
» result object false none none
»» address string true none the address to which withdrawal was initiated
»» coin string true none the coin which was withdrawn
»» size string true none the amount of the coin withdrawn
»» status string true none the status of the withdrawal
»» time string(date-time) true none the time that withdrawal was initiated
»» transaction_id string false none the blockchain transaction ID
»» withdrawal_id string true none system-assigned unique withdrawal ID
» success boolean true none whether the request was successful

wallet_withdrawals_csv

POST /v0/wallet/withdrawals/csv

Gets withdrawals for an account within the start and end times

Body parameter

{
  "type": "object",
  "properties": {
    "end_time": {
      "description": "End time in Unix time seconds to filter results",
      "type": "integer",
      "format": "int64",
      "example": 1666209371
    },
    "start_time": {
      "description": "Start time in Unix time seconds to filter results",
      "type": "integer",
      "format": "int64",
      "example": 1666203390
    }
  }
}

Parameters

Name In Type Required Description
body body object false This json object is passed to the endpoint
» end_time body integer(int64) false End time in Unix time seconds to filter results
» start_time body integer(int64) false Start time in Unix time seconds to filter results

Responses

Status Meaning Description Schema
200 OK CSV formatted text None

withdraw

POST /v0/withdraw

Initiates a withdrawal

Body parameter

{
  "type": "object",
  "required": [
    "symbol",
    "amount",
    "address"
  ],
  "properties": {
    "address": {
      "description": "the address to initiate withdrawal to",
      "type": "string",
      "example": "0x29b97b7819c7d8b593a599a3d3c237cac5520f62"
    },
    "amount": {
      "description": "the amount of the target coin to withdraw",
      "type": "string",
      "example": "10"
    },
    "symbol": {
      "type": "string"
    }
  }
}

Parameters

Name In Type Required Description
body body object false This json object is passed to the endpoint
» address body string true the address to initiate withdrawal to
» amount body string true the amount of the target coin to withdraw
» symbol body string true none

Example responses

200 Response

{
  "type": "object",
  "required": [
    "success"
  ],
  "properties": {
    "error": {
      "description": "explanation if the request was not successful",
      "type": "string",
      "example": "Resource not found"
    },
    "error_code": {
      "description": "HTTP error code",
      "type": "string",
      "example": "404"
    },
    "result": {
      "type": "object",
      "required": [
        "withdrawal_status",
        "withdrawal_id"
      ],
      "properties": {
        "withdrawal_id": {
          "description": "the ID associated with the withdrawal",
          "type": "string",
          "example": "41ff4b35112ccfa3e466f302c914f323f5687e048a8e2fd82bcdcdcb9eb47571"
        },
        "withdrawal_status": {
          "description": "the status of the withdrawal",
          "type": "string",
          "example": "WITHDRAWAL_PENDING"
        }
      }
    },
    "success": {
      "description": "whether the request was successful",
      "type": "boolean",
      "example": true
    }
  }
}

Responses

Status Meaning Description Schema
200 OK This json object is sent back to a good request Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» error string false none explanation if the request was not successful
» error_code string false none HTTP error code
» result object false none none
»» withdrawal_id string true none the ID associated with the withdrawal
»» withdrawal_status string true none the status of the withdrawal
» success boolean true none whether the request was successful