binance-api | lightweight Golang implementation for Binance API | REST library
kandi X-RAY | binance-api Summary
kandi X-RAY | binance-api Summary
binance-api is a lightweight Golang implementation for Binance API, providing complete API coverage, and supports both REST API and websockets API. This project is designed to help you interact with the Binance API, streaming candlestick charts data, market depth, or use other advanced features binance exposes via API.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- AggregatedTrades returns a list of all trades .
- NewBinanceClientWindow creates a new BinanceClient .
- NewBinanceClient creates a new BinanceClient .
binance-api Key Features
binance-api Examples and Code Snippets
Community Discussions
Trending Discussions on binance-api
QUESTION
In Laravel I made a test command and following this example implemented websocket client. It runs fine, but I am clueless how to launch it on server.
Controller? Does it keep running after page is loaded? Command? Does it keep running after ctrl+c? scheduler? Wont it launch new instance alongside existing ones every time?
Should I run it with supervisord? if so, should it be a command
...ANSWER
Answered 2022-Mar-28 at 13:37The right answer was supervisord. Also I had to add some lines to throw exceptions when connection is closed to force worker restart, otherwise it might take some time (even hour) for process to stop after connection has been closed.
QUESTION
I am getting a signature not valid error while connecting to Binance API endpoints that require authentication. There is a similar query in following link however it is specific to Binance, I guess and this question is specific to Binance US. I tried to use the methods in below link though and it didn't work.
Following is the Python code
...ANSWER
Answered 2022-Mar-06 at 06:02Finally!! After spending hours, shammy12's post helped me to figure out what went wrong. All this time I have been trying to create a signature based on a parameter in json format. Although Binance US documentation clearly stated,
totalParams
is defined as thequery string
concatenated with therequest body
this was overlooked in most of the responses I referenced. Even recvWindow
parameter has nothing to do with the invalid signature error. All it took me to debug this issue was figure out a way to format the query as,
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
newbie here! I'm trying to make a basic ping to the Binance crypto exchange using its exposed REST API and node.js. Instead of coding everything from 0, I'm planning to use a wrapper package in https://github.com/binance-exchange/binance-api-node that facilities interaction. I've downloaded the binance-api-node code from github into my node.js project.
After installing the package, when trying to run the included basic getting-started code to get the time from the server:
...ANSWER
Answered 2022-Feb-17 at 14:05As stated in documentation:
If you do not have an appropriate babel config, you will need to use the basic commonjs requires:
QUESTION
I've spent several hours trying to get the correct response from the endpoint. For that purpose I need to send a signature string generated by a SHA-256 function, attached to the query string I send to the server.
I've tried different methods to get that signature as described here in the docummentation: https://developers.binance.com/docs/binance-api/spot/index/#signed-trade-user_data-and-margin-endpoint-security But nothing seems to work.
I've tried several approaches for generating valid signatures using different libraries and functions, but they're not working (I even tried using the Web Crypto API documentation)
I'm getting this error when I make the call:
...ANSWER
Answered 2022-Jan-07 at 03:02I was just sending the incorrect timestamp string to the hashing function, in this line:
QUESTION
So this is my first time doing this, i am trying to import this project https://github.com/binance-exchange/binance-java-api to my new clean intellij maven project.
i set my system variable MAVEN_HOME to:
- C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2020.3.2\plugins\maven\lib
And then im trying to install the 3th party library to my local m2 repository.
...ANSWER
Answered 2021-Oct-31 at 15:20You have not installed maven properly or it's not on PATH (refer this to properly install maven )
Or Add the dependency along with external repo to pom file then choose maven > Re-import
from intelij it should fix the import issues
QUESTION
I am pulling live data for BTCUSDT from binance every 1 minute using binance-api, and I want to calculate the percentage change between the current candle close price and the previous candle I have tried the following:
...ANSWER
Answered 2021-Aug-18 at 17:03It looks like you're pulling one row at a time since you have limit=1
. So when you diff, there's nothing to diff against. And with fillna(0)
, you'll end up with diffs of 0.
QUESTION
Hi I thought this would be pretty straightforwards but I can't figure it out.
It can't find binance.websockets for whatever reason even though it can find binance.client which should be part of the same package?
...ANSWER
Answered 2021-May-03 at 14:22use this " pip install python-binance==0.7.9 "
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.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install 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