-
Notifications
You must be signed in to change notification settings - Fork 220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
why there was different response on same request? #155
Comments
Hi @yushoaqiang please could you post your code so we can try to reproduce the problem (for obvious reasons do not expose your api keys) |
func getPositions(client *http.Client){
} func GetParamHmacSha384Sign(secret, params string) (string, error) { func NewHttpRequest(client *http.Client, reqType string, reqUrl string, postData string, requstHeaders map[string]string) ([]byte, error) {
} |
this is my code,thank you! |
Thank @yushoaqiang. There may be a problem with the signing of the request here, could you please try using the built in rest client since that handles all of the authentication for you. Here is an example which achieves the same result as what you are attempting above: package main
import (
"flag"
"log"
"os"
"github.com/bitfinexcom/bitfinex-api-go/v2/rest"
"github.com/davecgh/go-spew/spew"
)
func main() {
apikey := ""
secKey := ""
c := rest.NewClient().Credentials(key, secret)
psoitions, err := c.Positions.All()
if err != nil {
log.Fatalf("getting wallet %s", err)
}
spew.Dump(positions)
} Let me know how that turns out! |
Also if there is a specific reason as to why you want to handle the signature generation then please refer to the signing method in the library which can be found here: https://github.com/bitfinexcom/bitfinex-api-go/blob/master/v2/rest/client.go#L122 |
I have to use a proxy to complete the http request, but it's too hard in your library. |
are you bitfinex developer?
I called v2 api, positions.
sometimes it return sucess,sometimes it return error:invalid key.
The text was updated successfully, but these errors were encountered: