2.2.0 • Published 3 months ago

node-bitmusa-api v2.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

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
2.2.0

3 months ago

2.1.0

4 months ago

2.0.6

7 months ago

2.0.5

8 months ago

2.0.4

8 months ago

2.0.3

9 months ago

2.0.2

10 months ago

2.0.1

10 months ago

2.0.0

10 months ago

1.2.2

1 year ago

1.2.1

1 year ago

1.2.0

1 year ago

1.1.17

1 year ago

1.1.16

1 year ago

1.1.15

1 year ago

1.1.14

1 year ago

1.1.13

1 year ago

1.1.12

1 year ago

1.1.11

1 year ago

1.1.9

1 year ago

1.1.8

1 year ago

1.1.6

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago