Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages

name: Node.js Package

on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- run: npm ci
- run: npm test

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
12 changes: 12 additions & 0 deletions lib/trade.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,18 @@ Trade.placeOrder = async function (params) {
return result.data
}

/**
* Get trade fee
* GET /api/v1/trade-fees
* @param {String} params - give a pair like: BTC-USDT
* @returns {Object} {makerFeeRate: String, takerFeeRate: String}
*/
Trade.tradeFee = async function (params) {
let endpoint = `/api/v1/trade-fees?symbols=${params}`
let url = this.baseURL + endpoint
let result = await axios.get(url,this.sign(endpoint, {}, 'GET'))
return result.data
}
/*
Cancel an order
DELETE /api/v1/orders/<order-id>
Expand Down
15 changes: 15 additions & 0 deletions lib/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,21 @@ User.innerTransfer = async function(params) {
return result.data
}

/*
Get the Transferable
GET /api/v1/accounts/transferable
params = {
currency: string,
type: string, //MAIN, TRADE, MARGIN or ISOLATED
tag: string, //[optional]
}
*/
User.getTheTransferable = async function(params){
let endpoint = `/api/v1/accounts/transferable?currency=${params.currency}&type=${params.type}`
let url = this.baseURL + endpoint
let result = await axios.get(url,this.sign(endpoint, {}, 'GET'))
return result.data
}
/*
Create Deposit Address
POST /api/v1/deposit-addresses
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kucoin-node-api",
"version": "2.1.5",
"version": "2.1.6",
"description": "Node.js KuCoin Cryptocurrency Exchange v2 API Wrapper/SDK",
"main": "kucoin.js",
"scripts": {
Expand Down