NAV
shell javascript

Introduction

The Braveno platform provides a collection of APIs to help you integrate with blockchain based financial infrastructure.

The most common use-cases are:

Trading. Traders can use our Exchange API to connect through their own trading terminal software, or write bots that automatically trade based on algorithms, while brokerages and payment providers can use it to power their own platforms.

Transfers. Merchants can use our Transaction API to receive payments in virtual currencies or e-money, and institutions can use it for settlement of any financial instrument.

Issuance. Institutions and other issuers can use our Issuance API to issue digital financial instruments.

Getting started

Complete these three easy steps to get started using the Braveno platform.

Step 1: Create a Braveno account

Go to https://my.braveno.com/get-started and create an account, make sure to complete the identification steps required for your desired usage.

Step 2: Add an API token for your application

Once you’ve created a Braveno platform account, go to the settings page to manage your API tokens. Instructions on how to authenticate are here: Token based authentication

Step 3: Connect to the API securely

The Braveno platform authenticates on a per-request basis only over HTTPS using basic authentication. Many HTTP libraries have strong support for basic authentication out of the box so this allows you to get up and running quickly.

Select an HTTPS library and an SDK and supply your API secret to authenticate.

HTTPS libraries:

Language Link
Java (including Android) http://unirest.io/java.html
Node.js (Javascript) http://unirest.io/nodejs.html
Objective-C http://unirest.io/objective-c.html
.NET http://unirest.io/net.html
Python http://unirest.io/python.html
PHP http://unirest.io/php.html
Ruby http://unirest.io/ruby.html

SDKs:

Language Link API
Java https://github.com/Braveno/cosigner-client-java Transaction API
Javascript https://github.com/Braveno/cosigner-client-js Transaction API

Congratulations, you are ready to start developing!

Authentication

The Braveno platform currently supports two forms of authentication: Cookie Based Authentication and Token Based Authentication. We advise all new application development to use Token Based Authentication.

After successfully creating and verifying your account, you can submit your credentials (username and password) against our login endpoint.

To authorize, use this code:

curl -X POST -H "Content-Type: application/json" -d '{
    "username":"{{username}}",
    "password":"{{password}}"
}' "https://api.braveno.com/login"

Sample response

{
  "username":"{{username}}",
  "user_id":"{{user_id}}",
  "email":"{{email}}"
}

A Secure and HttpOnly cookie will be set and must be included in any subsequent requests or those requests will otherwise fail.

Token based authentication

After successfully creating an API token in API Access in your Braveno account, you may use this token to authenticate calls to the Braveno platform API.

The Braveno platform authenticates on a per-request basis using Http basic auth. You will be required to send your API key along with your API secret. The motivation for using Http basic authentication is that most Http libraries support it very well will ultimately extend the reach of the Braveno Platform.

This example code request all your ETH-BTC fills

curl -X POST -u {{apikey}}:{{apisecret}} "https://api.braveno.com/products/ETH-BTC/fills"

Errors

The Braveno platform uses conventional HTTP response codes. A 2xx response indicates the request was successful. A 4xx response is generally an well defined error and will provide the necessary information about the failure. A 5xx error indicates some unknown error happened on the Braveno platform servers— this error should rarely happen.

Exchange API

Get API server time

Requires authentication?: no

Get the REST API server time in milliseconds since epoch and RFC-3339 format.

curl https://api.braveno.com/time

Example response

{
    "epoch":1508426752102,
    "iso":"2017-10-19T15:25:52.102Z"
}

List available products

Requires authentication?: no

List the products available on the Braveno exchange.

curl https://api.braveno.com/products

Example response

[
  {
    "id": 3,
    "currency_pair": "ETH-BTC",
    "display_name": "ETH/BTC",
    "base": "ETH",
    "quote": "BTC",
    "base_min_size": 0.01,
    "base_max_size": 10000.0,
    "quote_increment": 1e-05,
    "enabled": true
  },
  {
    "id": 4,
    "currency_pair": "BRV-ETH",
    "display_name": "BRV/ETH",
    "base": "BRV",
    "quote": "ETH",
    "base_min_size": 0.01,
    "base_max_size": 10000.0,
    "quote_increment": 0.01,
    "enabled": true
  },
  {
    "id": 5,
    "currency_pair": "BRV-BTC",
    "display_name": "BRV/BTC",
    "base": "BRV",
    "quote": "BTC",
    "base_min_size": 0.01,
    "base_max_size": 10000.0,
    "quote_increment": 0.01,
    "enabled": true
  }
]

