1.0.9 • Published 10 months ago

common-crypto-api v1.0.9

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

common-crypto-api

common-crypto-api is a Node.js package that provides a unified API to interact with multiple cryptocurrency exchanges. This package simplifies the process of integrating with different exchange APIs by offering a common interface.

Features

  • Unified API for multiple exchanges
  • Supports Binance and Bybit exchanges
  • Fetch balance, leverage, orders, and place orders
  • Testnet support for exchange
  • Proxy URL support for exchange ratelimit

Installation

npm install common-crypto-api

Usage

Importing the Module

import { CommonExchangeAPI } from "common-crypto-api";

Creating an Instance

const commonExchangeAPI = new CommonExchangeAPI(
  "binance", // or "bybit"
  "your-api-key",
  "your-api-secret",
  true // true for testnet, false for mainnet
);

Fetching Balance

const balance = await commonExchangeAPI.getBalance();
console.log(balance);

Fetching All Orders

const orders = await commonExchangeAPI.fetchAllOrders();
console.log(orders);

Fetching Leverage

const leverage = await commonExchangeAPI.getLeverage();
console.log(leverage);

Setting Leverage

const response = await commonExchangeAPI.setLeverage("BTCUSDT", 10);
console.log(response);

Placing an Order

const order = await commonExchangeAPI.createOrder(
  "BTCUSDT",
  "limit",
  "buy",
  1,
  50000
);
console.log(order);

Development

Building the Project

npm run build

Running in Development Mode

npm run dev

License

This project is licensed under the ISC License. See the

LICENSE

file for details.

Authors

  • Ramkumar R
  • Vivek

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any changes.

Acknowledgements

1.0.9

10 months ago

1.0.8

10 months ago

1.0.7

10 months ago

1.0.6

10 months ago

1.0.5

10 months ago

1.0.4

10 months ago

1.0.3

11 months ago

1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago