Socket
Book a DemoInstallSign in
Socket

b2trader

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

b2trader

Node.js client for the B2Trader

latest
Source
npmnpm
Version
1.6.0
Version published
Maintainers
1
Created
Source

B2Trader CI GitHub version npm version Known Vulnerabilities Coverage Status code style: prettier semantic-release Conventional Commits GitHub top language node-current npm License

Node.js library for the B2Trader's API.

Installation

npm install b2trader

Usage

PublicClient

import { PublicClient } from "B2Trader";
const url = "https://api.b2bx.exchange:8443/trading"; // B2Trader's url
const client = new PublicClient({ url });
  • .getInstruments()
const instruments = await client.getInstruments();
  • .getAssets()
const assets = await client.getAssets();
  • .getListOfInstruments()
const instruments = await client.getListOfInstruments();
  • .getOrderBookSnapshot()
const instrument = "btc_usd";
const snapshot = await client.getOrderBookSnapshot({ instrument });
  • .getCandles()
const instrument = "btc_usd";
const startDate = "2020-01-24T07:26:04";
const endDate = "2020-09-29T07:26:04";
const type = "1m";
const count = 2;
const candles = await client.getCandles({
  instrument,
  startDate,
  endDate,
  type,
  count,
});
  • .getRootAsset()
const asset = await client.getRootAsset();
  • .getTiers()
const tiers = await client.getTiers();

Test

npm test

Keywords

B2Trader

FAQs

Package last updated on 07 Dec 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts