aboutsummaryrefslogtreecommitdiffstats
path: root/gosrc/requests.go
diff options
context:
space:
mode:
authorsalaaad2 <arthurdurant263@gmail.com>2022-04-01 22:58:13 +0200
committersalaaad2 <arthurdurant263@gmail.com>2022-04-01 22:58:13 +0200
commit1758ce649422255bd2faf482c02be71ce0783865 (patch)
treec4faa014bd905a949f5c563fa91d148dacea4888 /gosrc/requests.go
parenthehe (diff)
downloadsmith-1758ce649422255bd2faf482c02be71ce0783865.tar.gz
smith-1758ce649422255bd2faf482c02be71ce0783865.tar.bz2
smith-1758ce649422255bd2faf482c02be71ce0783865.tar.xz
smith-1758ce649422255bd2faf482c02be71ce0783865.tar.zst
smith-1758ce649422255bd2faf482c02be71ce0783865.zip
signing requests
Diffstat (limited to 'gosrc/requests.go')
-rw-r--r--gosrc/requests.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/gosrc/requests.go b/gosrc/requests.go
new file mode 100644
index 0000000..4e94533
--- /dev/null
+++ b/gosrc/requests.go
@@ -0,0 +1,23 @@
+package main
+
+import (
+ "fmt"
+ "log"
+)
+
+func sign_request(body string, key string) {
+ fmt.Println("signing request : ", body)
+
+ out2, err := RunStrings("/usr/bin/echo", "-n", body, "|", "/usr/bin/openssl", "dgst", "-sha256", "-hmac", key)
+ if err != nil {
+ log.Fatal("hwhat")
+ }
+
+ fmt.Println(out2)
+ // here
+}
+
+func make_body(order string, ticker string, price string) {
+ ret := "GET /sapi/v1/capital/config/getall"
+ sign_request(ret, "heheheheh")
+}