List currencies

Requires authentication?: no

List available currencies on Braveno.

curl https://api.braveno.com/currencies

Example response

[
  {
    "symbol": "BRV",
    "backing_symbol": "BRVT",
    "name": "Braveno",
    "label": "Braveno",
    "minfractiondigits": 0,
    "maxfractiondigits": 18,
    "qrprefix": "ethereum:",
    "qrchecksum": "ETH",
    "displayable": true
  },
  {
    "symbol": "BRVT",
    "backing_symbol": "ETHR",
    "name": "Braveno",
    "label": "Braveno",
    "minfractiondigits": 0,
    "maxfractiondigits": 18,
    "qrprefix": "ethereum:",
    "qrchecksum": "ETH",
    "displayable": false
  },
  {
    "symbol": "BTC",
    "backing_symbol": null,
    "name": "Bitcoin",
    "label": "Bitcoin",
    "minfractiondigits": 0,
    "maxfractiondigits": 8,
    "qrprefix": "bitcoin:",
    "qrchecksum": "none",
    "displayable": true
  },
  {
    "symbol": "ETH",
    "backing_symbol": "ETHR",
    "name": "Ethereum",
    "label": "Ether",
    "minfractiondigits": 0,
    "maxfractiondigits": 18,
    "qrprefix": "ethereum:",
    "qrchecksum": "ETH",
    "displayable": true
  }
]

Trades

Get the latest trades for the currency pair.

Requires authentication? no

curl https://api.braveno.com/products/:product_id:/trades

Example response

[{
    "trade_id":1,
    "created":"2016-1-1T15:53:12Z",
    "taker_id":"dde8303a-78e3-41fa-93d6-5e541489f982",
    "maker_id":"1b038c62-aed5-480d-a4a9-ea4bc62b0122",
    "quantity":1.0000000000000000,
    "price":1.0000000000000000,
    "product_id":"ETH-BTC",
    "state":"matched"
}]

URL Parameters

Parameter Type Description
product_id string Currency pair E.g “ETH-BTC” see products

Tickers

Retrieve the latest snapshot about the last trade

Requires authentication? no

curl https://api.braveno.com/products/:product_id:/ticker

Example response

{
  "bid": 0,
  "ask": 1500.00035,
  "24hr_volume": 0,
  "24hr_change": 0,
  "trade_id": 0,
  "last_price": 0,
  "last_size": 0,
  "last_timestamp": "0"
}

URL Parameters

Parameter Type Description
product_id string Currency pair E.g. “ETH-BTC”

Place a new order

Requires authentication? yes

You can place the following types of orders: limit and market orders. An order will be placed on the appropriate order book if and only if sufficient funds are available in your account.

In a trading pair there is a base currency and a quote currency, as an example in ETH/BTC, ETH would be the base currency, and BTC would be the quote currency.

The order side refers to whether you are bidding or asking, when you place a bid, you are bidding the quote currency for the base currency, or in other words, buying the base currency for the quote currency. When you place an ask, you are asking the quote currency for the base currency, or in other words, selling the base currency for the quote currency. As an example, in the ETH/BTC pair a bid would represent the buying of ETH for BTC, and an ask would represent the selling of ETH for BTC.

curl -X POST -u {{apikey}}:{{apisecret}} \
  -H "Content-Type: application/json" -d '{
  "side":"bid",
  "price":"4",
  "quantity":"1",
  "wallet_id":"d3f3da2e-20ab-4a99-ae02-e8d3d7b1f344",
  "account_id":"e8ab4e69-3df1-49c1-ac37-559557ec9fde"
}
' https://api.braveno.com/products/:product_id:/orders

Example response

{
  "msg": "Limit Order Accepted",
  "order-id": "4f3d438d-ab3e-42e0-9df2-8a5c637af7a7"
}

URL Parameters

Parameter Type Description
product_id string Currency pair E.g. “ETH-BTC”

Request Parameters:

Parameter Type Description
side string “bid” or “ask”
price string Quoted decimal amount to spend per unit
quantity string Quoted decimal amount to buy or sell
wallet_id uuid Wallet ID
account_id uuid Account ID
time_in_force string Optional “gtc” or “fok” (Default “gtc”)

Cancel an order

This will cancel an already existing order.

Requires authentication? yes

curl -X POST -u {{apikey}}:{{apisecret}} \
  https://api.braveno.com/products/:product_id:/order/:order_id

Example response

{
  "msg": "order canceled"
}

URL Parameters

Parameter Type Description
product_id string Currency pair E.g. “ETH-BTC”
order_id uuid The order identifier

Cancel all open orders

This will cancel all your outstanding orders for the selected product.

Requires authentication? yes

curl -X POST -u {{apikey}}:{{apisecret}} \
  https://api.braveno.com/products/:product_id:/orders/cancel

Example response

{
  "msg": "Open orders canceled"
}

URL Parameters

Parameter Type Description
product_id string Currency pair E.g. “ETH-BTC”

List orders

Retrieve a list of all your open orders by default for the selected product.

Requires authentication? no

curl https://api.braveno.com/products/:product_id:/orders

Example response

{
  "base_currency": "eth",
  "bids": [
    [
      3,
      [
        {
          "time_in_force": "gtc",
          "remaining": 9,
          "type": "limit-order",
          "created": 1485461617576,
          "user_id": "ae41f5f9-659d-4c41-a41d-bb208af9c4ca",
          "post_only?": false,
          "order_id": "769baf97-d088-4579-be3b-199bdd9047b0",
          "side": "bid",
          "quantity": 9,
          "wallet_id": "d3f3da2e-20ab-4a99-ae02-e8d3d7b1f344",
          "price": 3,
          "product_id": "ETH-BTC"
        }
      ]
    ]
  ],
  "id": "132b16a1-dc02-4df1-ada0-0c657b653f53",
  "sequence": 9,
  "market": "ETH-BTC",
  "trade_sequence": 2,
  "quote_currency": "btc",
  "asks": []
}

URL Parameters

Parameter Type Description
product_id string Currency pair E.g. “ETH-BTC”

Get an order

Retrieve a specific order by id.

Requires authentication? yes

curl -u {{apikey}}:{{apisecret}} \
  https://api.braveno.com/products/:product_id:/orders/:order_id:

Sample response

{
 "time_in_force": "gtc",
 "remaining": 9,
 "type": "limit-order",
 "created": 1485461617576,
 "user_id": "ae41f5f9-659d-4c41-a41d-bb208af9c4ca",
 "post_only?": false,
 "order_id": "769baf97-d088-4579-be3b-199bdd9047b0",
 "side": "bid",
 "quantity": 9,
 "wallet_id": "d3f3da2e-20ab-4a99-ae02-e8d3d7b1f344",
 "price": 3,
 "product_id": "ETH-BTC"
}

URL Parameters

Parameter Type Description
product_id string Currency pair E.g. “ETH-BTC”
order_id uuid The order identifier

Fills

Returns a list of fills for the authenticated user

Requires authentication? yes

curl -X POST -u {{apikey}}:{{apisecret}} https://api.braveno.com/products/:product_id:/fills

Example response

[
  {
    "fee": 0,
    "symbol": "ETH-BTC",
    "created": "2017-01-26T17:50:30Z",
    "is_bid": true,
    "trade_id": 1,
    "order_id": "0d4001a5-d797-4da8-bbb7-92622043cb16",
    "sequence": 145,
    "user_id": "ae41f5f9-659d-4c41-a41d-bb208af9c4ca",
    "is_maker": true,
    "quantity": 1,
    "price": 1
  },
  {
    "fee": 0,
    "symbol": "ETH-BTC",
    "created": "2017-01-26T17:50:30Z",
    "is_bid": false,
    "trade_id": 1,
    "order_id": "5990eb18-66b7-4a90-9619-49f5370b71d8",
    "sequence": 146,
    "user_id": "ae41f5f9-659d-4c41-a41d-bb208af9c4ca",
    "is_maker": false,
    "quantity": 1,
    "price": 1
  }
]

