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

kucoin-node-sdk

v1.1.1

Published

KuCoin API SDK for Node.js language

Downloads

1,484

Readme

kucoin-node-sdk for KuCoin API

KuCoin API SDK for Node.js language

The detailed document https://docs.kucoin.com.

Latest Version

Env

Nodejs version >= 10.0

Install

# install by npm
npm install kucoin-node-sdk


# install by yarn
yarn add kucoin-node-sdk

Init Configure

module.exports = {
  baseUrl: '',
  apiAuth: {
    key: '', // KC-API-KEY
    secret: '', // API-Secret
    passphrase: '', // KC-API-PASSPHRASE
  },
  authVersion: 2, // KC-API-KEY-VERSION. Notice: for v2 API-KEY, not required for v1 version.
};

You can use baseUrl method to change evironment. | Environment | BaseUri | | -------- | -------- | | Production DEFAULT | https://openapi-v2.kucoin.com | | Sandbox | https://openapi-sandbox.kucoin.com |

If you only need to use the public web socket client or REST client public method, you can igonre withApiKey method. To customize your own API implementation, you may use the with*API method we provided for you.

Usage

/** Require SDK */
const API = require('kucoin-node-sdk');

/** Init Configure */
API.init(require('./config'));

/** API use */
const main = async () => {
  const getTimestampRl = await API.rest.Others.getTimestamp();
  console.log(getTimestampRl.data);
};

/** Run Demo for all apis */
REST API: yarn dev
SW:  yarn dev-ws (you can opt the params for different sw demo in demo,such as follow exp)

"dev-ws": "cross-env PRODUCTION=dev nodemon demo/xxx_demo.js",

Demo SDK for all APIS

DEMO: demo/index.js

API Modules

Rest/User

Signature is required for this part.

Rest/User/UserInfo

  • [x] getSubUsers
  • [x] getPaginatedSubUsers

Rest/User/Account

  • [x] createAccount
  • [x] getAccountsList
  • [x] getAccountInformation
  • [x] getAccountLedgers
  • [x] getHolds
  • [x] getBalanceOfSubAccount
  • [x] getAggregatedBalanceOfAllSubAccounts
  • [x] getTransferable
  • [x] transferBetweenMasterUserAndSubUser
  • [x] innerTransfer
  • [x] getAccountSummaryInfo
  • [x] createSubAccount
  • [x] getSubAccountSpotApiList
  • [x] createSpotAPIsForSubAccount
  • [x] updateSubAccountSpotApis
  • [x] deleteSubAccountSpotApis
  • [x] getPaginatedSubAccountInformation
  • [x] transferToHFAccount
  • [x] getHighFrequencyAccountLedger
  • [x] getUserType

Rest/User/Deposit

  • [x] createDepositAddress
  • [x] getDepositAddressV2
  • [x] getDepositAddress
  • [x] getDepositList
  • [x] getV1HistoricalDepositsList

Rest/User/Withdrawals

  • [x] getWithdrawalsList
  • [x] getV1HistoricalWithdrawalsList
  • [x] getWithdrawalQuotas
  • [x] applyWithdraw
  • [x] cancelWithdrawal

Rest/User/TradeFee

  • [x] getBasicUserFee
  • [x] getActualFeeRateBySymbols

Rest/Trade

Signature is required for this part.

Rest/Trade/Orders

  • [x] postOrder
  • [x] postMultiOrders
  • [x] cancelOrder
  • [x] cancelOrderByClientOid
  • [x] cancelAllOrders
  • [x] getOrdersList
  • [x] getV1HistoricalOrdersList
  • [x] getRecentOrders
  • [x] getOrderByID
  • [x] getSingleActiveOrderByClientOid
  • [x] placeHfOrder
  • [x] syncPlaceHfOrder
  • [x] placeMultipleHfOrders
  • [x] syncPlaceMultipleHfOrders
  • [x] modifyOrder
  • [x] cancelOrdersByOrderId
  • [x] syncCancelOrdersByOrderId
  • [x] cancelOrderByClientOid
  • [x] syncCancelOrdersByClientOid
  • [x] cancelSpecifiedNumberOfOrdersByOrderId
  • [x] cancelAllHfOrdersBySymbol
  • [x] obtainListOfActiveHfOrders
  • [x] obtainListOfSymbolWithActiveHfOrders
  • [x] obtainListOfFilledHfOrders
  • [x] detailsOfAsingleHfOrder
  • [x] obtainDetailsOfASingleHfOrder
  • [x] hfAutoCancelSetting
  • [x] queryHfAutoCancelOrderSetting
  • [x] cancelAllHfOrders

Rest/Trade/StopOrder

  • [x] postStopOrder
  • [x] cancelOrder
  • [x] cancelMultiOrders
  • [x] getOrder
  • [x] getStopOrderList
  • [x] getOrderByClientOid
  • [x] cancelSingleOrderByClientOid
  • [x] getSingleStopOrderInfo
  • [x] cancelStopOrder

