https://github.com/nntaoli-project/goex
Cryptocurrency Exchange REST API SDK Wrapper Implemented With the golang, Supporting OKX, Huobi, Binance
https://github.com/nntaoli-project/goex
api-rest binance huobi okx quant
Last synced: 5 days ago
JSON representation
Cryptocurrency Exchange REST API SDK Wrapper Implemented With the golang, Supporting OKX, Huobi, Binance
- Host: GitHub
- URL: https://github.com/nntaoli-project/goex
- Owner: nntaoli-project
- License: mit
- Created: 2016-05-26T12:28:52.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2025-03-28T09:06:35.000Z (18 days ago)
- Last Synced: 2025-04-09T19:16:13.277Z (5 days ago)
- Topics: api-rest, binance, huobi, okx, quant
- Language: Go
- Homepage:
- Size: 2.06 MB
- Stars: 1,907
- Watchers: 95
- Forks: 639
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-go-quant - goex - Exchange Rest And WebSocket API For Golang Wrapper support okcoin,okex,huobi,hbdm,bitmex,coinex,poloniex,bitfinex,bitstamp,binance,kraken,bithumb,zb,hitbtc,fcoin, coinbene (Golang / Trading & Backtesting)
- awesome-hacking-lists - nntaoli-project/goex - Cryptocurrency Exchange REST API SDK Wrapper Implemented With the golang, Supporting OKX, Huobi, Binance (Go)
README
### Introduction
* Unified and standardize the interfaces of various cryptocurrency trading platforms.
### Donate
* [BTC] 1GoEXwVvXG7kNdQSFaUNF35A3izHojLGxP
* [USDT-TRC20] TGoExC6xvzE4wSA9cYZnwcPaXEjibA5Vtc### Example
```golang
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"
)func main() {
logger.SetLevel(logger.DEBUG) // set log level
//goexv2.DefaultHttpCli.SetProxy("socks5://127.0.0.1:1080") //socks5 proxy
goexv2.DefaultHttpCli.SetTimeout(5) // 5 second_, _, err := goexv2.OKx.Spot.GetExchangeInfo() //must call
if err != 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)
if err != nil {
panic(err)
}
//public api
log.Println(goexv2.OKx.Spot.GetTicker(btcUSDTCurrencyPair))//private api
okxPrvApi := goexv2.OKx.Spot.NewPrvApi(
options.WithApiKey(""),
options.WithApiSecretKey(""),
options.WithPassphrase(""))
//create order api
order, _, err := okxPrvApi.CreateOrder(btcUSDTCurrencyPair, 0.01, 18000, model.Spot_Buy, model.OrderType_Limit)
log.Println(err)
log.Println(order)
}
```### FAQ
#### 1. okx simulated trading
See ([issues/238](https://github.com/nntaoli-project/goex/issues/238))#### 2. Filled The OrderClientID
```
ord, resp, err := okxPrvApi.CreateOrder(btcUSDTCurrencyPair, 0.01, 23000,
model.Spot_Buy, model.OrderType_Limit,
model.OptionParameter{}.OrderClientID("goex123027892")) //client id: goex123027892
```