Comments (4)
@RezaAb Thanks for sharing this however how do you make us of it? Do you have an example with Get Order Id for instance? Thanks
from kucoin-node-sdk.
You can review the source code of the utils file.
The utils file
If you use this package you don't need to create a sign again.
But for your manual handling, you can review the code.
function sign(text, secret, outputType = 'base64') {
return CryptoJS
.createHmac('sha256', secret)
.update(text)
.digest(outputType);
}
function auth(ApiKey, method, url, data) {
const { authVersion } = getConfig();
const timestamp = Date.now();
const signature = sign(timestamp + method.toUpperCase() + url + data, ApiKey.secret);
const returnData = {
'KC-API-KEY': ApiKey.key,
'KC-API-SIGN': signature,
'KC-API-TIMESTAMP': timestamp.toString(),
'KC-API-PASSPHRASE': ApiKey.passphrase || '',
'Content-Type': 'application/json',
'User-Agent': 'KuCoin-Node-SDK/${version}',
};
if (authVersion && (authVersion === 2 || authVersion === '2')) { // for v2 API-KEY
returnData['KC-API-KEY-VERSION'] = 2;
returnData['KC-API-PASSPHRASE'] = sign(ApiKey.passphrase || '', ApiKey.secret);
}
return returnData;
}
from kucoin-node-sdk.
@RezaAb same here. How to use this library?
from kucoin-node-sdk.
@StephaneTurquay @AndrejGajdos
You don't need to sign anything. It is automated.
const kucoinAPI = require('kucoin-node-sdk');
kucoinAPI.init({
baseUrl: 'https://api.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.
});
let orderId = "";
let result = await kucoinAPI.rest.Trade.Orders.getOrderByID(orderId);
from kucoin-node-sdk.
Related Issues (20)
- Config file - SyntaxError: Unexpected token : HOT 1
- getAllTickers() is only returning a total of 14 tickers. HOT 1
- Subscribing to private Websocket-channels HOT 5
- Several wallet address for one coin
- applyWithdraw empty result, no action
- Shared config object HOT 3
- Api support for robots?
- PageSize HOT 2
- websocket message type is wrong HOT 2
- Catching "Too many request" error
- Getting empty data for orders list api
- Getting empty JSON response from getAccountList, getAccountInformation, getSubUsers
- Websocket ticker_demo.js not working
- typescript types
- typescript HOT 1
- Cannot destructure property 'instanceServers' of 'server' as it is undefined.
- How do I get response headers of rate limit?
- V3 API dont work HOT 2
- Can not install latest HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kucoin-node-sdk.