Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nntaoli-project/goex
Cryptocurrency Exchange REST API SDK Wrapper Implemented With Golang, Supporting OKX, Huobi, Binance
https://github.com/nntaoli-project/goex
api-rest binance huobi okx quant
Last synced: 2 days ago
JSON representation
Cryptocurrency Exchange REST API SDK Wrapper Implemented With 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 (over 8 years ago)
- Default Branch: v2.0
- Last Pushed: 2024-09-23T09:04:05.000Z (3 months ago)
- Last Synced: 2024-10-29T15:06:55.572Z (about 1 month ago)
- Topics: api-rest, binance, huobi, okx, quant
- Language: Go
- Homepage:
- Size: 2.06 MB
- Stars: 1,831
- Watchers: 96
- Forks: 630
- Open Issues: 1
-
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 For Golang Wrapper Support okx,huobi,binance (Go)
README
### Introduction
* Unified and standardize the interfaces of various cryptocurrency trading platforms.![goex](goex_struct.png)
### 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) //设置日志输出级别
//goexv2.DefaultHttpCli.SetProxy("socks5://127.0.0.1:1080") //socks代理
goexv2.DefaultHttpCli.SetTimeout(5) // 5 second_, _, err := goexv2.OKx.Spot.GetExchangeInfo() //建议调用
if err != nil {
panic(err)
}
btcUSDTCurrencyPair, err := goexv2.OKx.Spot.NewCurrencyPair(model.BTC, model.USDT)//建议这样构建CurrencyPair
if err != nil {
panic(err)
}
//共有api调用
log.Println(goexv2.OKx.Spot.GetTicker(btcUSDTCurrencyPair))//私有API调用
okxPrvApi := goexv2.OKx.Spot.NewPrvApi(
options.WithApiKey(""),
options.WithApiSecretKey(""),
options.WithPassphrase(""))
//创建订单
order, _, err := okxPrvApi.CreateOrder(btcUSDTCurrencyPair, 0.01, 18000, model.Spot_Buy, model.OrderType_Limit)
log.Println(err)
log.Println(order)
}
```### 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
```