Rest/Trade/Fills

  • [x] getFillsList
  • [x] getRecentFills
  • [x] getHfTransactionRecords

Rest/Trade/OCOOrder

  • [x] placeOrder
  • [x] cancelOrder
  • [x] cancelAllOrders
  • [x] getOrders
  • [x] getOrderDetails
  • [x] getOrderByClientOid

Rest/Market

Signature is not required for this part

Rest/Market/Symbols

  • [x] getSymbolsList
  • [x] getTicker
  • [x] getAllTickers
  • [x] get24hrStats
  • [x] getMarketList
  • [x] getSymbolDetail

Rest/Market/OrderBook

  • [x] getLevel2_20
  • [x] getLevel2_100
  • [x] getLevel2_full
  • [x] getLevel3_full

Rest/Market/Histories

  • [x] getMarketHistories
  • [x] getMarketCandles

Rest/Market/Currencies

  • [x] getCurrencies
  • [x] getCurrencyDetail
  • [x] getFiatPrice
  • [x] getCurrencyDetail_V3

Rest/Margin/MarginInfo

  • [x] getMarkPrice
  • [x] getMarginConfigurationInfo
  • [x] getMarginAccount
  • [x] postMarginOrder
  • [x] getMarginPriceStrategy
  • [x] getMarginCurrencies
  • [x] getEtfInfo

Rest/Margin/BorrowAndLend

  • [x] postBorrowOrder
  • [x] getBorrowOrder
  • [x] getRepayRecord
  • [x] getRepaymentRecord
  • [x] repayAll
  • [x] repaySingle
  • [x] postLendOrder
  • [x] cancelLendOrder
  • [x] setAutoLend
  • [x] getActiveOrder
  • [x] getLentHistory
  • [x] getActiveLendOrdersList
  • [x] getSettledLendOrderHistory
  • [x] getAccountLendRecord
  • [x] getLendingMarketData
  • [x] getMarginFillsTradeData

Rest/Margin/Isolated

  • [x] queryIsolatedMarginTradingPairConfiguration
  • [x] queryIsolatedMarginAccountInfo
  • [x] querySingleIsolatedMarginAccountInfo
  • [x] isolatedMarginBorrowing
  • [x] queryOutstandingRepaymentRecords
  • [x] queryRepaymentRecords
  • [x] quickRepayment
  • [x] singleRepayment

Rest/Margin/MarginV3

  • [x] marginBorrowV3

  • [x] getBorrowHistoryV3

  • [x] repayMarginLoanV3

  • [x] getRepayHistoryV3

  • [x] getMarginInterestRecordsV3

  • [x] getLendingCurrencyInfoV3

  • [x] getMarketInterestRateV3

  • [x] initiatePurchaseV3

  • [x] getPurchaseOrdersV3

  • [x] redeemMarketV3

  • [x] getRedemptionOrdersV3

  • [x] updatePurchaseOrderInterestRateV3

  • [x] getCrossMarginTradingPairs

  • [x] updateLeverageMultiplier

  • [x] placeHfMarginOrder

  • [x] testHfMarginOrder

  • [x] cancelHfMarginOrder

  • [x] cancelHfMarginOrderByClientOid

  • [x] cancelAllHfMarginOrdersBySymbol

  • [x] getActiveHfMarginOrders

  • [x] getFilledHfMarginOrders

  • [x] getHfOrderDetails

  • [x] getHfOrderDetailsByClientOid

  • [x] getHfTransactionRecords

  • [x] getActiveHfOrderSymbols

Rest/Earn/General

  • [x] subscribeToEarnFixedIncomeProducts
  • [x] redeemByEarnHoldingId
  • [x] getEarnRedeemPreviewByHoldingId

Rest/Earn/KucoinEarn

  • [x] getEarnSavingsProducts
  • [x] getEarnFixedIncomeCurrentHoldings
  • [x] getEarnPromotionProducts

Rest/Earn/Staking

  • [x] getKcsStakingProducts
  • [x] getEarnStakingProducts
  • [x] getEthStakingProducts

Rest/VIPLending

  • [x] getOtcLoanInformation
  • [x] getOtcLoanAccounts

Rest/Others

  • [x] getTimestamp
  • [x] getStatus
  • [x] getAnnouncements

Websocket Datafeed

API.websocket.Datafeed

Manage websocket connect/private/subscribe/unsubscribe and get realtime datafeed.

DEMO: demo/ticker_demo.js

API.websocket.Level2

Get realtime orderbook in level2 datafeed.

DEMO: demo/level2_demo.js

API.websocket.Level3

test exp

yarn test

// TODO

LICENSE

Apache-2.0 License