Hello Node-RED community,
I am stumbled upon this API SDK I would love to try out:
Node.js connector for Bitget REST APIs and WebSockets, with TypeScript & end-to-end tests.. Latest version: 1.1.1, last published: 17 days ago. Start using bitget-api in your project by running `npm i bitget-api`. There are 2 other projects in...
Obviously it is not available as Node-RED pallete install. I am running on AWS - not advanced in Ubuntu, but willing to learn. Can someone provide me approximate instructions how to run it? I would really appreciate it.
No, but you can add regular node js libs to the setup tab of a function node.
In this case, you wou add bitget-api
to the setup tab then in the function node you can do the following...
const {
SpotClient,
FuturesClient,
BrokerClient,
} = bitgetApi
const API_KEY = 'xxx';
const API_SECRET = 'yyy';
const API_PASS = 'zzz';
const client = new SpotClient({
apiKey: API_KEY,
apiSecret: API_SECRET,
apiPass: API_PASS,
},
// requestLibraryOptions
);
// For public-only API calls, simply don't provide a key & secret or set them to undefined
// const client = new SpotClient();
client.getApiKeyInfo()
.then(result => {
node.send({payload: result});
})
.catch(err => {
node.error(err, msg);
});
const symbol = 'BTCUSDT_SPBL';
client.getCandles(symbol, '1min');
.then(result => {
node.send({payload: result});
})
.catch(err => {
node.error(err, msg);
});
1 Like
system
Closed
12 July 2023 22:03
3
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.