JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 21
  • Score
    100M100P100Q48755F
  • License MIT

Node.js connector for Nexo Pro's REST APIs, with TypeScript & integration tests.

Package Exports

  • nexo-pro
  • nexo-pro/lib/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (nexo-pro) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

nexo-pro

๐Ÿ‘‰ Unofficial Node.js connector for the Nexo Pro APIs, with TypeScript & browser support. ๐Ÿ‘ˆ

Percentage of issues still open GitHub license npm version npm size npm downloads GitHub contributors last commit CI Coverage

๐Ÿ”ง Installation

yarn add nexo-pro

๐Ÿช  Examples

copy the .env.template file in .env and fills the variables.

run an example using ts-node:

ts-node examples/account.ts

๐Ÿ“– Documentation

Check out the Nexo Pro API Documentation

Create API credential at Nexo Pro API Management

๐Ÿท๏ธ REST API Client

import Client from 'nexo-pro';

const client = Client({
  api_key: key,
  api_secret: secret,
});

// infos
await client.getAccountSummary();
await client.getPairs();
await client.getQuote({ pair: 'BTC/USDT', amount: 10, side: 'buy' });

// orders
await client.placeOrder({
  pair: 'BTC/USDT',
  side: 'buy',
  type: 'market',
  quantity: 0.02,
});
await client.cancelOrder({ orderId: '<order_id>' });
await client.cancelAllOrders({ pair: 'BTC/USDT' });
await client.placeTriggerOrder({
  pair: 'BTC/USDT',
  side: 'buy',
  triggerType: 'stopLoss',
  amount: 0.02,
  triggerPrice: 18000,
});

await client.placeAdvancedOrder({
  pair: 'BTC/USDT',
  side: 'buy',
  triggerType: 'stopLoss',
  amount: 0.02,
  triggerPrice: 18000,
});
await client.placeTWAPOrder({
  pair: 'BTC/USDT',
  quantity: 0.02,
  side: 'buy',
  exchanges: [''],
  split: 10,
  executionInterval: 200,
});
await client.getOrders({
  pairs: ['BTC/USDT'],
  startDate: 0,
  endDate: Date.now(),
  pageNum: 0,
  pageSize: 5,
});
await client.getOrderDetails({ id: '<order_id>' });

// others
await client.getTrades({
  pairs: ['BTC/USDT'],
  startDate: 0,
  endDate: Date.now(),
  pageNum: 0,
  pageSize: 5,
});
await client.getTransaction({ transactionId: 0 });

// futures
await client.getFuturesInstruments();
await client.getFuturesPosition({ status: 'active' });
await client.placeFuturesOrder({
  instrument: 'BTC/USDT',
  positionAction: 'open',
  positionSide: 'long',
  type: 'market',
  quantity: 0.02,
});

๐Ÿงช Tests

copy the .env.template file in .env and fills the variables.

run all the tests:

yarn test

๐Ÿ“ฆ Browser Usage

Build a bundle using webpack:

yarn install
yarn build
yarn pack

The bundle can be found in ./.


๐Ÿ‘‹ Contributions & Pull Requests

Contributions are encouraged, I will review any incoming pull requests. Be sur to run yarn test to run all tests and yarn prettier to run the prettier.

โš ๏ธ Disclamer

This is an unofficial NodeJS wrapper for the Nexo Pro exchange REST API v1. I am in no way affiliated with Nexo, use at your own risk.