URL Parameters

Parameter Type Description
product_id string Currency pair E.g. “ETH-BTC”

Get deposit wallets

Your exchange wallets contain your deposit addresses. You should always use the most recent one based on the date it returns.

Requires authentication? yes

curl -X POST -u {{apikey}}:{{apisecret}} https://api.braveno.com/wallets/GetWallets

Example response

{"wallets":
  {
    "00-account-uuid-1234": {
      "id": "00-account-uuid-1234",
      "name": "Account Name",
      "wallets": {
        "00-wallet-uuid-1234": {
          "id": "00-wallet-uuid-1234",
          "name": "Wallet Name",
          "balance": 0,
          "keys": [
            "addresses": [{
              "address": "address1",
              "balance": 0.00,
              "actualBalance": 0.00,
              "pendingBalance": 0.00,
              "created": 123465771
            },
            {
              "address": "address2",
              "balance": 0.00,
              "actualBalance": 0.00,
              "pendingBalance": 0.00,
              "created": 1234634242
            }],
            "currency": "BTC",
            "publicKey": "",
            "checksum": "",
            "encryptedKey": "",
            "isAccessKey": true,
            "keyType": "single",
            "numRequired": 1,
            "prime": "",
            "salt": "",
            "shares": {}
          ]
        }
      }
    }
  }
}

Get a new deposit address

Allows you to generate a new deposit address. On getting a success status, you will have to request your wallets to see the new address.

Requires authentication? yes

curl -X POST -u {{apikey}}:{{apisecret}} https://api.braveno.com/wallets/GetNewAddress

Example response: Status 200

Transfer from a wallet to an address

Request a transfer from your wallet to another address.

Requires authentication? yes

curl -X POST -u {{apikey}}:{{apisecret}} https://api.braveno.com/wallets/Withdraw -d '{
"account_id":"e8ab4e69-3df1-49c1-ac37-559557ec9fde",
"wallet_id":"d3f3da2e-20ab-4a99-ae02-e8d3d7b1f344",
"currency": "BTC",
"amount": "3.14",
"destination": "address1234"
}'

Example response: Status 200

List exchange transactions

Get all exchange transactions for this user.

Requires authentication? yes

curl -X POST -u {{apikey}}:{{apisecret}} https://api.braveno.com/wallets/ListExchangeTransactions
[
  {
    "amount": 1.0,
    "txDate": 1508787390000,
    "fromAddress": [],
    "txHash": 118,
    "toAddress": [],
    "minConfirmations": 1,
    "currencySymbol": null,
    "confirmed": true,
    "confirmations": 1,
    "details": "Trade"
  },
  {
    "amount": 1.0,
    "txDate": 1508787390000,
    "fromAddress": [],
    "txHash": 119,
    "toAddress": [],
    "minConfirmations": 1,
    "currencySymbol": null,
    "confirmed": true,
    "confirmations": 1,
    "details": "Trade"
  }
]

User operations

Creating a user

Create a new Braveno user

Requires authentication? no

curl -X POST -u {{apikey}}:{{apisecret}} -d '{"username":"another-test-acct","password":"changeme", "email":"noreply@braveno.com"} https://api.braveno.com/users'

Example reponse: 200

Listing user orders

Get orders for the authenticated user.

Requires authentication? yes

curl -u {{apikey}}:{{apisecret}} https://api.braveno.com/users/orders

Example response:

[
  {
    "fee": 0.000998,
    "symbol": "ETH-BTC",
    "created": "2017-10-23T20:42:11Z",
    "is_bid": false,
    "trade_id": 144,
    "order_id": "851bafdf-ceee-4676-b299-8fc2d7978c05",
    "sequence": 145,
    "user_id": "d53d2e41-65cc-47f1-b4b2-7013a04276a7",
    "is_maker": true,
    "quantity": 0.998,
    "price": 1.0
  },
  {
    "fee": 2e-06,
    "symbol": "ETH-BTC",
    "created": "2017-10-24T15:28:35Z",
    "is_bid": false,
    "trade_id": 145,
    "order_id": "851bafdf-ceee-4676-b299-8fc2d7978c05",
    "sequence": 146,
    "user_id": "d53d2e41-65cc-47f1-b4b2-7013a04276a7",
    "is_maker": true,
    "quantity": 0.002,
    "price": 1.0
  }
]

