From cb49a3cee091f7eb2455bd9d0b13dc67313c5ec9 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sat, 6 Jun 2015 20:04:35 -0400 Subject: Add main.go Uses `coinbase-go` to get my Coinbase balance and prints it to the console. --- main.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 main.go diff --git a/main.go b/main.go new file mode 100644 index 0000000..f67c3f3 --- /dev/null +++ b/main.go @@ -0,0 +1,18 @@ +package main + +import ( + "com.teddywing/new-house-on-the-block/vendor/_nuts/github.com/fabioberger/coinbase-go" + "fmt" + "log" + "os" +) + +func main() { + c := coinbase.ApiKeyClientSandbox(os.Getenv("COINBASE_KEY"), os.Getenv("COINBASE_SECRET")) + + balance, err := c.GetBalance() + if err != nil { + log.Print(err) + } + fmt.Printf("Balance is %f BTC\n", balance) +} -- cgit v1.2.3