• Public
  • Public/Protected
  • All


A simple to use interface to Bity's services.


npm install @bity/api @bity/models

There is a good chance you will be interested in profit sharing. In order to participate please read this.

NOTE: If an invalid client id is given, requests to create orders will be treated as if no client id was given at all.


Initializing the client is easy:

const bity = new BityApiClient({
  exchangeApiUrl: 'https://exchange.api.bity.com/v2/',
  clientId: 'my-client-id'

Now it's ready to make some requests!

Categories of usage

The BityApiClientInterface shows all possible methods that can be run against our services. Since our API will continue to grow to support new features, such as authentication, it needs to be made clear how everything is expected to be used together.

The following are a few examples.

Exchange API

For most, they will want to simply make some orders against Bity's Exchange API. Before any orders can be made, the user needs to determine:

  1. How do I create my order?
  2. What will be the amount I get?
  3. How do I send my order?
  4. Where are the payment details for an order?
  5. What is the status of the order?

First we setup our client, and then we can do the following:

  .then((new Order())                                              // 1
    .setInput('BTC', '12.00')
      .do((input) => input.setCryptoAddress(mySendingAddr))
      .do((output) => output.setCryptoAddress(myReceivingAddr))
  .then(preparedOrder => bity.fetchEstimateForOrder(preparedOrder) // 2
    .then(estimatedOrder => alert(estimatedOrder.output.amount))
    .then(() => bity.createOrder(preparedOrder))                   // 3
  .then(bity.fetchOrderWithUrl)                                    // 4 and 5!
  .then(createdOrder => alert(createdOrder.paymentDetails))

We can see the majority of the work is getting the information to create an order.

More complex usage would be checking for pair availability with BityApiClientInterface.fetchPairs() or getting more information on a specific currency with BityApiClientInterface.fetchCurrencies().

Generated using TypeDoc