Listing user trades

Get executed trades for the authenticated user

Requires authentication? yes

curl  -u {{apikey}}:{{apisecret}} http://api.braveno.com/users/trades

Example response:

[
  {
    "fee": 0.000998,
    "symbol": "ETH-BTC",
    "created": "2017-10-23T20:42:11Z",
    "is_bid": false,
    "trade_id": 144,
    "order_id": "851bafdf-ceee-4676-b299-8fc2d7978c05",
    "sequence": 145,
    "user_id": "d53d2e41-65cc-47f1-b4b2-7013a04276a7",
    "is_maker": true,
    "quantity": 0.998,
    "price": 1.0
  },
  {
    "fee": 2e-06,
    "symbol": "ETH-BTC",
    "created": "2017-10-24T15:28:35Z",
    "is_bid": false,
    "trade_id": 145,
    "order_id": "851bafdf-ceee-4676-b299-8fc2d7978c05",
    "sequence": 146,
    "user_id": "d53d2e41-65cc-47f1-b4b2-7013a04276a7",
    "is_maker": true,
    "quantity": 0.002,
    "price": 1.0
  }
]

Listing user transactions

Lists transactions to and from the authenticated user’s wallets

Requires authentication? yes

curl  -u {{apikey}}:{{apisecret}} https://api.braveno.com/users/transactions

Example response

[
  {
    "minConfirmations": 10,
    "txHash": "0x3d2887600f0522e9010a929b49b914137be24606497b97bbfd09f7339cb3fae8",
    "toAddress": [
      "3dc3384d6a8dc4418ea0834709e77623ee1d06d3"
    ],
    "confirmations": 12346,
    "currencySymbol": "ETH",
    "amount": 2.998,
    "txDate": 1508779587000,
    "fromAddress": [
      "3dc3384d6a8dc4418ea0834709e77623ee1d06d3"
    ],
    "data": null,
    "confirmed": true
  }
]

Get wallet balance

Given an account id and a wallet id, gives the balance of that wallet.

Requires authentication? yes

curl -X POST -u {{apikey}}:{{apisecret}} https://api.braveno.com/users/balance -d '{"account_id": "fefg0aef-31f0-4e19-b619-437d9a823ecd",
 "wallet_id": "9ee84475-3ec1-425a-875e-6885ec2f9147"}'

Example reponse:

{
  "btc": 18.71881866455078,
  "btcsettlement": "2017-10-25T16:31:49Z",
  "eth": 4.8153156042099,
  "ethsettlement": "2017-10-25T16:31:49Z"
}

Get user profile information

Get the profile information for the authenticated user

Requires authentication? yes

curl -X POST -u {{apikey}}:{{apisecret}} https://api.braveno.com/users/profile

Example response:

{
  "postal_code": "L0L 0L0",
  "address": "",
  "email": "noreply@braveno.com",
  "first_name": "Example",
  "phone_number": "User",
  "logins": [
    {
      "user_id": "d53d2e41-65cc-47f1-b4b2-7013a04276a7",
      "location": "0.0.0.0",
      "login_time": "2017-10-23T17:03:57Z"
    },
    {
      "user_id": "d53d2e41-65cc-47f1-b4b2-7013a04276a7",
      "location": "255.255.255.255",
      "login_time": "2017-10-23T17:03:33Z"
    }
  ],
  "house_number": "",
  "city": "",
  "username": "example-user",
  "county": "",
  "surnames": "",
  "is_email_verified": true,
  "totp_enabled": 0,
  "failed_logins": [],
  "uuid": "d53d2e41-65cc-47f1-b4b2-7013a04276a7",
  "country": "",
  "road": ""
}

Update user profile

Update user profile data.

Requires authentication? yes

curl -X POST -u {{apikey}}:{{apisecret}} -d '{
"first_name":"example",
"surnames":"user",
"house_number":4,
"county":"York",
"road":"Hanwell st.",
"city":"Moncton",
"postal_code":"L0L 0L0",
"address":"4 Hanwell St.",
"country":"Canada",
"phone_number":"+44444444455",
"email":"noreply@braveno.com",
}'  https://api.braveno.com/users/update-profile

