From fd79b09ad0e7d0e3165c70ca0908ec1ac0a7116c Mon Sep 17 00:00:00 2001 From: salaaad2 Date: Sun, 17 Apr 2022 17:52:29 +0200 Subject: smith is cool --- gosrc/requests.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'gosrc/requests.go') diff --git a/gosrc/requests.go b/gosrc/requests.go index 0a939c0..6c36f02 100644 --- a/gosrc/requests.go +++ b/gosrc/requests.go @@ -7,7 +7,6 @@ package main import ( - "fmt" "log" "net/http" "strings" @@ -25,6 +24,14 @@ import "C" func send_request(body string, signature string, endpoint string, config Config) (*http.Response, error) { // new client to allow defering of requests client := &http.Client{} + switch (endpoint) { + case "Account Status": + endpoint = Endpoints.status + case "Available Coins": + endpoint = Endpoints.getall + case "Buy X coin ": + return nil, nil + } url := "https://" + config.Mirror + "/" + endpoint + "?" + body + "&signature=" + signature // add some ifs here @@ -40,13 +47,11 @@ func send_request(body string, signature string, endpoint string, config Config) log.Fatal("error: making http request ", err) } - defer response.Body.Close() return response, nil } // sign request with given private key func sign_request(body string, key string) string { - fmt.Println("signing request : ", body) // run pipeline out2, err := RunStrings("/usr/bin/echo", "-n", body, "|", "/usr/bin/openssl", "dgst", "-sha256", "-hmac", key) -- cgit v1.2.3