Giter VIP home page Giter VIP logo

kucoin-node-sdk's Introduction

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

  • getSubUsers
  • getPaginatedSubUsers

Rest/User/Account

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

Rest/User/Deposit

  • createDepositAddress
  • getDepositAddressV2
  • getDepositAddress
  • getDepositList
  • getV1HistoricalDepositsList

Rest/User/Withdrawals

  • getWithdrawalsList
  • getV1HistoricalWithdrawalsList
  • getWithdrawalQuotas
  • applyWithdraw
  • cancelWithdrawal

Rest/User/TradeFee

  • getBasicUserFee
  • getActualFeeRateBySymbols

Rest/Trade

Signature is required for this part.

Rest/Trade/Orders

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

Rest/Trade/StopOrder

  • postStopOrder
  • cancelOrder
  • cancelMultiOrders
  • getOrder
  • getStopOrderList
  • getOrderByClientOid
  • cancelSingleOrderByClientOid
  • getSingleStopOrderInfo
  • cancelStopOrder

Rest/Trade/Fills

  • getFillsList
  • getRecentFills
  • getHfTransactionRecords

Rest/Trade/OCOOrder

  • placeOrder
  • cancelOrder
  • cancelAllOrders
  • getOrders
  • getOrderDetails
  • getOrderByClientOid

Rest/Market

Signature is not required for this part

Rest/Market/Symbols

  • getSymbolsList
  • getTicker
  • getAllTickers
  • get24hrStats
  • getMarketList
  • getSymbolsList

Rest/Market/OrderBook

  • getLevel2_20
  • getLevel2_100
  • getLevel2_full
  • getLevel3_full

Rest/Market/Histories

  • getMarketHistories
  • getMarketCandles

Rest/Market/Currencies

  • getCurrencies
  • getCurrencyDetail
  • getFiatPrice
  • getCurrencyDetail_V3

Rest/Margin/MarginInfo

  • getMarkPrice
  • getMarginConfigurationInfo
  • getMarginAccount
  • postMarginOrder
  • getMarginPriceStrategy
  • getMarginCurrencies
  • getEtfInfo

Rest/Margin/BorrowAndLend

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

Rest/Margin/Isolated

  • queryIsolatedMarginTradingPairConfiguration
  • queryIsolatedMarginAccountInfo
  • querySingleIsolatedMarginAccountInfo
  • isolatedMarginBorrowing
  • queryOutstandingRepaymentRecords
  • queryRepaymentRecords
  • quickRepayment
  • singleRepayment

Rest/Margin/MarginV3

  • marginBorrowV3

  • getBorrowHistoryV3

  • repayMarginLoanV3

  • getRepayHistoryV3

  • getMarginInterestRecordsV3

  • getLendingCurrencyInfoV3

  • getMarketInterestRateV3

  • initiatePurchaseV3

  • getPurchaseOrdersV3

  • redeemMarketV3

  • getRedemptionOrdersV3

  • updatePurchaseOrderInterestRateV3

  • getCrossMarginTradingPairs

  • updateLeverageMultiplier

  • placeHfMarginOrder

  • testHfMarginOrder

  • cancelHfMarginOrder

  • cancelHfMarginOrderByClientOid

  • cancelAllHfMarginOrdersBySymbol

  • getActiveHfMarginOrders

  • getFilledHfMarginOrders

  • getHfOrderDetails

  • getHfOrderDetailsByClientOid

  • getHfTransactionRecords

  • getActiveHfOrderSymbols

Rest/Earn/General

  • subscribeToEarnFixedIncomeProducts
  • redeemByEarnHoldingId
  • getEarnRedeemPreviewByHoldingId

Rest/Earn/KucoinEarn

  • getEarnSavingsProducts
  • getEarnFixedIncomeCurrentHoldings
  • getEarnPromotionProducts

Rest/Earn/Staking

  • getKcsStakingProducts
  • getEarnStakingProducts
  • getEthStakingProducts

Rest/VIPLending

  • getOtcLoanInformation
  • getOtcLoanAccounts

Rest/Others

  • getTimestamp
  • getStatus

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.