Example response: 200

Get user accounts

Get a list of user accounts, which is a named list of wallets.

Requires authentication? yes

curl -X POST -u {{apikey}}:{{apisecret}} "https://api.braveno.com/users/accounts"

Example response:

{
  "fef9b7ef-31f0-4e19-b619-437d9a823ecd": {
    "id": "fef9b7ef-21f0-4e19-b619-437d9a823ecd",
    "name": "Personal",
    "wallets": {
      "9ee84475-3ec1-425a-875e-6885ec2f9147": {
        "id": "9ee84475-3ec1-425a-875e-6885ec2f9147",
        "name": "Personal",
        "balance": 0,
        "keys": [
          {
            "salt": "",
            "addresses": [
              {
                "address": "3dc3384d6a84c4418ea0834709e77623ee1d06d3",
                "balance": 2.998,
                "actualBalance": 2.998,
                "pendingBalance": 0.0009779799729586,
                "created": "2017-10-23T17:12:22Z"
              }
            ],
            "numRequired": 1,
            "keyType": "SINGLE",
            "prime": "",
            "currency": "ETH",
            "publicKey": "",
            "checksum": "",
            "isAccessKey": true,
            "shares": [],
            "encryptedKey": "c2a2c665-ab34-43ee-b86e-abbfe2ccc4c5"
          },
          {
            "salt": "",
            "addresses": [
              {
                "address": "2MwdD9vFXAbos9aK5u4yNcHDNmg1TFjxtuU",
                "balance": 0.0,
                "actualBalance": 0.0,
                "pendingBalance": 0.0,
                "created": "2017-10-23T21:34:29Z"
              }
            ],
            "numRequired": 1,
            "keyType": "SINGLE",
            "prime": "",
            "currency": "BTC",
            "publicKey": "",
            "checksum": "",
            "isAccessKey": true,
            "shares": [],
            "encryptedKey": "a0650190-3d8d-4eb3-858d-dc1d0ee67eb6"
          }
        ]
      }
    }
  }
}

Get user API keys

Get all API keys for the authenticated user.

Requires authentication? yes

curl -u {{apikey}}:{{apisecret}} "https://api.braveno.com/users/api-keys"

Example response:

[
  "abe15275-f80f-4420-8219-492e4cb52cc0"
]

Create a user API key

Generate a new API key and API secret pair.

Requires authentication? yes

curl -X POST -u {{apikey}}:{{apisecret}} https://api.braveno.com/users/api-keys

Example reponse:

{
  "api_key": "e2c96687-badf-00db-b263-587fbcbbba9a",
  "api_secret": "anapisecret"
}

Revoke a user API key

Revoke an API key from the authenticated user.

Requires authentication? yes

curl -X DELETE -u {{apikey}}:{{apisecret}} https://api.braveno.com/users/api-keys/:api_key:

Example reponse:

{
  "message": "API key revoked"
}

URL Parameters

Parameter Type Description
api_key string A UUID like string

Realtime streaming API

The real time streaming API is a Websocket-based API that allows you to receive market data for orders and trades from the Braveno platform in real-time. In order to initiate a session with the Websocket API you must first subscribe to a particular currency pair such as: ETH-BTC. To subscribe to an order book feed, you must send a JSON message after you’ve successfully initiated a connection with the real-time API endpoint. The format is as follows:

The real-time API endpoint: wss://api.braveno.com:9001

{
  “product_id” : “ETH-BTC”
}

When you’ve subscribed to a market data feed via the real-time Websocket API, you will be notified of the following events.

Order Received: An order received event is raised when the Braveno platform first sees that an order has been placed. The order is valid but has not yet been posted to the order book.

Order Opened: An order opened event is raised when the order has been posted to the order book.

Order Changed: Anytime an order is filled partially or in full, an order changed event is raised indicating by how much the order has been filled. The changed remaining will always be less than the previous remaining amount.

Order Canceled: An order canceled event gets raised when you cancel an order that’s currently on the order book.

Order Completed: An order completed event is raised when an order is completely filled and is removed from the order book.

Trade Matched: A trade matched event is raised when an order has been matched and a trade has occurred.