Giter Site home page Giter Site logo

Comments (4)

adshao avatar adshao commented on June 14, 2024

hi @georgk10 , could you set client.Debug = true to print the request info?
I'm not sure the restriction of Market order, however, it would be better to ask admins in binance API telegram group about the error.

from go-binance.

georgk10 avatar georgk10 commented on June 14, 2024

Hi @adshao , here is the output generated by my bot with client.debug = true:

Binance-golang 2020/01/16 18:06:00 full url: https://api.binance.com/api/v3/order?timestamp=1579197960975&signature=acd8a5a055da0c39a4dbe18b8708594e8f7475374e7c96cecde2fb15d5dbe510, body: quantity=0.000000&side=BUY&symbol=BTCUSDT&type=MARKET
Binance-golang 2020/01/16 18:06:00 request: &http.Request{Method:"POST", URL:(*url.URL)(0xc42070ee00), Proto:"HTTP/1.1", ProtoMajor:1, ProtoMinor:1, Header:http.Header{"Content-Type":[]string{"application/x-www-form-urlencoded"}, "X-Mbx-Apikey":[]string{"3CKOVkhL4frCVTCeNwLpExQIRjsFQ9Ab0c4OUX59pKRqmpMTH19PsNhgCR9lzlpk"}}, Body:ioutil.nopCloser{Reader:(*bytes.Buffer)(0xc42091dd50)}, GetBody:(func() (io.ReadCloser, error))(0x7f9342518900), ContentLength:53, TransferEncoding:[]string(nil), Close:false, Host:"api.binance.com", Form:url.Values(nil), PostForm:url.Values(nil), MultipartForm:(*multipart.Form)(nil), Trailer:http.Header(nil), RemoteAddr:"", RequestURI:"", TLS:(*tls.ConnectionState)(nil), Cancel:(<-chan struct {})(nil), Response:(*http.Response)(nil), ctx:(*context.emptyCtx)(0xc42000c4a0)}
Binance-golang 2020/01/16 18:06:01 full url: https://api.binance.com/api/v3/order?timestamp=1579197961000&signature=cda371064faa441b1fd16286cecce45318f0de5400bb8e88a4213ff987b63ba7, body: quantity=0.000000&side=BUY&symbol=ETHBTC&type=MARKET
Binance-golang 2020/01/16 18:06:01 request: &http.Request{Method:"POST", URL:(*url.URL)(0xc42070f080), Proto:"HTTP/1.1", ProtoMajor:1, ProtoMinor:1, Header:http.Header{"X-Mbx-Apikey":[]string{"3CKOVkhL4frCVTCeNwLpExQIRjsFQ9Ab0c4OUX59pKRqmpMTH19PsNhgCR9lzlpk"}, "Content-Type":[]string{"application/x-www-form-urlencoded"}}, Body:ioutil.nopCloser{Reader:(*bytes.Buffer)(0xc4208520e0)}, GetBody:(func() (io.ReadCloser, error))(0x7f9342518900), ContentLength:52, TransferEncoding:[]string(nil), Close:false, Host:"api.binance.com", Form:url.Values(nil), PostForm:url.Values(nil), MultipartForm:(*multipart.Form)(nil), Trailer:http.Header(nil), RemoteAddr:"", RequestURI:"", TLS:(*tls.ConnectionState)(nil), Cancel:(<-chan struct {})(nil), Response:(*http.Response)(nil), ctx:(*context.emptyCtx)(0xc42000c4a0)}
Binance-golang 2020/01/16 18:06:01 full url: https://api.binance.com/api/v3/order?timestamp=1579197961025&signature=621eb739a7c76e3b4abc21af66acbbd5f2e025de8e77e67aa11fe3b8d7e2a217, body: quantity=0.000000&side=SELL&symbol=ETHUSDT&type=MARKET
Binance-golang 2020/01/16 18:06:01 request: &http.Request{Method:"POST", URL:(*url.URL)(0xc42070f500), Proto:"HTTP/1.1", ProtoMajor:1, ProtoMinor:1, Header:http.Header{"Content-Type":[]string{"application/x-www-form-urlencoded"}, "X-Mbx-Apikey":[]string{"3CKOVkhL4frCVTCeNwLpExQIRjsFQ9Ab0c4OUX59pKRqmpMTH19PsNhgCR9lzlpk"}}, Body:ioutil.nopCloser{Reader:(*bytes.Buffer)(0xc420852620)}, GetBody:(func() (io.ReadCloser, error))(0x7f9342518900), ContentLength:54, TransferEncoding:[]string(nil), Close:false, Host:"api.binance.com", Form:url.Values(nil), PostForm:url.Values(nil), MultipartForm:(*multipart.Form)(nil), Trailer:http.Header(nil), RemoteAddr:"", RequestURI:"", TLS:(*tls.ConnectionState)(nil), Cancel:(<-chan struct {})(nil), Response:(*http.Response)(nil), ctx:(*context.emptyCtx)(0xc42000c4a0)}
Binance-golang 2020/01/16 18:06:01 response: &http.Response{Status:"400 Bad Request", StatusCode:400, Proto:"HTTP/2.0", ProtoMajor:2, ProtoMinor:0, Header:http.Header{"Date":[]string{"Thu, 16 Jan 2020 18:06:01 GMT"}, "Server":[]string{"nginx"}, "X-Mbx-Uuid":[]string{"2b5088c2-b8fc-4f76-88f2-b906c5d71414"}, "X-Cache":[]string{"Error from cloudfront"}, "Via":[]string{"1.1 5e2b2bef8be6bee05fe23de3ed9e3a6e.cloudfront.net (CloudFront)"}, "X-Amz-Cf-Id":[]string{"Q0sqHtThGAz-v_8eXU8a12w1YaWNt4leF4DWNTSi0DjSoL35Augwhw=="}, "X-Mbx-Used-Weight-1m":[]string{"6"}, "X-Content-Type-Options":[]string{"nosniff"}, "Content-Security-Policy":[]string{"default-src 'self'"}, "Pragma":[]string{"no-cache"}, "X-Amz-Cf-Pop":[]string{"DUB2-C1"}, "X-Mbx-Used-Weight":[]string{"6"}, "Strict-Transport-Security":[]string{"max-age=31536000; includeSubdomains"}, "X-Content-Security-Policy":[]string{"default-src 'self'"}, "X-Webkit-Csp":[]string{"default-src 'self'"}, "Expires":[]string{"0"}, "Content-Type":[]string{"application/json;charset=utf-8"}, "X-Frame-Options":[]string{"SAMEORIGIN"}, "X-Xss-Protection":[]string{"1; mode=block"}, "Cache-Control":[]string{"no-cache, no-store, must-revalidate"}}, Body:http.http2transportResponseBody{cs:(*http.http2clientStream)(0xc4203d6140)}, ContentLength:-1, TransferEncoding:[]string(nil), Close:false, Uncompressed:false, Trailer:http.Header(nil), Request:(*http.Request)(0xc4200ec400), TLS:(*tls.ConnectionState)(0xc4203cc790)}
Binance-golang 2020/01/16 18:06:01 response body: {"code":-1106,"msg":"Parameter 'quantity' sent when not required."}
Binance-golang 2020/01/16 18:06:01 response status code: 400
code=-1106, msg=Parameter 'quantity' sent when not required.

from go-binance.

georgk10 avatar georgk10 commented on June 14, 2024

Problem solved, the log showed that quantity was set to 0 due to an calculation problem. Everything works fine now. Thanks for the hint with setting client.debug = true

from go-binance.

adshao avatar adshao commented on June 14, 2024

Problem solved, the log showed that quantity was set to 0 due to an calculation problem. Everything works fine now. Thanks for the hint with setting client.debug = true

Glad to hear that.

from go-binance.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.