kucoin-node-sdk
kucoin-node-sdk copied to clipboard
Getting empty JSON response from getAccountList, getAccountInformation, getSubUsers
Hi, I'm using the sandbox to test out this SDK. Set up an account in the Sandbox, created API credentials and used it as the config. Getting empty JSON responses from all the operations related to User and Account. I'm able get data back from getStatus and getSymbolsList which doesn't require a signature. I don't think I'm getting authorized correctly since even when I purporsely provide the wrong Secret, I still get an empty JSON response (I expected a 401 unauthorized error). Any idea what I might be missing?
Here's a sample of my code
`const API = require('kucoin-node-sdk');
const express = require('express'); const router = express.Router();
//Init configure API.init({ baseUrl: 'https://openapi-sandbox.kucoin.com', 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. })
router.get('/subUsers', async(req,res)=> { res.send(getSubUsers()) })
async function getSubUsers() { const subUsers = await API.rest.User.UserInfo.getSubUsers() return subUsers }
router.get('/accountList', async(req,res)=> { res.send(getAccountList()) })
async function getAccountList() { const accountList = await API.rest.User.Account.getAccountsList() return accountList }
module.exports = router;`
The response I keep getting is this:
{}