- Notifications
You must be signed in to change notification settings - Fork639
Cryptocurrency Exchange REST API SDK Wrapper Implemented With the golang, Supporting OKX, Huobi, Binance
License
NotificationsYou must be signed in to change notification settings
nntaoli-project/goex
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
- Unified and standardize the interfaces of various cryptocurrency trading platforms.
- [BTC] 1GoEXwVvXG7kNdQSFaUNF35A3izHojLGxP
- [USDT-TRC20] TGoExC6xvzE4wSA9cYZnwcPaXEjibA5Vtc
package mainimport (goexv2"github.com/nntaoli-project/goex/v2""github.com/nntaoli-project/goex/v2/logger""github.com/nntaoli-project/goex/v2/model""github.com/nntaoli-project/goex/v2/options""log")funcmain() {logger.SetLevel(logger.DEBUG)// set log level//goexv2.DefaultHttpCli.SetProxy("socks5://127.0.0.1:1080") //socks5 proxygoexv2.DefaultHttpCli.SetTimeout(5)// 5 second_,_,err:=goexv2.OKx.Spot.GetExchangeInfo()//must calliferr!=nil {panic(err)}//This CurrencyPair structure contains various information about the trading pair, such as price_precision and qty_precision,min_qty ...btcUSDTCurrencyPair,err:=goexv2.OKx.Spot.NewCurrencyPair(model.BTC,model.USDT)iferr!=nil {panic(err)}//public apilog.Println(goexv2.OKx.Spot.GetTicker(btcUSDTCurrencyPair))//private apiokxPrvApi:=goexv2.OKx.Spot.NewPrvApi(options.WithApiKey(""),options.WithApiSecretKey(""),options.WithPassphrase(""))//create order apiorder,_,err:=okxPrvApi.CreateOrder(btcUSDTCurrencyPair,0.01,18000,model.Spot_Buy,model.OrderType_Limit)log.Println(err)log.Println(order)}
See (issues/238)
ord, resp, err := okxPrvApi.CreateOrder(btcUSDTCurrencyPair, 0.01, 23000,model.Spot_Buy, model.OrderType_Limit,model.OptionParameter{}.OrderClientID("goex123027892")) //client id: goex123027892
About
Cryptocurrency Exchange REST API SDK Wrapper Implemented With the golang, Supporting OKX, Huobi, Binance
Topics
Resources
License
Stars
Watchers
Forks
Packages0
No packages published