binance / binance-connector-go Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
func Ticker24hr() {
baseURL := "https://api.binance.com"
client := binance_connector.NewClient("", "", baseURL)
// Ticker24hr
ticker24hr, err := client.NewTicker24hrService().
//Symbol("BTCUSDT")
Symbols([]string{"BTCUSDT", "ETHUSDT"}).
.Do(context.Background())
if err != nil {
fmt.Println(err)
return
}
fmt.Println(binance_connector.PrettyPrint(ticker24hr))
}
Logs
<APIError> code=-1100, msg=Illegal characters found in parameter 'symbols'; legal range is '^\[("[A-Z0-9-_.]{1,20}"(,"[A-Z0-9-_.]{1,20}"){0,}){0,1}\]$'.
This endpoint is "/api/v3/order/test", so I don't think there should be a signature.
Full error response:
code=-1102, msg=Mandatory parameter 'signature' was not sent, was empty/null, or malformed
I suggest changing github.com/bitly/go-simplejson to insane-json.
I made a small benchmark and found another one from the creator of the library.
As the benchmark shows, its speed is higher, and the number of allocations is less, which is more suitable for designing high-speed applications using this API.
API URL : https://binance-docs.github.io/apidocs/spot/en/#fiat-endpoints
There is no references of /sapi/v1/fiat/
in the whole project.
I will work on it in a pull request if I find the time.
[readme page error] web socket for futures is supported, but not in read-me page
https://github.com/binance/binance-connector-go?tab=readme-ov-file#limitations
In the case where the request parameter has a small floating point number, the client sends it in exponential format.
For example. Price = 0.00000028 but client sends 2.8e-07 resulting in validation error
Hello, the followig code snippet demonstrates there's another filter tyoe, not currently implemented:
exchangeInfo, err := anonClient.NewExchangeInfoService().Do(context.Background()).
...
for _, s := range exchangeInfo.Symbols {
if s.Symbol == symbol {
baseAsset = s.BaseAsset
quoteAsset = s.QuoteAsset
// Rileviamo i valori di interesse dai filtri maledetti
for _, f := range s.Filters {
if f.FilterType == "LOT_SIZE" {
minQty, err = strconv.ParseFloat(f.MinQty, 64)
CheckErr(err)
maxQty, err = strconv.ParseFloat(f.MaxQty, 64)
CheckErr(err)
stepSize, err = strconv.ParseFloat(f.StepSize, 64)
CheckErr(err)
}
if f.FilterType == "MIN_NOTIONAL" {
minNotional, err = strconv.ParseFloat(f.MinNotional, 64)
CheckErr(err)
}
if f.FilterType == "NOTIONAL" {
log.Fatalf("Encontered NOTIONAL filter: not in binance-connector-go!")
// notional, err = strconv.ParseFloat(f.Notional, 64)
// CheckErr(err)
}
}
break
}
}
And in the log, you read at each call:
2024/04/23 15:23:19 Encontered NOTIONAL filter: not in binance-connector-go!
The commented line:
// notional, err = strconv.ParseFloat(f.Notional, 64)
generates a compile time error of "binance_connector.FilterType has no field 'Notional'"
So how to handle NOTIONAL filter errors on both BUY and SELL orders from time to time?
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.