Launch Week Day 2: Introducing Reports: An Extensible Reporting Framework for Socket Data.Learn More
Socket
Book a DemoSign in
Socket

bingx-api

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bingx-api

This library implements [Bingx API](https://bingx-api.github.io/docs/#/swapV2/introduce) for nodejs applications

latest
Source
npmnpm
Version
1.21.0
Version published
Weekly downloads
7
-82.05%
Maintainers
1
Weekly downloads
 
Created
Source

Bingx API NodeJS Client

This library implements Bingx API for nodejs applications

CodeQL Release ESLint

Getting started

  • Install via npm
npm i bingx-api -S
  • Initialize Client
import { ApiAccount, BingxApiClient } from 'bingx-api';
const account = new ApiAccount('xxx', 'xxx');

const client = new BingxApiClient();
  • Make any requests from api to bingx
const userBalance = await client
                  .getAccountService()
                  .getPerpetualSwapAccountAssetInformation();
  • Works with sockets
const account = new ApiAccount('xxx', 'xxx');
stream = new BingxAccountSocketStream(account);

stream.heartbeat$.subscribe((v) => {})

stream.listenKeyExpired$.subscribe((v) => {})

stream.accountBalanceAndPositionPush$.subscribe((v) => {})

stream.accountOrderUpdatePushEvent$.subscribe((v) => {})
stream = new BingxMarketSocketStream(account);

stream.subscribe('BTC-USDT@trade');

stream.latestTradeDetail$.subscribe((v) => {})

Features supports

  • Account Interface
    • Get Perpetual Swap Account Asset Information
    • Perpetual Swap Positions
    • Get Account Profit and Loss Fund Flow
    • Export fund flow
    • User fee rate
  • Trade Interface
    • Trade order test
    • Trade order
    • Bulk order
    • One-Click Close All Positions
    • Cancel an Order
    • Cancel a Batch of Orders
    • Cancel All Orders
    • Query all current pending orders
    • Query Order
    • Query Margin Mode
    • Switch Margin Mode
    • Query Leverage
    • Switch Leverage
    • User's Force Orders
    • User's History Orders
    • Adjust isolated margin
    • Query historical transaction orders
  • Listen Key
    • Generate Listen Key
    • Extend Listen Key Validity period
    • Delete Listen Key
  • Socket API
    • Market Data
      • Subscribe Market Depth Data
      • Subscribe the Latest Trade Detail
      • Subscribe K-Line Data
    • Account Data
      • Listen Key expired push
      • Account balance and position update push
      • Order update push
      • Configuration updates such as leverage and margin mode

FAQs

Package last updated on 25 Feb 2024

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