Nonlinear Programming Methods
Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

biscoint-api-node

1.2.3 • Public • Published

Biscoint API Node

NodeJS library for interacting with Biscoint's API. In order to call private methods, you'll need a Biscoint verified account to generate the API key and secret.

Biscoint is a cryptocurrency marketplace that allows trading BTC in multiple brazilian exchanges with a single account.

Example

Check out biscoint-arbitrage-bot, for it showcases the use of many of the methods in this library in an arbitrage bot application.

Install with NPM

  npm i biscoint-api-node

Install with Yarn

  yarn add biscoint-api-node

Instantiate Biscoint class

import Biscoint from 'biscoint-api-node';
 
 
// configure here with your keys for private calls, public calls don't need valid keys
const bc = new Biscoint({
  apiKey: 's4t0sh1n4k4m0t0',
  apiSecret: 's4t0sh1n4k4m0t0',
});
 

All methods return a Promise.

Public methods

Ticker


Get Biscoint ticker

bc.ticker();

Returns

{
  base: 'BTC',
  quote: 'BRL',
  vol: 0.00155952,
  low: 32061.15,
  high: 32061.15,
  last: 32061.15,
  ask: 32088.7,
  askQuoteAmountRef: 1000,
  askBaseAmountRef: 0.03116362,
  bid: 29961.9,
  bidQuoteAmountRef: 1000,
  bidBaseAmountRef: 0.03337572,
  timestamp: '2019-12-10T20:22:29.172Z'
}

Fees


Get Biscoint fees

bc.fees();

Returns

{
  withdrawal: {
    BTC: {
      rate: "0.0",
      fixed: {
        slow: "0.0001",
        normal: "0.0002",
        fast: "0.0004"
      }
    },
    BRL: {
      rate: "0.0",
      fixed: {
        ted: "14.90",
        sameBankTransfer: "14.90"
      }
    }
  }
}

Rate limits


Get Biscoint fees

bc.meta();

Returns

{
  version: "v1",
  endpoints: {
    ticker: {
      get: {
        type: "public",
        rateLimit: {
          windowMs: 60000,
          maxRequests: 6,
          rate: "6 per 1 minute"
        }
      }
    },
    fees: {
      get: {
        type: "public",
        rateLimit: {
          windowMs: 60000,
          maxRequests: 2,
          rate: "2 per 1 minute"
        }
      }
    },
    meta: {
      get: {
        type: "public",
        rateLimit: {
          windowMs: 60000,
          maxRequests: 2,
          rate: "2 per 1 minute"
        }
      }
    },
    balance: {
      get: {
        type: "private",
        rateLimit: {
          windowMs: 60000,
          maxRequests: 12,
          rate: "12 per 1 minute"
        }
      }
    },
    offer: {
      get: {
        type: "private",
        rateLimit: {
          windowMs: 60000,
          maxRequests: 24,
          rate: "24 per 1 minute"
        }
      },
      post: {
        type: "private",
        rateLimit: {
          windowMs: 60000,
          maxRequests: 24,
          rate: "24 per 1 minute"
        }
      }
    },
    trades: {
      get: {
        type: "private",
        rateLimit: {
          windowMs: 60000,
          maxRequests: 12,
          rate: "12 per 1 minute"
        }
      }
    }
  }
}

Private methods

Balance


Get your account balance

bc.balance();

Returns

{
  BRL: 5000.00,
  BTC: 0.001
}

Offer


Request a new offer for amount, and side that you specify.

bc.offer({ amount: 0.01, isQuote: false, op: "buy" });

Returns

{
  offerId: "hHaJuKF2m5aD8mZn4",
  base: "BTC",
  quote: "BRL",
  op: "buy",
  isQuote: false,
  baseAmount: "0.01000000",
  quoteAmount: "362.69",
  efPrice: "36269.00",
  createdAt: "2020-01-22T22:39:16.874Z",
  expiresAt: "2020-01-22T22:39:31.874Z",
  apiKeyId: "BdFABxNakZyxPwnRu"
}

Confirm Offer


Confirm offer passing an orderId

bc.confirmOffer({ offerId: "5d9s8w6d12"});

Returns

{
  offerId: "hHaJuKF2m5aD8mZn4",
  base: "BTC",
  quote: "BRL",
  op: "buy",
  isQuote: false,
  baseAmount: "0.01000000",
  quoteAmount: "362.69",
  efPrice: "36269.00",
  createdAt: "2020-01-22T22:39:16.874Z",
  confirmedAt: "2020-01-22T22:39:16.945Z",
  apiKeyId: "BdFABxNakZyxPwnRu"
}

Get last trades


Returns last 20 trades

bc.trades({ op: 'sell' });

Returns

[
  {
    "id": "D6x63B3q3Mec4tggY",
    "offerId": "aX2Bkd8MseB20Axbkba",
    "op": "buy",
    "base": "BTC",
    "quote": "BRL",
    "baseAmount": "0.01000000",
    "quoteAmount": "362.82",
    "apiKeyId": "BdFABxNakZyxPwnRu",
    "efPrice": "36282.00",
    "date": "2020-01-22T23:25:02.785Z"
  },
  ...
]
 

Keywords

none

Install

npm i biscoint-api-node

DownloadsWeekly Downloads

23

Version

1.2.3

License

MIT

Unpacked Size

16.9 kB

Total Files

6

Last publish

Collaborators

  • avatar
  • avatar
  • avatar
  • avatar