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

node-bitmusa-api

v2.2.0

Published

The node-bitmusa-api is a node.js module developed to interact with the Bitmusa API.

Downloads

26

Readme

node-bitmusa-api

The node-bitmusa-api is a node.js module developed to interact with the Bitmusa API. Created to assist you in crafting your own projects that merge with Bitmusa - a platform launched in 2022 - this project's main objective is to provide comprehensive coverage of the API.

quick start


Installation: npm install node-bitmusa-api
// 1. create Bitmusa Client
const options = {
    xApiKey: "YOUR_API_KEY",
    authKey: "YOUR_AUTHORIZATION_KEY",
    useTestnet: true,
    baseUrl: "TESTNET_URL",
    streamUrl: "TESTNET_URL"
    timeout: 5000,
    reconnect: true,
    keepAlive: true,
};

const bitmusa = new Bitmusa(options);


// 2. check balance
bitmusa.balance().then((res) => {
    console.log(res);
}).catch((err) => {
    console.log(err);
});

Bitmusa Futures API

For details, please review sample codes provided in the "example" folder.

Futures Balance

await bitmusa.futuresBalance("USDT")

Futures Limit Order

await bitmusa.futuresOrder((symbol = "BTCUSDT"), (side = "BUY"), (quantity = 1), (price = 31000))
await bitmusa.futuresLimitBuy((symbol = "BTCUSDT"), (quantity = 1), (price = 29000))
await bitmusa.futuresLimitSell((symbol = "BTCUSDT"), (quantity = 1), (price = 29000))

Futures Market Order

await bitmusa.futuresOrder((symbol = "BTCUSDT"), (side = "BUY"), (quantity = 1), (price = false))
await bitmusa.futuresMarketBuy((symbol = "BTCUSDT"), (quantity = 1))
await bitmusa.futuresMarketSell((symbol = "BTCUSDT"), (quantity = 1))

Futures Close Order Example

await bitmusa.futuresOrder((symbol = "BTCUSDT"), (side = "BUY"), (quantity = 1), (price = 31000), (params = { closePosition: true }))

Futures Positions

await bitmusa.futuresExposure("BTCUSDT")

Futures Open Orders

await bitmusa.futuresOpenOrders((symbol = "BTCUSDT"))

Futures Prices

await bitmusa.futuresPrices("BTCUSDT")

Bitmusa Spot Trading

balance

await bitmusa.balance()

Limit Order

await bitmusa.order((symbol = "ETH/USDT"), (direction = "BUY"), (quantity = 10), (price = 2000))
await bitmusa.limitBuy((symbol = "ETH/USDT"), (quantity = 10), (price = 2000))
await bitmusa.limitSell((symbol = "ETH/USDT"), (quantity = 10), (price = 2000))

Market Order

await bitmusa.order((symbol = "ETH/USDT"), (direction = "BUY"), (quantity = 10), (price = false))
await bitmusa.marketSell((symbol = "ETH/USDT"), (quantity = 10))
await bitmusa.marketBuy((symbol = "ETH/USDT"), (quantity = 10))

Prices

await bitmusa.prices((symbol = "")) // for all pairs

Order Cancel

await bitmusa.cancelOrder((orderId = "Q168911032722964"))

API Reference

Spot

Order

  • order(): Places an order
  • limitBuy(): Places a limit buy order
  • limitSell(): Places a limit sell order
  • marketBuy(): Places a market buy order
  • marketSell(): Places a market sell order
  • openOrders(): Retrieves a list of all current open orders
  • cancelOrder(): Cancel an order
  • cancelAllOrders(): Cancels all current open orders

Trade

  • recentTrades(): Retrieves the most recent trades on the spot market.

Market

  • prices(): Retrieves the current prices for all symbols. If no symbol is specified, it returns prices for all symbols.
  • tickers(): Retrieves current ticker information for all symbols. If no symbol is specified, it returns ticker information for all symbols.
  • orderBook(): Retrieves the current order book.

Asset

  • balance():Retrieves the balance of a specific asset. If no asset is specified, it returns balances for all assets.
  • requestWithdrawal(): Requests a withdrawal. [not supported]
  • createDepositAddress(): Creates a deposit address. [not supported]

Other

  • tradingFees(): Retrieves transaction fee information. [not supported]
  • transactionFees(): Retrieves transaction fee information. [not supported]

Futures

Order

  • futuresOrder(): Places an order
  • futuresLimitBuy(): Places a limit buy order
  • futuresLimitSell(): Places a limit sell order
  • futuresMarketBuy(): Places a market buy order
  • futuresMarketSell(): Places a market sell order
  • cancelFutureOrder(): Cancels a futures order.
  • cancelAllFutureOrders(): Cancels all futures orders.
  • closeAllFuturesPositions(): Closes all open positions
  • futuresLeverage(): Adjusts the leverage for the futures trading

Trade

  • futuresOpenOrders(): Gets a list of open futures orders.
  • futuresRecentTrades(): Retrieves the most recent trades
  • futuresExposure(): Retrieves information on the current open positions

Market

  • futuresPrices(): Retrieves the current prices for all symbols. If no symbol is specified, it returns prices for all symbol
  • futuresTickers(): Retrieves current ticker information for all symbols. If no symbol is specified, it returns ticker information for all symbols
  • futuresOrderBook(): Retrieves the current order book

Asset

  • futuresBalance(): Retrieves the balance of assets held. If no symbol is specified, it returns prices for all symbols
  • futuresTransactions(): Gets the history of futures account deposits and withdrawals [not supported]
  • requestFuturesWithdrawal() : Requests a withdrawal from a futures account [not supported]

Other

  • futuresTradingFees(): Retrieves futures trading fee information [not supported]