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

bybit

v1.0.5

Published

Simple and easy to use bybit.com client.

Downloads

37

Readme

Bybit

Simple and easy to use bybit API abstraction defined using the official documentation.

Official API Documentation: https://github.com/bybit-exchange/bybit-official-api-docs/blob/master/en/rest_api.md

Initialize & Use

Below is a short guide on how to use the client.

Register your APIKEY

  • testnet: https://testnet.bybit.com/user/api-management
  • mainnet: https://www.bybit.com/app/user/api-management

Configure/Init Client

  • baseURL.testnet: https://api-testnet.bybit.com
  • baseURL.mainnet: https://api.bybit.com
  • key: APIKey
  • secret: Private Key
const client = require('bybit')({
  baseURL: 'https://api.bybit.com',
  key: '',
  secret: '',
})

Call Something

client
  .get('/order/list', params)
  .then(console.log)
  .catch(console.error)

Interface

Methods provided by the client.

listActiveOrders

List your Active orders.

  • options - Optional api params
client
  .listOrders([options])
  .then(console.log)
  .catch(console.error)

getActiveOrder

Get a previously created Active order.

  • id - Order ID. The unique order ID returned to you when the corresponding order was created.
  • options - Optional api params
client
  .getOrder(id, [options])
  .then(console.log)
  .catch(console.error)

cancelActiveOrder

Canel a previously created Active order.

  • id - Order ID. The unique order ID returned to you when the corresponding order was created.
client
  .cancelOrder(id)
  .then(console.log)
  .catch(console.error)

createOrder

Create a new order.

client
  .createOrder({
    side: 'Buy',
    symbol: 'BTCUSD',
    order_type: 'Limit',
    time_in_force: 'GoodTillCancel',
    price: 10000,
    qty: 100000,
  })
  .then(console.log)
  .catch(console.error)

limitBuy

Create a limit buy order.

  • price - Order Price
  • qty - Number of Contracts
  • options - Optional api params
client
  .limitBuy(price, qty, [options])
  .then(console.log)
  .catch(console.error)

limitSell

Create a limit sell order.

  • price - Order Price
  • qty - Number of Contracts
  • options - Optional api params
client
  .limitSell(price, qty, [options])
  .then(console.log)
  .catch(console.error)

marketBuy

Create a market buy order.

  • qty - Number of Contracts
  • options - Optional api params
client
  .marketBuy(qty, [options])
  .then(console.log)
  .catch(console.error)

marketSell

Create a market sell order.

  • qty - Number of Contracts
  • options - Optional api params
client
  .marketSell(qty, [options])
  .then(console.log)
  .catch(console.error)

createConditionalOrder

Create a new order.

  • options - Optional api params
client
  .createConditionalOrder([options])
  .then(console.log)
  .catch(console.error)

listConditionalOrders

List conditional orders.

  • options - Optional api params
client
  .listConditionalOrders([options])
  .then(console.log)
  .catch(console.error)

getConditionalOrder

Get a previously created Conditional order.

  • options - Optional api params
client
  .getOrder('order_id', [options])
  .then(console.log)
  .catch(console.error)

cancelConditionalOrder

Canel a previously created Conditional order.

  • id - Order ID. The unique order ID returned to you when the corresponding order was created.
client
  .cancelOrder(id)
  .then(console.log)
  .catch(console.error)

listMyLeverage

List symbol leverage settings.

client
  .listMyLeverage()
  .then(console.log)
  .catch(console.error)

setMyLeverage

Set symbol leverage setting.

  • symbol - Contract type
  • leverage - Leverage value
client
  .setMyLeverage(symbol, leverage)
  .then(console.log)
  .catch(console.error)

listMyPositions

List your positions.

client
  .listMyPositions()
  .then(console.log)
  .catch(console.error)

updatePoisitionMargin

Update position margin allocation.

  • symbol - Contract type
  • margin - margin value
client
  .updatePoisitionMargin(symbol, margin)
  .then(console.log)
  .catch(console.error)

getFundingRate

Get the current funding rate. Funding settlement occurs every 8 hours at 00:00 UTC, 08:00 UTC and 16:00 UTC

  • symbol - Contract type
client
  .getFundingRate(symbol)
  .then(console.log)
  .catch(console.error)

getMyFundingFee

Get the provious funding fee. Funding settlement occurs every 8 hours at 00:00 UTC, 08:00 UTC and 16:00 UTC

  • symbol - Contract type
client
  .getMyFundingFee(symbol)
  .then(console.log)
  .catch(console.error)

getMyPredictedFunding

Get your predictied funding rate and fee.

  • symbol - Contract type
client
  .getMyPredictedFunding(symbol)
  .then(console.log)
  .catch(console.error)

listOrderTrades

List trades placed to fill and order.

  • id - order id
client
  .listOrderTrades(symbol)
  .then(console.log)
  .catch(console.error)

getOrderbookSnapshot

Get the current state of the orderbook.

  • symbol - Contract type
client
  .getOrderbookSnapshot(symbol)
  .then(console.log)
  .catch(console.error)

listTickers

List all available ticker data. ( price, ect... )

client
  .listTickers()
  .then(console.log)
  .catch(console.error)

getTicker

get current ticker data.

  • symbol - Contract type
client
  .listTickers(symbol)
  .then(console.log)
  .catch(console.error)