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

@nexajs/market

v24.11.1

Published

Access and trade with Nexa's exchange partners all from one place.

Downloads

156

Readme

NEXA.js Market

Access to ALL of Nexa's exchange partners in one place.

The Market package is used to connect and trade with cryptocurrency exchanges and payment processing services worldwide. It provides quick access to market data for storage, analysis, visualization, indicator development, algorithmic trading, strategy backtesting, bot programming, and related software engineering.

CCXT Markets Ani

It is intended to be used by coders, developers, technically-skilled traders, data-scientists and financial analysts for building trading algorithms.

Current feature list:

  • support for many cryptocurrency exchanges — more coming soon
  • fully implemented public and private APIs
  • optional normalized data for cross-exchange analytics and arbitrage
  • an out of the box unified API that is extremely easy to integrate
  • works in Node 10.4+, Python 3, PHP 8.1+, netstandard2.0/2.1 and web browsers

Supported Exchanges

  1. Binance
  2. BitMart
  3. CoinEx
  4. Kraken
  5. KuCoin
  6. MEXC Global
  7. Txbit

Documentation

Read the Manual for more details.

Usage

Intro

The CCXT library consists of a public part and a private part. Anyone can use the public part immediately after installation. Public APIs provide unrestricted access to public information for all exchange markets without the need to register a user account or have an API key.

Public APIs include the following:

  • market data
  • instruments/trading pairs
  • price feeds (exchange rates)
  • order books
  • trade history
  • tickers
  • OHLC(V) for charting
  • other public endpoints

In order to trade with private APIs you need to obtain API keys from an exchange's website. It usually means signing up to the exchange and creating API keys for your account. Some exchanges require personal info or identification. Sometimes verification may be necessary as well. In this case you will need to register yourself, this library will not create accounts or API keys for you. Some exchanges expose API endpoints for registering an account, but most exchanges don't. You will have to sign up and create API keys on their websites.

Private APIs allow the following:

  • manage personal account info
  • query account balances
  • trade by making market and limit orders
  • deposit and withdraw fiat and crypto funds
  • query personal orders
  • get ledger history
  • transfer funds between accounts
  • use merchant services

Initializing

Authentication credentials are (optional), but are required for private API (data) endpoints.

import { Market, version } from '@nexajs/market'

const mexc = new Market.mexc({
    apiKey: 'YOUR_PUBLIC_API_KEY',
    secret: 'YOUR_SECRET_PRIVATE_KEY',
})

console.log(version)
// 23.7.21

Fetch Ticker

import { mexc } from '@nexajs/market'

const exchange = new mexc()

const ticker = await exchange.getTicker('NEXA/USDT')
console.log(ticker)
/*
{
 ...
}
*/

Make Trade

import { coinex } from '@nexajs/market'

const exchange = new coinex()

const orderParams = {
    pair: 'NEXA/USDT',
}

const orderDetails = await exchange.createOrder(orderParams)
console.log(orderDetails)
/*
{
 orderId: ...,
}
*/