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

coin-market-apis

v0.0.12

Published

This package is the wrapper for Coinstore API https://coinstore-openapi.github.io/en/index.html#introduction. We will include other exchanges soon.

Downloads

3

Readme

coin-market-apis

This package is the wrapper for Coinstore API https://coinstore-openapi.github.io/en/index.html#introduction. We will include other exchanges soon.

Installation

$ npm i coin-market-apis

Env Variables

Add following environment varialbes in your .env file.

COIN_STORE_URL=coinstore url
COIN_STORE_SECRET_KEY=coin store secret key
COIN_STORE_API_KEY=coin store api key

NOTE: You need to whitelist your IP address in your coinstore account to access the coinstore APIs

Usage

import { CoinStore } from 'coinstore-api';
async function yourFunction() {
  const coinStore = new CoinStore();
  await coinStore.initializeAPI();
  const assetsBalance = await coinStore.getAssetsBalance();
}

Exposed API

Get current orders

const data = await coinStore.getCurrentOrders();

Get current orders v2

const filters = {
  symbol: '',
  ordId: 0,
  clOrdId: ''
};
const data = await coinStore.getCurrentOrdersV2(filters);

Get user's latest trade

const filters = {
  symbol: '', // required
  ordId: '',
  pageNum: 1,
  pageSize: 10,
  side: 1
};
const data = await coinStore.getLatestTrade(filters);

Cancel order

const filters = {
  symbol: '', // required
  ordId: 1 // required
};
const data = await coinStore.cancelOrder(filters);

One click cancellation (Cancel all orders for the specified trading pair)

const filters = {
  symbol: '', // required
};
const data = await coinStore.oneClickCancellation(filters);

Create order

const filters = {
  clOrdId: '',
  symbol: '', // required
  side: '', // required
  ordType: '', // required
  timeInForce: '',
  ordPrice: 0,
  ordQty: 0,
  ordAmt: 0,
  timestamp: 0, // required
};
const data = await coinStore.createOrder(filters);

Batch ordering

const filters = {
  symbol: '', // required
  timestamp: 0, // required
  orders: [{
    clOrdId: '',
    side: '', // required
    ordType: '', // required
    timeInForce: '',
    ordPrice: 0,
    ordQty: 0,
    ordAmt: 0,
  }] 
};
const data = await coinStore.batchOrdering(filters);

Batch cancellation

const filters = {
  symbol: '', // required
  orderIds: [1, 2] // required
};
const data = await coinStore.batchCancellation(filters);

Get order info

const filters = {
  ordId: 1
};
const data = await coinStore.getOrderInfo(filters);

Get order info v2

const filters = {
  ordId: 1,
  clOrdId: ''
};
const data = await coinStore.getOrderInfoV2(filters);

Currency and spot information

const filters = {
  symbolCodes: ['', ''],
  symbolIds: [1, 2]
};
const data = await coinStore.getSymbols(filters);

Currency information

const filters = {
  currencyCode: '' // required
};
const data = await coinStore.getCurrencyInfo(filters);

Get deposit address

const filters = {
  currencyCode: '', // required
  chain: '' // required
};
const data = await coinStore.getDepositAddress(filters);

Get deposit history

const filters = {
  currencyCode: '', // required
  startDate: '',
  endDate: '',
  fromId: 1,
  limit: 1,
  externalId: '',
  label: ''
};
const data = await coinStore.getDepositHistory(filters);

Get withdrawal history

const filters = {
  currencyCode: '', // required
  startDate: '',
  endDate: '',
  fromId: 1,
  limit: 1,
  externalId: '',
  label: ''
};
const data = await coinStore.getWithdrawalHistory(filters);

Withdrawal

const filters = {
  currencyCode: '', // required
  amount: '', // required
  address: '', // required
  chainType: '', // required
  tag: ''
};
const data = await coinStore.doWithdraw(filters);

Cancel withdrawal

const filters = {
  withdrawId: 1, // required
};
const data = await coinStore.cancelWithdraw(filters);

Transfer fund

const filters = {
  type: '', // required
  currencyCode: '', // required
  amount: '', // required
  from: 1, // required
  to: 1, // required
  subAccount: ''
};
const data = await coinStore.transferFund(filters);

Get tickers

const data = await coinStore.getTickers();

Get depth

const filters = {
  symbol: '', // required
  depth: 0
};
const data = await coinStore.getDepth(filters);

Get K-Line

const filters = {
  symbol: '', // required
  period: '',
  size: 0
};
const data = await coinStore.getKLine(filters);

Get latest trade

const filters = {
  symbol: '', // required
  period: '',
  size: 0
};
const data = await coinStore.getMarketLatestTrade(filters);

Get the latest prices of of all the symbols

const filters = {
  symbol: '', // required
};
const data = await coinStore.getLatestPrices(filters);