Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
package main
import (
"fmt"
coincheckgo "github.com/Akagi201/coincheckgo"
)
type TickerResult struct {
Last float64
Bid float64
Ask float64
High float64
Low float64
Volume float64
Timestamp int
}
func main() {
client := new(coincheckgo.CoinCheck).NewClient("YourAccessKey", "YourSecretKey")
// Ticker
fmt.Println(getTicker(client))
// 残高
balance := client.Account.Balance()
fmt.Println(balance)
}
func getTicker(client coincheckgo.CoinCheck) TickerResult {
resp := client.Ticker.All()
var tick_result TickerResult
json_err := json.Unmarshal([]byte(resp), &tick_result)
if json_err != nil {
panic(json_err)
}
return tick_result
}
@k1asa

This comment has been minimized.

Copy link

k1asa commented Jan 10, 2018

"encoding/json" のimportが必要なようでしたので
念のためご報告させていただきます。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.