node-binance-api | Node Binance API is an asynchronous node | Cryptocurrency library
kandi X-RAY | node-binance-api Summary
kandi X-RAY | node-binance-api Summary
This project is designed to help you make your own projects that interact with the Binance API. You can stream candlestick chart data, market depth, or use other advanced features such as setting stop losses and iceberg orders. This project seeks to have complete API coverage including WebSockets.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Set counter options
- Get the balances
- Performs a GET request to an endpoint
- Get a bookicker
- Explore the application balance
node-binance-api Key Features
node-binance-api Examples and Code Snippets
Community Discussions
Trending Discussions on node-binance-api
QUESTION
I'm facing an issue with the Binance API
Whenever I try to make a request for withdrawal, it returns "Signature for this request is not valid." error message, even though if with the same function I make a request for the account info, Funding balance, getAll balances or whatever, it works.
I already tried several solutions, but nothing seemed to work. This are some of my tries reading similar issues
- Works with endpoints like "api/v3/account" or "sapi/v1/capital/config/getall"
- Sending the signature and the params in the body (it returns "You are not authorized to execute this request" error message, I think is because is not reading the body, only query params)
- Activate all permissions for the API, and check the API
- Send in the query the param "name"
- Using Node packages like node-binance-api (It's not up to date with the request for withdrawals)
- Changing scripts in librery node-binance-api to the actual api for withdrawals (same error as doing it myself)
I'm using NodeJs, axios to make the requests. This is my function:
...ANSWER
Answered 2022-Feb-18 at 20:15For anyone having this problem, the issue was that I was sending the request inside the "params" instead of the url, weirdly enough, it didn't proccess it correctly, so make this small change:
QUESTION
I am trying to create an api that connects into the Binance API using node and in particular NestJs.
In my controller I have @Get('candles')
endpoint and call it by going to localhost:5000/candles. I am expecting it to return an object containing all the candleData retrieved from the Binance API. I am using the npm package node-binance-api.
I know the binance.candlesticks("BTCGBP", "4h", async (error, ticks, symbol) = {...
I am using is getting the data as inside I log the data received and show candleData.length in the console and it returns 100 candles as requested.
My issue is resolving the promise that this npm package returns so that I can return it via the /candles endpoint. I am used to angular and observables and I am getting a bit confused by async and await.
app.controller.ts
...ANSWER
Answered 2021-May-10 at 16:04You are so close , just missing the async/await to wait for the value before return.
QUESTION
I'm using node-binance-api to pull some Binance balance data. The API call returns all of the currencies, and I want to filter it to only include those where I have a balance.
Code:
...ANSWER
Answered 2021-May-06 at 16:03Lodash's _.filter
, even when passed an object, returns an array.
Iterates over elements of collection, returning an array of all elements predicate returns truthy for.
If you want an object of the same format but "filtered" one way would be to iterate over the keys of the object, test that properties value, then assign or not to a new object.
QUESTION
I am using Binance's Node.js API. It says regarding "Get open orders for a symbol", I should do:
...ANSWER
Answered 2021-Mar-21 at 19:05You'll need to use either completely async approach or use callbacks.
The last block in your question shows exactly what this answer explains. Javascript doesn't wait for Promise
to resolve/reject in a synchronous context. So your "async" block returned the unresolved Promise
and the rest of your (synchronous) code didn't wait for it to resolve.
Example of using async functions
QUESTION
I am using node-binance-api the follwoing function bring me all details of my last order:
...ANSWER
Answered 2021-Jan-17 at 18:21Looks like you're getting an array of trades, which means there'll be multiple prices.
If you need a collection of prices of all trades, you could assign those prices to a prices
variable like so:
QUESTION
I've been trying to make an API request to the Binance using NodeJs API as per this documentation but I keep getting the following response and I don't know why.
...ANSWER
Answered 2021-Jan-07 at 17:05According to Binance API documentation, signature
is required for the endpoint which you try to access.
Hence include your signature in the request body inorder to get a valid response.
Which means that you must sign your request using the HMAC SHA256
standard.
If the error still persists, I highly suggest you to use the official API of Binance instead of using some other random libraries.
You can get more information here
QUESTION
total_arr={}
total=0
data={"a":1,"b":2,"c":3}
const Binance = require('node-binance-api');
const binance = new Binance().options({
APIKEY: '',
APISECRET: ''
});
async function trigger(){
async function trig() {
for (keys in data){
var x= await binance.futuresMarketBuy( 'BNBUSDT', data[keys] )
var x2= await binance.futuresMarketBuy( 'BTCUSDT', x )
total_arr["buy"+keys]=x+x2;
}
}
async function trig2() {
var y =await binance.futuresMarketSell( 'BNBUSDT', data[keys] )
var y2= await binance.futuresMarketSell( 'BTCUSDT', y )
total_arr["sell"+keys]=y;
}
async function trigger(){
for (keys in data){
await trig(); /*I want to run trig() and trig2() asynchronously */
await trig2();
}
for (iterat in data) await {
total=total+data[iterat] /*AFTER trig() and trig2() have COMPLETELY run in for loop, I want
to add them up this way*/
}
console.log(total)
}
}
trigger();
...ANSWER
Answered 2020-Oct-06 at 12:35QUESTION
i've a code like this:
...ANSWER
Answered 2020-Apr-10 at 14:55So I haven't tested this code, I've never used this Binance API wrapper before but I would imagine this should work/is what you're asking.
I've wrapped that call in a promise so that when you hit the route it will wait until the call to Binance completes, and it will return with either the error if there is one or your balances, illustrated in the documentation for node-binance-api
like below:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install node-binance-api
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page