npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

binance-nodejs-api

v1.0.3

Published

This service was created simply for binance spot API transactions. The heavily used processes were simplified and coded on a single page.

Downloads

7

Readme

binance-nodejs-api

https://www.npmjs.com/package/binance-nodejs-api

Installation

npm install binance-nodejs-api

Authentication Required Features

  • myWallet,
  • orderCreate,
  • getOrder,
  • getOpenOrders,
  • cancelOrderor,
  • networkList,
  • depositAddress,
  • history

Import for public endpoints

const binanceApi = require('binance-nodejs-api')
client = binanceApi()

Import for private (auth required) endpoints

const binanceApi = require('binance-nodejs-api')
client = binanceApi(API_KEY, API_SECRET)

Usage

Authentication Required Methods

  • My Wallet

    
    client.myWallet().then(async res=>{
          console.log(res)  
          }); 
    

    Result:

          [{ asset: 'GTO', free: '0.00000000', locked: '0.00000000' },
          { asset: 'ICX', free: '0.00000000', locked: '0.00000000' },
          { asset: 'OST', free: '0.00000000', locked: '0.00000000' },
          { asset: 'ELF', free: '0.00000000', locked: '0.00000000' },
          { asset: 'AION', free: '0.00000000', locked: '0.00000000' },
          { asset: 'WINGS', free: '0.00000000', locked: '0.00000000' },
          { asset: 'BRD', free: '0.00000000', locked: '0.00000000' },
          { asset: 'NEBL', free: '0.00000000', locked: '0.00000000' }]
  • Create Order

    • @param {*} symbol string
    • @param {*} quantity string
    • @param {*} price string
    • @param {*} side BUY,SELL
    • @param {} type MARKET,LIMIT
          client.orderCreate('BTCUSDT','0.001','30000','SELL').then(async res=>{
          console.log(res)  
          }); 
    
          client.orderCreate('BTCUSDT','0.001','30000','BUY').then(async res=>{
          console.log(res)  
          }); 

    Result:

              {
                  symbol: 'BTCUSDT',
                  orderId: 12409240742,
                  orderListId: -1,
                  clientOrderId: 'pBUqc7SLTmOS9wK0zAmvtM',
                  transactTime: 1660397390704,
                  price: '30000.00000000',
                  origQty: '0.00100000',
                  executedQty: '0.00000000',
                  cummulativeQuoteQty: '0.00000000',
                  status: 'NEW',
                  timeInForce: 'GTC',
                  type: 'LIMIT',
                  side: 'SELL',
                  fills: []
              }
  • Get Order

    • @param {*} orderId orderID
    • @param {*} symbol
          client.getOrder(12409240742, 'BTCUSDT').then(async res => {
          console.log(res)
          });

    Result:

         {
              symbol: 'BTCUSDT',
              orderId: 12409240742,
              orderListId: -1,
              clientOrderId: 'pBUqc7SLTmOS9wK0zAmvtM',
              price: '30000.00000000',
              origQty: '0.00100000',
              executedQty: '0.00000000',
              cummulativeQuoteQty: '0.00000000',
              status: 'NEW',
              timeInForce: 'GTC',
              type: 'LIMIT',
              side: 'SELL',
              stopPrice: '0.00000000',
              icebergQty: '0.00000000',
              time: 1660397390704,
              updateTime: 1660397390704,
              isWorking: true,
              origQuoteOrderQty: '0.00000000'
           }
  • Get Open Orders

          client.getOpenOrders('BTCUSDT').then(async res => {
          console.log(res)
          });

    Result:

          [
              {
                  symbol: 'BTCUSDT',
                  orderId: 12409204581,
                  orderListId: -1,
                  clientOrderId: '6ky5fVlA0AEiKngNGR3Km7',
                  price: '30000.00000000',
                  origQty: '0.00100000',
                  executedQty: '0.00000000',
                  cummulativeQuoteQty: '0.00000000',
                  status: 'NEW',
                  timeInForce: 'GTC',
                  type: 'LIMIT',
                  side: 'SELL',
                  stopPrice: '0.00000000',
                  icebergQty: '0.00000000',
                  time: 1660397256661,
                  updateTime: 1660397256661,
                  isWorking: true,
                  origQuoteOrderQty: '0.00000000'
              },
              {
                  symbol: 'BTCUSDT',
                  orderId: 12409228043,
                  orderListId: -1,
                  clientOrderId: 'ZqjxD01pEKl95cDYU5eBqG',
                  price: '30000.00000000',
                  origQty: '0.00100000',
                  executedQty: '0.00000000',
                  cummulativeQuoteQty: '0.00000000',
                  status: 'NEW',
                  timeInForce: 'GTC',
                  type: 'LIMIT',
                  side: 'SELL',
                  stopPrice: '0.00000000',
                  icebergQty: '0.00000000',
                  time: 1660397338362,
                  updateTime: 1660397338362,
                  isWorking: true,
                  origQuoteOrderQty: '0.00000000'
              },
          ]
    
  • Cancel Order

          client.cancelOrderor(12409228043, 'BTCUSDT').then(async res => {
         console.log(res)
         });

    Result:

        {
            symbol: 'BTCUSDT',
            origClientOrderId: 'pBUqc7SLTmOS9wK0zAmvtM',
            orderId: 12409240742,
            orderListId: -1,
            clientOrderId: 'I4Q502zxywwZ8DVpicoHfA',
            price: '30000.00000000',
            origQty: '0.00100000',
            executedQty: '0.00000000',
            cummulativeQuoteQty: '0.00000000',
            status: 'CANCELED',
            timeInForce: 'GTC',
            type: 'LIMIT',
            side: 'SELL'
         }
  • Network List

         client.networkList('BTC').then(async res => {
         console.log(res)
         });  

    Result:

               [
                    {
                        coin: 'STPT',
                        depositAllEnable: true,
                        withdrawAllEnable: true,
                        name: 'Standard Tokenization Protocol',
                        free: '0',
                        locked: '0',
                        freeze: '0',
                        withdrawing: '0',
                        ipoing: '0',
                        ipoable: '0',
                        storage: '0',
                        isLegalMoney: false,
                        trading: true,
                        networkList: [
                            {
                            network: 'ETH',
                            coin: 'STPT',
                            withdrawIntegerMultiple: '0.00000001',
                            isDefault: true,
                            depositEnable: true,
                            withdrawEnable: true,
                            depositDesc: '',
                            withdrawDesc: '',
                            specialTips: '',
                            name: 'Ethereum (ERC20)',
                            resetAddressStatus: false,
                            addressRegex: '^(0x)[0-9A-Fa-f]{40}$',
                            addressRule: '',
                            memoRegex: '',
                            withdrawFee: '108',
                            withdrawMin: '216',
                            withdrawMax: '10000000000',
                            minConfirm: 12,
                            unLockConfirm: 0,
                            sameAddress: false,
                            estimatedArrivalTime: 5,
                            busy: false,
                            country: 'AE'
                            }
                        ]
                    }
                ]
  • Deposit Adres

         client.depositAddress('STPT').then(async res => {
         console.log(res)
         })  

    Result:

       {
        coin: 'STPT',
        address: '0x6894c12f8da541ec82c9b25fd5f0ccaa3a7b1599',
        tag: '',
        url: 'https://etherscan.io/address/0x6894c12f8da541ec82c9b25fd5f0ccaa3a7b1599'
        }
  • History

         const response =client.history('BTCUSDT',5).then(async res => {
         console.log(res)
         })

    Result:

       [
            {
                symbol: 'BTCUSDT',
                id: 1336406302,
                orderId: 10302346834,
                orderListId: -1,
                price: '40091.98000000',
                qty: '0.00057000',
                quoteQty: '22.85242860',
                commission: '0.02285243',
                commissionAsset: 'USDT',
                time: 1650922111382,
                isBuyer: false,
                isMaker: false,
                isBestMatch: true
            },
        ]