module
Version:
v0.0.4
Opens a new window with list of versions in this module.
Published: Apr 16, 2021
License: MIT
Opens a new window with license information.
README
¶
go-gmo-coin
sample
import "github.com/vouquet/go-gmo-coin/gomocoin"
func main() {
API_KEY = "your api key"
SECRET_KEY = "your secret key"
gmocoin, err := gomocoin.NewGoMOcoin(API_KEY, SECRET_KEY, context.Background())
if err != nil {
panic(err)
}
defer gmocoin.Close()
rates, err = gmocoin.GetRate()
if err != nil {
panic(err)
}
for symbol, rate := range rates {
log.Println(symbol, rate.Ask(), rate.Bid())
}
//buy
if err := gmocoin.MarketOrder(gomocoin.SYMBOL_BTC, gomocoin.SIDE_BUY, 0.0001); err != nil {
panic(err)
}
//sell
if err := gmocoin.MarketOrder(gomocoin.SYMBOL_BTC, gomocoin.SIDE_BUY, 0.0001); err != nil {
panic(err)
}
}
Directories
¶
Click to show internal directories.
Click to hide internal directories.