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

nexo-pro

v1.2.2

Published

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

Downloads

188

Readme

nexo-pro

:point_right: Unofficial Node.js connector for the Nexo Pro APIs, with TypeScript & browser support. :point_left:

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

Report Bug · Request Feature

:wrench: Installation

yarn add nexo-pro

:plunger: Examples

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

run an example using ts-node:

ts-node examples/account.ts

:open_book: Documentation

Check out the Nexo Pro API Documentation

Create API credential at Nexo Pro API Management

:label: 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,
});

:test_tube: Tests

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

run all the tests:

yarn test

:package: Browser Usage

Build a bundle using webpack:

yarn install
yarn build
yarn pack

The bundle can be found in ./.


:wave: 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.

:warning: 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.